简体   繁体   中英

maven-eclipse-plugin additional source directory not working

I've put in 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>

But when I run:

mvn eclipse:eclipse -Dwtpversion=2.0 install

It does not configure .classpath to include this directory.

Appreciate help.

I found another way to achieve this goal:

<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>

Source: How to add an extra source directory for maven to compile and include in the build jar?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM