Changing Maven structure (src / java for src / Javasource)

I would like to change the name src / java to src / Javasource due to some CVS problems Is this possible?

+7
source share
4 answers

Here is an example POM assembly that you can use to configure directories.

<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> 
+9
source

You can set sourceDirectory in the build tag of your POM

  <build> <sourceDirectory>src/Javasource</sourceDirectory> ... </build> 

Take a look at Maven - Introduction to POM .

+4
source

Yes, you can do it; see other answers.

However, popular wisdom is that it is a bad idea to use non-standard organizations for the Maven project, because (this is how the story happens), it tends to break Maven plugins (and other tools) that accept the standard organization. (At the very least, the tools are likely to be less thoroughly tested for non-standard organizations.)

Another problem is that people expect a standard project organization. Indeed, the “strong support” of a standard design organization is (IMO) one of Maven’s major retail outlets.


Can I make a radical proposal?

Instead of using a custom layout for your project due to CVS limitations, transfer the source code to a newer version control system, in which version history is stored in file and directory names.

This Wikipedia page is a good place to look for alternatives.

+4
source

Yes, it is possible, but then you must define sourceDirectory in pom.xml

+1
source

All Articles