【发布时间】:2014-11-22 20:49:30
【问题描述】:
我创建了一个 pom.xml 来编译我的项目并将其打包为 jar, 确实它编译并创建了 jar - 问题是我有一个里面有类和 java 的 jar,我只想要里面的类。
如何丢失 java 文件?我不需要它们。
这是我创建的 pom.xml:
<build>
<resources>
<resource>
<directory>src/main/java</directory>
<filtering>true</filtering>
</resource>
</resources>
<finalName>api-interfaces</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.4</version>
<executions>
<execution>
<id>make-a-jar</id>
<phase>compile</phase>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
<configuration>
<excludes>
<exclude>*.properties</exclude>
<exclude>*.xml</exclude>
<exclude>sql/**</exclude>
<exclude>META-INF/**</exclude>
<exclude>*.jar</exclude>
<exclude>*.java</exclude>
<exclude>default-configs/**</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>
【问题讨论】:
标签: maven jar maven-jar-plugin