0
我正在开发一个maven web项目。 我创建了一个不同的Maven项目,其中包含我想在主项目中使用的几个小程序。该项目被添加为主项目的依赖项。复制带有依赖关系的签名jar
在我的小程序项目POM,
我添加了一个插件,用于创建具有依赖性的罐子,
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.3</version>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
<executions>
<execution>
<id>make-assembly</id> <!-- this is used for inheritance merges -->
<phase>package</phase> <!-- bind to the packaging phase -->
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
我也签署了uberjar避免一些安全限制。
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>sign</goal>
</goals>
</execution>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
<configuration>
<jarPath>${project.build.directory}/${project.build.FinalName}-${project.packaging}-with-dependencies.${project.packaging}</jarPath>
<keystore>${basedir}/signstore.jks</keystore>
<alias>signstore</alias>
<storepass>signstore</storepass>
</configuration>
</plugin>
我现在要签署的uberjar复制到WebApp文件夹每当我建主体工程,所以我的HTML文件可以使用它。
这可能吗?我只设法复制没有依赖关系的jar。
如果你想复制这个jar,我会深入研究maven-dependency-plugin来使用它进行复制。我不确定这是否符合您的要求。 – khmarbaise
嗯,我已经看过,但我不知道如何选择具有依赖项的jar而不是标准jar。 – user1337157
在主项目中指定jar-with-the-dependencies作为'dependency'。这将使这个罐子进行复制。 – Raghuram