• 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 ...
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

maven library path for eclipse and environment variables

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

I have two questions:

1] When I point the maven project in eclipse to the settings.xml I get a new Maven llibrary in the Java Build Path. I am not sure from where does the eclipse pick up these jars.

2] Maven at present is not recognising the environment variables I use in settings.xml and pom.xml. Right now, I have substituted them with hard coded absolute path. But is there a way to make maven understand the environmnet variables during designtime?

Saloon Keeper
Posts: 25646
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
Eclipse does not understand Maven or Maven libraries. The m2eclipse plugin is what adds that capability - providing you have it installed. Getting a specific eclipse project to display the referenced dependencies has always been a sort of hit-or-miss process involving a lot of thumping and swearing. Some Eclipse versions add a project menu option to allow configuring an existing Java project as a Maven project.

If you are passing OS environment variables to Maven builds (something I don't generally recommend), you can set them using the Run/Debug menu, since Maven execution within Eclipse is treated the same way running any other Java application would be.

If you are setting options in the .m2 configuration file, the copy of Maven running in Eclipse should pick up on them. However, Maven doesn't like relative paths, whether with eclipse or without it, so any paths being set should be absolute.
Posts: 5856
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
1) It would help if you told us exactly what new library you mean. It could also depend on the contents of your settings.xml and the pom.xml for your project. Basically, the m2eclipse plugin will update the Java Build Path based on the dependencies found in the pom.xml file.

2) Do you mean from within Eclipse or from the command line? Also, how are you referencing the environment variables within your settings.xml and pom.xml? Trying to help you by guessing what you are doing is kind of difficult. It would help if you posted an example.
You ought to ventilate your mind and let the cobwebs out of it. Use this cup to catch the tiny ads:
Free, earth friendly heat - from the CodeRanch trailboss
    Bookmark Topic Watch Topic
  • New Topic