Even if the majority of your team memvers do not have the generator project setup, they can still develop. Beside this, you skip the mostly tricky part of shipping a bunch of additional eclipse plugins to the rest of the team and you can keep the model itself under control of a selected group of persons. Anyway, if you have such a setup, it is no good idea to copy the generated sources to your /main/java folder. It should be obvious to the developers, that there are generated sources in the project. A practical workaround for this is to have different java src folders in your projects. This could be a /main/gen folder for example. In order to tell maven about it, you need to add additional resources to your projects pom-file.
Resource folder are ment for resources and not for java files. Therefore this is quite a bit like a workaround. But it works :)
The following snippet assumes three src folders in your project.
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include> **/*.java </include>
<include> **/*.properties </include>
<include> **/*.xml </include>
</includes>
</resource>
<resource>
<directory>src/main/gen</directory>
<includes>
<include> **/*.java </include>
<include> **/*.properties </include>
<include> **/*.xml </include>
</includes>
</resource>
<resource>
<directory>src/main/test</directory>
<includes>
<include> **/*.java </include>
<include> **/*.properties </include>
<include> **/*.xml </include>
</includes>
</resource>
</resources>
0 Comments:
Post a Comment