我正在使用 Eclipse 和 Maven。在使用 Maven 构建项目时,我需要将多个类文件合并到一个 jar 中。
所以我将以下内容添加到 pom.xml 中:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.4</version>
<configuration>
<archive>
<index>false</index>
<classesDirectory>${project.build.classes.de.filter}</classesDirectory>
<finalName>BasicFilters</finalName>
<outputDirectory>${project.build.Plugins}</outputDirectory>
</archive>
</configuration>
<executions>
<execution>
<id>Building Jar from Filters</id>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
建筑物显示:构建成功,但它没有构建任何 jar,并且控制台中没有显示来自插件的信息。
最佳答案
关于java - 使用 Maven 从多个类文件生成 jar,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19998611/