Maven adds source directory to Eclipse

I get my code generated from the maven-jaxb2-pluginmaven plugin . It puts the code in the target / generated sources. Now I need to manually left-click on the project -> properties-> Java Build Path-> Add Folder .... This annoys someone downloading it from SVN.

Is there any way to get this dome automatically through my pom?

+3
source share
2 answers

This type of material is the responsibility of the IDE Maven plugin, and, fortunately, M2E has supported it recently (finally!) Through the concept of M2E connectors, i.e. M2E extensions that understand the binding of certain types and the binding to them and the life cycle. And since recently not many Maven plugins have their own connectors for M2E.

However, you're in luck because Jaxb2 plugins are actually already supported. I assume that you are already using M2E. Then go to Settings -> Maven -> Discovery, then open the directory, and then find the Jaxb2 connector.

+4
source

maven add-sources should do the trick for netbeans or eclipse

M2E and generated maven source folders as eclipse source folders

0
source

All Articles