我在同一個文件夾內有兩個maven項目。一個依賴於另一個,即另一個依賴於它。 現在我想使用maven遮罩插件和launch4j,但它似乎很複雜。Maven Shade Plugin + Launch4j
有人可以給我一步一步解釋我的情況嗎?
所以我有2個POM文件,每個項目一個。我的多模塊文件是這樣的:
<project xmlns="http://maven.apache.org/POM/4.0.0 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org</groupId>
<artifactId>some artifact</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<encoding>UTF-8</encoding>
<target>1.5</target>
<source>1.5</source>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>1.3.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<transformers>
<!-- This bit sets the main class for the executable jar as you otherwise -->
<!-- would with the assembly plugin -->
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<manifestEntries>
<Main-Class>my_main class from project1</Main-Class>
</manifestEntries>
</transformer>
<!-- This bit merges the various GeoTools META-INF/services files -->
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<modules>
<module>project1</module>
<module>project2</module>
</modules>
</project>
,然後我得到以下錯誤: 在項目2:無法創建陰影的神器,項目主神器不存在。
你有兩個項目在同一個文件夾,或者你有一個父項目內有兩個模塊?你能提供關於你的結構的更多細節嗎? – BrunoJCM 2012-05-21 18:32:00