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

Migrating To Maven

 
Arun Kumar
Ranch Hand
Posts: 133
Chrome Eclipse IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I was given an assignment to Migrate a project to Maven given the condition that there should be no source code modifications.First it seemed easy as I thought the only challenge was to use a custom folder structure rather than the predefined structure of maven

But soon I have hit a road block the project contains many XML files which are placed along with the java code within the java package and are loaded using getResourceAsStream("path to package")

When I run mvn:compile, maven ignores these xmls and as a result the deployment fails I cant move them to resources directory as there will be a lot of code changes

Is there a way to specify to take xml and java files from the same package in Maven
 
Joachim Rohde
Ranch Hand
Posts: 433
Netbeans IDE
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have a look at the resources plugin. It should look something like that then:


Look also here.
 
Tim Holloway
Saloon Keeper
Pie
Posts: 17633
39
Android Eclipse IDE Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
People who try to overrule Maven's built-in directory assumptions tend to have very unhappy lives.

I don't say I really love some of the things they do myself, but one of Maven's main selling point is the fact that you know where to look for stuff because Maven rams it down everyone's throat impartially.

On the other hand, there must be something really odd about your project if the mere act of relocating your source and resource directories requires Java code changes.
 
Jaikiran Pai
Marshal
Pie
Posts: 10444
227
IntelliJ IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I agree with Tim - When using Maven, you'll make your life a lot easier if you follow the Maven source code structure. Although, Maven does allow configuring a different structure for your project, it can really turn out to be messy in the long run, especially with all those plugin configurations. That would then defeat the purpose of switching to Maven.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic