• 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

I have a few questions about Maven

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I work for a company in image processing, and one of our customers wants us to update the image viewer that goes with the product he sells. Fair enough, only he had outsourced this work earlier, and the company that did the work, has sent all its code to me. I am a newbie to Swing, and I am still learning. The project code is in the form of folders with a "pom.xml" at every level. I understand from Maven that this means that each level of the project is connected to the parent at the upper level, and is built as part of that. Now I need to break it down completely, modify and expand the code, and then build it up again. One (slow and mechanical) way is to copy each .java file into Netbeans (I use that) and then add all the dependencies, compile level by level and get it done.
Does anyone have any better ideas? Much appreciated. Thank you very much!

harry.
 
best scout
Posts: 1294
Scala IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Harry,

what you describe seems to be nothing more than a typical Maven project. Of course the directory layout may be different compared to Eclipse or NetBeans standard projects.

But I don't understand why in the world you want to break this Maven project to build it up again after you have modified the code In particular NetBeans has excellent default support for Maven without having to install any additional plugins. You can just open the existing (Maven) project in NetBeans just like any "regular" NetBeans project. One advantage is that you don't have to care for project dependencies if your Maven POM was configured correctly.

In my opinion there are many more advantages with Maven but at least it doesn't make sense to destroy a working project just to edit the code in another project layout and copy it back again. Why do you want to break the existing project? Did you have trouble running it with Maven?

Marco
 
harish kshatrea
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I actually received this code from the customer, and there are a lot of dependencies in the "pom.xml" file that don't exist on my machine or network. The previous outsourcee used a repository and an ftp server and a few other such constructs which I necessarily have to replicate, and I don't understand Maven well enough to modify the pom.xml file so that I can build the existing code (with my modifications, of course) using Maven. That is why I was going the long way around. I understand that I am making a few errors in judgment, but could you enlighten me as to how I could work with a pre-existing pom file and a new environment so that I can still let Maven build and run the project? Thank you so much!

Sincerely,
Harry.
 
Ranch Hand
Posts: 214
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hm my understanding of Maven is that it downloads the dependencies automatically (it creates a local repository) if you try to compile the project. Of course only if the .pom file is set up properly in the first place and knows where to get the files. Have you actually tried "mvn compile" on the command line?
 
Marco Ehrentreich
best scout
Posts: 1294
Scala IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Absolutely! Maven uses a concept with artifact repositories from which it can automatically download artifacts (i.e. JARs etc.). Which repositories it "knows" depends on you global Maven settings and maybe settings within the project POM.

If some artifacts are not available in any public repository you can still set up a private repository manager like Nexus where you can upload the missing dependency JARs which are in turn automatically downloaded by Maven. This has the big advantage that you have to manage project dependencies only once and every developer with any machine can automatically access this centralized dependency storage.

Give it a try and feel free to ask, if it doesn't work the Maven way

Marco
 
Marshal
Posts: 79178
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Too difficult a question for "beginning Java". Moving thread.
 
harish kshatrea
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you, both of you.
I followed what you suggested, the local repository idea did it. I integrated Maven into my Netbeans IDE successfully, and was able to create new pom.xml files that seem to work with my environment.
Thank you so much!

Cheers,
Harry.
 
Marco Ehrentreich
best scout
Posts: 1294
Scala IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You're welcome Glad that it was helpful!

Marco
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic