• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

moving files from target to src

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Saloon Keeper
Posts: 27808
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
here is the "simplified" question. How can i generate the code in src directory when using wsdl2code plugin?
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic