Feature for maven-build-helper

31 views
Skip to first unread message

Lonzak

unread,
Mar 2, 2018, 10:24:47 AM3/2/18
to mojohaus-dev
We use the maven-build-helper plugin to add generated source- and test folders to the eclipse build path.

E.g.
<plugin>
               
<groupId>org.codehaus.mojo</groupId>
               
<artifactId>build-helper-maven-plugin</artifactId>
               
<executions>
                   
<execution>
                       
<id>add-source</id>
                       
<phase>generate-sources</phase>
                       
<goals>
                           
<goal>add-source</goal>
                       
</goals>
                       
<configuration>
                           
<sources>
                               
<source>${project.build.directory}/generated-sources/annotations</source>
                           
</sources>
                       
</configuration>
                   
</execution>
               
</executions>
</plugin>

This is working perfectly except for one thing:
In eclipse there is the possibity to set the warnings/errors for those generated source folders to ignore. The option is called "Ignore optional compile problems".
We have quite a huge maven multimodule projects and each developer has to go through each generated folder (~50) and set it to ignore. This is quite cumbersome since from time to time this has to be done again (e.g. for a new Branch which requireres a new workspace)

So now I had the idea if the maven-build-helper plugin could be extended with an attribut / tag where this kind of information would be "transfered" - eclipse could be adapted to set this option.
It could possibly look like this but its just an example - the naming and location of this attribute can be different since it proably be has to be generalized....

<plugin>
               
<groupId>org.codehaus.mojo</groupId>
               
<artifactId>build-helper-maven-plugin</artifactId>
               
<executions>
                   
<execution>
                       
<id>add-source</id>
                       
<phase>generate-sources</phase>
                       
<goals>
                           
<goal>add-source</goal>
                       
</goals>
                       
<configuration>
                           
<sources>
                               
<source>${project.build.directory}/generated-sources/annotations</source>
                           
</sources>
                           
<ignoreFolderProblems>true</ignoreFolderProblems>
                       
</configuration>
                   
</execution>
               
</executions>
</plugin>

Now I am interessted in your opinions - could someting like that be feasible?

Lonzak

unread,
Mar 15, 2018, 8:41:33 AM3/15/18
to mojohaus-dev
Due to the lack of answers  - is this the right place to ask such a question? Or is there some other forum?
Thanks!

Dirk Olmes

unread,
Mar 15, 2018, 1:12:23 PM3/15/18
to mojoha...@googlegroups.com
On 03/15/2018 01:41 PM, Lonzak wrote:
> Due to the lack of answers - is this the right place to ask such a
> question? Or is there some other forum?

My 0.01 on this: modifying Eclipse project files from a generic Maven
plugin does not seem like the right thing to do.

Ignoring optional compile errors ends up in the .classpath file of the
respective project:

<classpathentry kind=3D"src" output=3D"target/classes"
path=3D"target/generated-sources/xjc">
<attributes>
<attribute name=3D"ignore_optional_problems" value=3D"true"/>
<attribute name=3D"optional" value=3D"true"/>
<attribute name=3D"maven.pomderived" value=3D"true"/>
</attributes>
</classpathentry>

I only have a hand full of projects where I use this setting so manual
setup is OK. Your case smells more like a separate tool that modifies
the XML inside the .classpath files ...

-dirk
Reply all
Reply to author
Forward
0 new messages