Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Include new sources and exclude existing

 
Bono Vox
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hallo,

I want to copy java sources from projekt let's say from packet com.my.app (in src/main/java...) to the same target but in

{project}/target/generated-sources. When copying I modify on fly the source code by my maven plugin.

And my question:

how can I set in mvn pom.xml that maven takes the sources in target/generated-sources and do not take the classes in

src/main/java/com/my/app.....

The generated classes in have the same package and the same name as classes in normal source: src/main/java

Is it possible?

I need it 'cos I want to replace for build source code.

I must insert some source code in place of my own annotation (modify java source code) and modified file copy to /target/generated-

sources. Than during build I want to use generated source.

Problem is that generated classes of course have the same package and class names like the classes in src/main/java/com/my/app... and I

have conflict in compilation.

Please help how to do it!
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34422
347
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which Maven goal is reading from src instead of target/generated-classes? target/generated-classes is a standard convention so I'd expect Maven goals to use it.

As a troubleshooting step, you might want to create a stripped down pom that illustrates the proble and post it here.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34422
347
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
While we are fine with cross posting, we do ask you to disclose that you have done so. This is cross posted at StackOverflow
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic