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