1
我試圖用shade
插件包我的項目,但得到以下錯誤:的Maven插件遮陽無法解決javax.jnlp
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-shade-plugin:2.1:shade (default) on project HiveBrowser: Error creating shaded jar: Could not resolve dependencies for project HiveBrowser:HiveBrowser:jar:1.0: Could not find artifact javax.jnlp:jnlp:jar:1.6 in central (http://repo.maven.apache.org/maven2) -> [Help 1]
這裏是我的POM構建插件項:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<dependencies>
<dependency>
<groupId>javax.jnlp</groupId>
<artifactId>jnlp</artifactId>
<version>1.6</version>
<scope>system</scope>
<systemPath>${java.home}/sample/jnlp/servlet/jnlp.jar</systemPath>
</dependency>
</dependencies>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<shadedGroupFilter>org.apache.cxf</shadedGroupFilter>
<shadedArtifactAttached>false</shadedArtifactAttached>
<createSourcesJar>true</createSourcesJar>
<promoteTransitiveDependencies>true</promoteTransitiveDependencies>
<createDependencyReducedPom>true</createDependencyReducedPom>
<filters>
<filter>
<artifact>${project.groupId}:${project.artifactId}</artifact>
<excludes>
<exclude>org/**</exclude>
</excludes>
</filter>
</filters>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>org.hive.browser.Main</mainClass>
</transformer>
<transformer implementation="org.apache.maven.plugins.shade.resource.ApacheNoticeResourceTransformer">
<projectName>Apache CXF</projectName>
</transformer>
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>META-INF/spring.handlers</resource>
</transformer>
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>META-INF/services/com.sun.tools.xjc.Plugin</resource>
</transformer>
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>META-INF/spring.schemas</resource>
</transformer>
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>META-INF/cxf/cxf.extension</resource>
</transformer>
<transformer implementation="org.apache.maven.plugins.shade.resource.XmlAppendingTransformer">
<resource>META-INF/extensions.xml</resource>
</transformer>
<transformer implementation="org.apache.maven.plugins.shade.resource.XmlAppendingTransformer">
<resource>META-INF/cxf/extensions.xml</resource>
</transformer>
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>META-INF/cxf/bus-extensions.txt</resource>
</transformer>
<transformer implementation="org.apache.maven.plugins.shade.resource.XmlAppendingTransformer">
<resource>META-INF/cxf/bus-extensions.xml</resource>
</transformer>
<transformer implementation="org.apache.maven.plugins.shade.resource.XmlAppendingTransformer">
<resource>META-INF/wsdl.plugin.xml</resource>
</transformer>
<transformer implementation="org.apache.maven.plugins.shade.resource.XmlAppendingTransformer">
<resource>META-INF/tools.service.validator.xml</resource>
</transformer>
<!--<transformer implementation="org.apache.cxf.maven.PluginTransformer">-->
<!--<resource>META-INF/tools-plugin.xml</resource>-->
<!--</transformer>-->
<transformer implementation="org.apache.maven.plugins.shade.resource.XmlAppendingTransformer">
<resource>META-INF/cxf/java2wsbeans.xml</resource>
</transformer>
<!--<transformer implementation="org.apache.cxf.maven.CXFAllTransformer"/>-->
</transformers>
</configuration>
</execution>
</executions>
</plugin>
我使用Java 1.6的MacOSX 10.6 出現了什麼問題?