0

I have jdom dependency in one/more of my multimodule project. I dont have repositroy conection as of now. Recently jdom upgraded to jdom2. Hence need to download that jar to compile and ve a successful build. As a first initiative i tried to download the jdom2 jar and saved to my local machine. THen in my dependency element , tried to use scope=system and systemPath="local path to the jar". BUt my pom error on eclipse/as well "mvn clean install" was saying file to tat location doesnt exist. SO tried google search and found three suggested solutions :

http://charlie.cu.cc/2012/06/how-add-external-libraries-maven/

http://randomizedsort.blogspot.com/2011/10/configuring-maven-to-use-local-library.html

http://stackoverflow.com/questions/364114/can-i-add-jars-to-maven-2-build-classpath-without-installing-them

Im confused about those steps. but somehow tried with failure result. Please let me know probable solution for my issue........

------............ "I do not have repository connection"=> ur access to company central repository has been restricted for time being. Hence at present the connection fails and as well downloading the file fails. As mentioned mine is multi-module project say 3 modules are "x-common","x-gui", "x-ejb". All three has dependency for jdom. Earlier it was using jdom version, those jar are in local repo so it was running. NOw its been update to jdom2. Coz of network failure connection , module build fails to download jdom2 afresh. So tried to add scope=system and systmePath=my_local_path in those pom. pom in common module was throwing xml compile error canot find the jar at that specified location. hence looked over for other waysto resolve it. Going by link #2 i created a folder by name 'repo' at the root of 'x-common' project and tried to execute the mvn install command pointing the jar in my local path. It was saying 'pom.xml not found in the jar' hence that ste fails. This is my entire scneario....

Marie
  • 51
  • 1
  • 1
  • 5
  • can you clarify what do you mean by "I do not have repository connection". Maven can always be configured to download jars from Maven central. And also in link #2 you have a way of installing the jar that should work. Also check if the GAV that you are using in your pom and the GAV that you have used while installing match. – Yogesh_D Aug 14 '14 at 06:32
  • "I do not have repository connection"O => ur access to company central repository has been restricted for time being. – Marie Aug 14 '14 at 06:45
  • Described my scneario at the bottom of thread – Marie Aug 14 '14 at 06:58
  • From your description, it seems you do have the local repo (typically under .m2). To Install a third party file to the repo use this, mvn install:install-file -Dfile= -DgroupId= \ -DartifactId= -Dversion= -Dpackaging= details can be found at http://maven.apache.org/guides/mini/guide-3rd-party-jars-local.html. Hope this helps. – Yogesh_D Aug 14 '14 at 07:27
  • Let us know if the above works so that it can be added as an answer – Yogesh_D Aug 14 '14 at 09:08
  • We do have local repo called .m2/repository , but our comp central repo is located at X machine. At the moment our access was broken. SO downloading new dependency at the moment is vain. TO do mvn install , input needed is just the jar file alone ? anything other prerequisite than that need to be set ? Coz when tried the command the mvn console thorwn eror saying "pom.xml not founf in tat jar file"..... – Marie Aug 14 '14 at 11:55
  • The above command, to install a jar file just need the jar file. however you also need to give it the GAV. Would recommend that you keep them the same as what you have in central repo. I believe the error might have been because of no specifying the GAV details in the command. – Yogesh_D Aug 19 '14 at 03:44

0 Answers0