• 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

Need help in Starting with Maven

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I have to use Maven as a build tool for my existing project. I need help in understanding that, i have limitation that i cannot modify the structure of project to what maven provides.

What all i have read till now it says that i have to move my source files to Maven structure and then can write my POM file. Is this a limitation of Maven or i can write my POM file with existing structure?

Will appreciate any help!!

Thanks,
Kulpreet
 
Ranch Hand
Posts: 859
IBM DB2 Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So you cannot modify the structure?

Although maven (some goals at least) requires a set structure?

Sounds like a conundrum to me.

It would help if we knew a little more about your project.

WP
 
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Resist the urge to bend Maven to your will. Even though you can redefine where things are located, not all plugins will recognize the new locations. Besides, one of the perks of Maven is that every project looks the same and is built the same way. Well, at least until you get into very complex projects that invoke a lot of specialty plugins, but even then you can define project types and every project of that type can look the same. My recommendation is to reformat the project, possibly breaking it up into multiple projects, to fit the Maven best practices. I spent the last half of last year doing this for a dozen projects, which turned into about 20 projects by the time I got done. But everyone is happier with the results than what we they before (it was pretty much managed chaos).

If you are still set on breaking Maven, you will have to pay close attention to the properties available for every plugin goal. You will also have to know the pom.xml structure inside and out. Between the pom.xml settings and the plugin properties, you should be able to relocate almost anything. I highly recommend that you do not attempt this until you are very familiar with how Maven works and have spent some time building things the maven way. If you are new to Maven, don't even think about trying it.
 
Saloon Keeper
Posts: 27762
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
Welcome to the JavaRanch, Kulpreet!

Probably Maven's 2 biggest strengths are that it automatically downloads dependencies and that it standardizes project structure, and you have apparently been commanded to discard one of those primary strengths.

As Peter has pointed out, attempting to force a non-Maven structure on Maven is tedious, difficult and error-prone. In business terms, it's expensive. Expensive to set up, expensive to maintain, and the project itself is more expensive to use, since unlike "real" Maven projects, you won't be able to just hand it to anyone anywhere and expect them to be able to instantly know where all the pieces are.

Although I'm not the biggest fan in the world of how Maven lays things out, it does work and it works well. And even if someday Maven goes away, the project organization still works.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic