• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

maven library path for eclipse and environment variables

 
Padmanabh Sahasrabudhe
Ranch Hand
Posts: 53
  • 0
  • Mark post as helpful
  • send pies
  • 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?

Thanks.
 
Tim Holloway
Saloon Keeper
Pie
Posts: 17616
39
Android Eclipse IDE Linux
  • 0
  • Mark post as helpful
  • send pies
  • 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.
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • 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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic