File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

moving files from target to src

 
Nishnt Rayn
Greenhorn
Posts: 14
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I use axis2-wsdl2code plugin for generating java source files from wsdl and finding it painful to copy files from target /generated-classes to src package since this has to be done to compile the new src files. I know maven operates is convention-based. However let me know if there is any config i can make in the pom to do this while generation or after that.
thanks in advance
 
Tim Holloway
Saloon Keeper
Pie
Posts: 17627
39
Android Eclipse IDE Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In Maven - and you didn't actually say Maven, but I deduce it because you're referring to a POM. Anyway, in Maven, the convention for source generators is that the generated source code will be generated into target/source-generated and Maven will compile it from there. Generated source is not considered a "permanent" part of the project, so you shouldn't copy it to the user-maintained source tree (src/main/java). Leave it where it is and it will be fine. You can add the target/generated-sources directory to your version control system if you're like me and prefer to keep an archival copy in case the generator breaks someday.

Regardless of what build system you use, I recommend always keeping generated sources in a directory tree of their own. Sooner or later, I always seem to need to wipe out generated sources and recreate them from their inputs. It's a lot easier when you can do this with a brute-force directory tree delete instead of having to sift through non-generated sources and take care not to delete the wrong files.
 
Nishnt Rayn
Greenhorn
Posts: 14
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Tim, thanks for posting your reply. I know keeping src in target alleviates the pain but my fingers always itch to execute "mvn clean compile install" which apparently will delete the generated source code. Now i will be stuck with wsdl2code plugin for ever Another alternative i am looking for is generating the code in src directory direct. May be we can have it in separate package/folder structure . What is your take on this?
 
Nishnt Rayn
Greenhorn
Posts: 14
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
here is the "simplified" question. How can i generate the code in src directory when using wsdl2code plugin?
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic