aspose file tools*
The moose likes Ant, Maven and Other Build Tools and the fly likes Include new sources and exclude existing Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Include new sources and exclude existing" Watch "Include new sources and exclude existing" New topic
Author

Include new sources and exclude existing

Bono Vox
Greenhorn

Joined: May 24, 2012
Posts: 6
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

Joined: May 26, 2003
Posts: 31057
    
232

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.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 31057
    
232

While we are fine with cross posting, we do ask you to disclose that you have done so. This is cross posted at StackOverflow
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Include new sources and exclude existing