全名:
org.apache.maven.plugins:maven-shade-plugin:1.4:shade
说明:
属性:
runtime
.package
.姓名 | 类型 | 自从 | 描述 |
---|---|---|---|
工件集 | ArtifactSet |
- |
从最终工件中包含/排除的工件。人工制品由通用形式的复合标识符表示
groupId:artifactId:type:classifier 。从 1.3 版开始,通配符 '*' 和 '?' 可以在这些复合标识符的子部分中使用以进行模式匹配。为方便起见,语法groupId 等价于
groupId:*:*:* ,groupId:artifactId 等价于groupId:artifactId:*:* 和
groupId:artifactId:classifier 等价于
groupId:artifactId:*:classifier 。例如:
<artifactSet> <includes> <include>org.apache.maven:*</include> </includes> <excludes> <exclude>*:maven-core</exclude> </excludes> </artifactSet> |
createDependencyReducedPom | boolean |
- |
标记是否为着色工件生成简化的 POM。如果设置为true ,则已包含在 uber JAR 中的依赖项将从
<dependencies> 生成的 POM 部分中删除。减少的 POM 将被命名dependency-reduced-pom.xml
并存储到与阴影工件相同的目录中。默认值为: true 。 |
创建SourcesJar | boolean |
- |
当为 true 时,它也会尝试创建一个源 jar 默认值为: false 。 |
过滤器 | ArchiveFilter[] |
- |
要使用的存档过滤器。允许您以复合标识符
artifactSet 和一组包含/排除文件模式的形式指定工件,以过滤将归档的哪些内容添加到阴影 jar 中。从逻辑的角度来看,包含在排除之前处理,因此可以使用包含从存档中收集一组文件,然后使用排除进一步减少该集合。默认情况下,包含所有文件,不排除任何文件。如果多个过滤器应用于一个工件,则匹配文件的交集将包含在最终 JAR 中。例如:
<filters> <filter> <artifact>junit:junit</artifact> <includes> <include>org/junit/**</include> </includes> <excludes> <exclude>org/junit/experimental/**</exclude> </excludes> </filter> </filters> |
最终名称 | String |
- |
阴影 artifactId 的名称。如果您想更改本机工件的名称,您可以使用 <build><finalName> 设置。如果将其设置为不同于 <build><finalName> 的值,则不会执行文件替换,即使正在使用 shadedArtifactAttached。 |
keepDependenciesWithProvidedScope | boolean |
- |
如果为 true,则依赖项保留在 pom 中,但范围为“已提供”;如果为 false,则删除依赖项。 默认值为: false 。 |
最小化Jar | boolean |
1.4 |
当为 true 时,依赖项将在类级别上被剥离为仅工件所需的传递外壳。注意:
使用此功能需要 Java 1.5 或更高版本。 默认值为: false 。 |
输出目录 | File |
- |
着色工件的目标目录。 默认值为: ${project.build.directory} 。 |
输出文件 | File |
1.3 |
着色工件的输出文件的路径。设置此参数后,创建的存档既不会替换项目的主要工件,也不会附加。因此,此参数会导致参数finalName 、
shadedArtifactAttached 和
在使用shadedClassifierName 时
createDependencyReducedPom 被忽略。 |
促进传递依赖 | boolean |
- |
当为真时,移除依赖的传递依赖被提升为直接依赖。这应该允许用新的阴影 jar 替换已删除的 deps,并且一切都应该仍然有效。 默认值为: false 。 |
搬迁 | PackageRelocation[] |
- |
要搬迁的包裹。例如:
<relocations> <relocation> <pattern>org.apache</pattern> <shadedPattern>hidden.org.apache</shadedPattern> <includes> <include>org.apache.maven.*</include> </includes> <excludes> <exclude>org.apache.maven.Public*</exclude> </excludes> </relocation> </relocations>注意:仅从 1.4 版开始支持包含。 |
shadedArtifactAttached | boolean |
- |
定义是否应将着色工件作为分类器附加到原始工件。如果为 false,阴影 jar 将是项目的主要工件 默认值为: false 。 |
shadedArtifactId | String |
- |
阴影 artifactId 的名称。因此,您可能希望使用不同的 artifactId 并保留标准版本。如果原始 artifactId 是“foo”,那么最终的 artifact 将类似于 foo-1.0.jar。因此,如果您更改 artifactId,您可能会得到类似 foo-special-1.0.jar 的内容。 默认值为: ${project.artifactId} 。 |
shadedClassifierName | String |
- |
在附加阴影工件的情况下使用的分类器的名称。 默认值为: shaded 。 |
阴影组过滤器 | String |
- |
如果指定,这将仅包括具有以 this 开头的 groupIds 的工件。 |
变压器 | ResourceTransformer[] |
- |
要使用的资源转换器。有关可用变压器及其配置的更多信息,请参阅“示例”部分。 |
工件集:
groupId:artifactId:type:classifier
。从 1.3 版开始,通配符 '*' 和 '?' 可以在这些复合标识符的子部分中使用以进行模式匹配。为方便起见,语法groupId
等价于
groupId:*:*:*
,groupId:artifactId
等价于groupId:artifactId:*:*
和
groupId:artifactId:classifier
等价于
groupId:artifactId:*:classifier
。例如:
<artifactSet> <includes> <include>org.apache.maven:*</include> </includes> <excludes> <exclude>*:maven-core</exclude> </excludes> </artifactSet>
org.apache.maven.plugins.shade.mojo.ArtifactSet
No
true
,则已包含在 uber JAR 中的依赖项将从
<dependencies>
生成的 POM 部分中删除。减少的 POM 将被命名dependency-reduced-pom.xml
并存储到与阴影工件相同的目录中。boolean
No
${createDependencyReducedPom}
true
boolean
No
${createSourcesJar}
false
过滤器:
artifactSet
和一组包含/排除文件模式的形式指定工件,以过滤将归档的哪些内容添加到阴影 jar 中。从逻辑的角度来看,包含在排除之前处理,因此可以使用包含从存档中收集一组文件,然后使用排除进一步减少该集合。默认情况下,包含所有文件,不排除任何文件。如果多个过滤器应用于一个工件,则匹配文件的交集将包含在最终 JAR 中。例如:
<filters> <filter> <artifact>junit:junit</artifact> <includes> <include>org/junit/**</include> </includes> <excludes> <exclude>org/junit/experimental/**</exclude> </excludes> </filter> </filters>
org.apache.maven.plugins.shade.mojo.ArchiveFilter[]
No
最终名称:
java.lang.String
No
${finalName}
keepDependenciesWithProvidedScope:
boolean
No
${keepDependenciesWithProvidedScope}
false
最小化罐:
boolean
1.4
No
false
输出目录:
java.io.File
No
${project.build.directory}
输出文件:
finalName
、
shadedArtifactAttached
和
在使用shadedClassifierName
时
createDependencyReducedPom
被忽略。java.io.File
1.3
No
boolean
No
${promoteTransitiveDependencies}
false
搬迁:
<relocations> <relocation> <pattern>org.apache</pattern> <shadedPattern>hidden.org.apache</shadedPattern> <includes> <include>org.apache.maven.*</include> </includes> <excludes> <exclude>org.apache.maven.Public*</exclude> </excludes> </relocation> </relocations>注意:仅从 1.4 版开始支持包含。
org.apache.maven.plugins.shade.mojo.PackageRelocation[]
No
boolean
No
${shadedArtifactAttached}
false
java.lang.String
No
${shadedArtifactId}
${project.artifactId}
java.lang.String
No
${shadedClassifierName}
shaded
java.lang.String
No
${shadedGroupFilter}
变压器:
org.apache.maven.plugins.shade.resource.ResourceTransformer[]
No