我已经放入了pom.xml:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.10</version>
<configuration>
<sourceIncludes>
<sourceInclude>target/generated-test-sources/protobuf/java/**</sourceInclude>
</sourceIncludes>
</configuration>
</plugin>但是当我运行的时候:
mvn eclipse:eclipse -Dwtpversion=2.0 install它不会将.classpath配置为包括此目录。
感谢你的帮助。
发布于 2015-09-18 22:56:48
我找到了另一种方法来实现这个目标:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<id>add-source</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>target/generated-test-sources/protobuf/java</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>来源:How to add an extra source directory for maven to compile and include in the build jar?
https://stackoverflow.com/questions/32652684
复制相似问题