Maven Shade插件未附加着色工件

Maven Shade插件未附加着色工件,maven,maven-shade-plugin,Maven,Maven Shade Plugin,我试图使用maven shade插件来区分Java6和Java7工件。我的理解是,原来的神器将被阴影的神器所取代 [INFO] Replacing original artifact with shaded artifact. [INFO] Replacing /Users/carlos/path/Libraries/xml/target/xml-1.5.0-SNAPSHOT.jar with /Users/carlos/path/Libraries/xml/target/xml-1.5.0-S

我试图使用maven shade插件来区分Java6和Java7工件。我的理解是,原来的神器将被阴影的神器所取代

[INFO] Replacing original artifact with shaded artifact.
[INFO] Replacing /Users/carlos/path/Libraries/xml/target/xml-1.5.0-SNAPSHOT.jar with /Users/carlos/path/Libraries/xml/target/xml-1.5.0-SNAPSHOT-SHADED.jar
[INFO] Replacing original test artifact with shaded test artifact.
[INFO] Replacing /Users/carlos/path/Libraries/xml/target/xml-1.5.0-SNAPSHOT-tests.jar with /Users/carlos/path/Libraries/xml/target/xml-1.5.0-SNAPSHOT-SHADED-tests.jar
[INFO] Dependency-reduced POM written at: /Users/carlos/path/Libraries/xml/dependency-reduced-pom.xml
[INFO] 
[INFO] --- maven-install-plugin:2.4:install (default-install) @ xml ---
[INFO] Installing /Users/carlos/path/Libraries/xml/target/xml-1.5.0-SNAPSHOT.jar to /Users/carlos/.m2/repository/com/company/xml/1.5.0-SNAPSHOT/xml-1.5.0-SNAPSHOT.jar
[INFO] Installing /Users/carlos/path/Libraries/xml/dependency-reduced-pom.xml to /Users/carlos/.m2/repository/com/company/xml/1.5.0-SNAPSHOT/xml-1.5.0-SNAPSHOT.pom
[INFO] Installing /Users/carlos/path/Libraries/xml/target/xml-1.5.0-SNAPSHOT-tests.jar to /Users/carlos/.m2/repository/com/company/xml/1.5.0-SNAPSHOT/xml-1.5.0-SNAPSHOT-tests.jar
[INFO] Installing /Users/carlos/path/Libraries/xml/target/xml-1.5.0-SNAPSHOT-sources.jar to /Users/carlos/.m2/repository/com/company/xml/1.5.0-SNAPSHOT/xml-1.5.0-SNAPSHOT-sources.jar
[INFO] Installing /Users/carlos/path/Libraries/xml/target/xml-1.5.0-SNAPSHOT-tests.jar to /Users/carlos/.m2/repository/com/company/xml/1.5.0-SNAPSHOT/xml-1.5.0-SNAPSHOT-tests.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 23.724 s
[INFO] Finished at: 2015-02-19T15:53:50-05:00
[INFO] Final Memory: 22M/631M
[INFO] ------------------------------------------------------------------------
但是,它是在没有着色分类器的情况下安装的。以下是我的shade插件配置:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-shade-plugin</artifactId>
    <version>2.3</version>
    <executions>
        <execution>
            <phase>package</phase>
            <goals>
                <goal>shade</goal>
            </goals>
            <configuration>
                <shadeTestJar>true</shadeTestJar>
                <shadedClassifierName>SHADED</shadedClassifierName>
            </configuration>
        </execution>
    </executions>
</plugin>

org.apache.maven.plugins
maven阴影插件
2.3
包裹
阴凉处
真的
遮住的
有人能告诉我如何用合适的分类器安装它吗?另外,我使用这个而不是maven jar插件,因为我还需要能够对测试jar进行分类。

插件配置中缺少您。如果没有它,着色jar将仍然是项目的主要工件,因此不会应用分类器(因为主要工件没有分类器)


org.apache.maven.plugins
maven阴影插件
2.3
包裹
阴凉处
真的
遮住的
真的

但这也会创建原始工件。所以两个都安装了。我只需要部署机密版本。我需要重命名或“着色”原始工件,否则我将加倍创建所有JAR。不可能为主Maven工件设置分类器。看见再说,你为什么要这么做?分类器用于向项目中添加额外的构件,如其源代码或javadoc。我需要对maven jar插件创建的测试进行着色,以伪装其Java版本,但我也不想创建未分类的jar。你知道我怎么做吗?正如我所说的,你不能用分类器创建一个主工件。要区分不同的JDK版本,请参阅。这对maven jar插件不起作用。测试jar不支持分类器
<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-shade-plugin</artifactId>
    <version>2.3</version>
    <executions>
        <execution>
            <phase>package</phase>
            <goals>
                <goal>shade</goal>
            </goals>
            <configuration>
                <shadeTestJar>true</shadeTestJar>
                <shadedClassifierName>SHADED</shadedClassifierName>
                <shadedArtifactAttached>true</shadedArtifactAttached>
            </configuration>
        </execution>
    </executions>
</plugin>