0

I'm working on having all the configuration of a project managed by Maven instead of eclipse and I got stuck when I tried to change the Source from there.

This is what I have:

https://i.stack.imgur.com/ZsORs.png

And this is what I want:

https://i.stack.imgur.com/zKkgO.png

How can I modify this using maven?

Thanks

StefanHeimberg
  • 1,455
  • 13
  • 22
  • It's almost always better to include pictures and code within your post so that our users don't have to leave the site to answer your question. – Matt C Apr 01 '16 at 02:09
  • Please make sure your code is in the question as text and not a picture. – Nic Apr 01 '16 at 15:01

1 Answers1

0

With maven, you can change all this configuration in the <build> tag :

 <build>
    <directory>target</directory>
    <outputDirectory>target/classes</outputDirectory>
    <finalName>${artifactId}-${version}</finalName>
    <testOutputDirectory>target/test-classes</testOutputDirectory>
    <sourceDirectory>src/main/java</sourceDirectory>
    <scriptSourceDirectory>src/main/scripts</scriptSourceDirectory>
    <testSourceDirectory>src/test/java</testSourceDirectory>
    <resources>
      <resource>
        <directory>src/main/resources</directory>
      </resource>
    </resources>
    <testResources>
      <testResource>
        <directory>src/test/resources</directory>
      </testResource>
    </testResources>
  </build>

That said, I think it would be better to copy your source files as maven intend it to avoid the hassle, from src/ to src/main/java or src/main/resources depending on the type of file.

Cédric Couralet
  • 4,913
  • 1
  • 21
  • 21