0

I'm using Eclipse Luna and having trouble with a imported third party Maven project. In Maven Dependencies the project has several jars, but the project is insisting they are to be found in C:\Users\username.m2\repository when they're not.

How do I tell it they are not there but in E:\java\jars?

I tried changing Native Library Locations but that didn't work, and there is nothing in the pom file that says which folder location to use. All attempts to get the classpath to work have failed (probably due to my newness to this environment).

Vogel612
  • 5,620
  • 5
  • 48
  • 73
Sean
  • 271
  • 1
  • 8
  • 20
  • Why aren't the libraries in your repo? That's where maven dependencies *should* be. – Dave Newton Dec 19 '14 at 12:47
  • 1
    Are you looking for this? http://stackoverflow.com/questions/10235374/how-to-change-maven-local-repository-in-eclipse – Pramod Karandikar Dec 19 '14 at 12:51
  • The Maven way is to have a local repository at ~/.m2/repository. Why do you want to change it? You could configure Maven to have another location for that local repository, but that affects all Maven builds on your machine. – Seelenvirtuose Dec 19 '14 at 12:51
  • @DaveNewton that's bs... one does not version dependencies when using maven. That'd defeat about two thirds of the reasons for using maven in the first place. – Vogel612 Dec 19 '14 at 12:51
  • @Vogel612 Maven dependencies go in the repo. Dependency *resolution* is Maven's job, the dependencies themselves live in the repo. – Dave Newton Dec 19 '14 at 13:06
  • @DaveNewton whoops. wrong "repo". Sorry, I was at VCS-repo there :( – Vogel612 Dec 19 '14 at 13:07

1 Answers1

1

You can include your resource in your pom.xml as follows:

<project>
 <build>
   <resources>
     <resource>
       <directory>[your folder here]</directory>
     </resource>
   </resources>
 </build>
</project>

Alternatively, you can add your 3rd Party JARs as a repository, like so:

<repositories>
   <repository>
       <id>lib_id</id>
       <url>file://your_path_to_lib/lib</url>
   </repository>
</repositories>

Resources:

Community
  • 1
  • 1
Buhake Sindi
  • 87,898
  • 29
  • 167
  • 228
  • Many thanks to all, and I've learnt something here. That Maven uses a centralized repoitory for all Jars no matter where they come from. It's something I didn't understand, I did say I was new to the environment. Anyway I've marked this answer as it addresses my question and works nicely. best regards for the fextive season. – Sean Dec 20 '14 at 03:25