Ah. I see where you went wrong. It's not even that complicated. Use the following command to add your jar files to your local repository:

mvn install:install-file -Dfile=<path-to-file> -DgroupId=<group-id> -DartifactId=<artifact-id> -Dversion=<version> -Dpackaging=<packaging>

Example: mvn install:install-file -Dfile=myjar.jar -DgroupId=myjar -DartifactId=myjar -Dversion=1.0 -Dpackaging=jar

Then, in your pom.xml you would refer to this new artifact/dependency like this: (using the same example)

<dependency>
   <groupId>myjar</groupId>
   <artifactId>myjar</artifactId>
   <version>1.0</version>
</dependency>

Then, your build will pick up the jar you want it to use.
Good luck!
Dave



Petr V. wrote:
Thanks Dave for such a quick response.

I started from jar files w/o pom files. So I went to maven repository web site 
http://www.mvnrepository.com/ and search for those jars. Some of those jars 
were available under different groups ids but same artifact id like 
saax-api-1.3.jar is found under javax.xml as javax.xml.soap as well. I picked 
the most appropriate one using educated guesses. May be that is causing some 
trouble. How can I find out the correct version of group ids and artifacts ids 
:-(

Thanks,

Petr


--- On Wed, 10/29/08, David C. Hicks <[EMAIL PROTECTED]> wrote:

From: David C. Hicks <[EMAIL PROTECTED]>
Subject: Re: How to convert Eclipse project to maven project
To: "Maven Users List" <[email protected]>
Date: Wednesday, October 29, 2008, 7:01 AM
Unless you specified the proper versions and classifiers for
your dependencies, then Maven is likely to find the ones that are available in the primary repository. Assuming that you used Maven to install your jar files into your local repository, make sure that your pom.xml specifies the same groupId, artifactId, and version that you used when you did that installation. Otherwise, Maven won't find them and will go looking for anything else that matches your pom.xml.

I hope that's helpful.
Dave


Petr V. wrote:
I have simple web services demo which I created in
Eclipse and added external jar files to project. I am able
to run it successfully unit tests in eclipse IDE.
Now I have moved the code to maven project and added
dependencies tho those jar files in my pom file. And now the
maven project fails complaining
"java.lang.NoClassDefFoundError:
com/sun/xml/fastinfoset/stax/StAXDocumentParser".
I installed all jars files manually in my totally new
maven repo but maven first downloads pom files for those
manually installed jars and then download other jar files
which are defined as dependencies in those new downloaded
pom files. I do not want any of those newly downloaded jar
files. I know my manually installed jar files are good
enough to run the project (as shown in eclipse) but maven is
doing some thing stupid amd making my project fail at run
time complaining of missing class files.
How could I resolve this issue in most cleanest way.I
hope that I am able to explain problem clearly.
Any help would be really appreciated.

Thanks,

Petr




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail:
[EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to