Ali
Ali

Reputation: 269

How to pass src directory to the classpath with maven eclipse plugin

My project structure is not like "src/main/java". How can I give src directory manually from pom.xml?

PS:I tried and tags. resources is applying the include command but,by default act, it also adds an exclude *..java also so it is not working. sourceIncludes is doing nothing:)

Upvotes: 0

Views: 839

Answers (2)

fmucar
fmucar

Reputation: 14548

build

<sourceDirectory>../java-path-to-source </sourceDirectory>

    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>2.0.2</version>
        <configuration>
          <includes><include>**</include></includes>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>

http://maven.apache.org/guides/mini/guide-using-one-source-directory.html

Upvotes: 0

Dave L.
Dave L.

Reputation: 11228

Add

<sourceDirectory>${basedir}/your-source-directory</sourceDirectory>

to the build section of your POM.

Upvotes: 2

Related Questions