erickrf
erickrf

Reputation: 2104

Eclipse maven missing artifact that exists locally

I'm somewhat new to using maven dependencies, and I'm having some trouble making Eclipse with maven find needed artifacts.

I followed a tutorial online and got a perfectly working project with some maven dependencies. Now I started a new one, with some of the same dependencies of the tutorial project, but Eclipse says it can't find them. The actual messages are in the form "Missing artifact JAR NAME:VERSION".

To make it worse, the repository I downloaded the jars from seems to be offline currently. But anyway, I don't think it's reasonable to download files I already have.

I checked that all the needed jars are under my HOME/.m2/repository/ folder. I tried running Maven / Update Project with the offline option, and it didn't help.

I also tried to find if any files in the working project had any path pointing to my local repository folder, and I couldn't find anything. The .classpath file is essentially the same in both projects.

EDIT:

Here's the output of mvn compile on the project:

[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Test 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
Downloading: https://repo.maven.apache.org/maven2/eu/excitementproject/core/1.2.0/core-1.2.0.pom
[WARNING] The POM for eu.excitementproject:core:jar:1.2.0 is missing, no dependency information available
Downloading: https://repo.maven.apache.org/maven2/eu/excitementproject/common/1.2.0/common-1.2.0.pom
[WARNING] The POM for eu.excitementproject:common:jar:1.2.0 is missing, no dependency information available
Downloading: https://repo.maven.apache.org/maven2/eu/excitementproject/util/1.2.0/util-1.2.0.pom
[WARNING] The POM for eu.excitementproject:util:jar:1.2.0 is missing, no dependency information available
Downloading: https://repo.maven.apache.org/maven2/eu/excitementproject/core/1.2.0/core-1.2.0.jar
Downloading: https://repo.maven.apache.org/maven2/eu/excitementproject/util/1.2.0/util-1.2.0.jar
Downloading: https://repo.maven.apache.org/maven2/eu/excitementproject/common/1.2.0/common-1.2.0.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.785 s
[INFO] Finished at: 2015-07-28T23:43:38-03:00
[INFO] Final Memory: 8M/123M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project mvntest: Could not resolve dependencies for project mvntest:mvntest:jar:0.0.1-SNAPSHOT: The following artifacts could not be resolved: eu.excitementproject:core:jar:1.2.0, eu.excitementproject:common:jar:1.2.0, eu.excitementproject:util:jar:1.2.0: Could not find artifact eu.excitementproject:core:jar:1.2.0 in central (https://repo.maven.apache.org/maven2) -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException

I don't know what the POM for the needed artifacts is supposed to be. Running mvn compile on the other project I had returned no errors, even having some dependencies in common.

In my local repository...

Under ~/.m2/repository, I do have the required jars. For example, the folder ~\.m2\repository\eu\excitementproject\core\1.2.0 contains the jar for eu.excitementproject:core:jar:1.2.0, and inside the archive there is a pom.xml under META-INF\maven\eu.excitementproject\core

Upvotes: 1

Views: 5562

Answers (2)

Min
Min

Reputation: 352

Your maven repository is required to contain the POM for the artifact as well. This supports maven to know the dependencies of that artifact. So, try to create or generate the POM in the artifact repository.

Upvotes: 0

Viraj
Viraj

Reputation: 1420

Dependency you mentioned seems not in your local repository or remote repository.

I think, you have to manually added them in you local repository first and then do mvn update on your project.

To install private jar in local repository use following command like this

mvn install:install-file -Dfile=<PathToJAR>\ojdbc6.jar -DgroupId=com.oracle -DartifactId=ojdbc6 -Dversion=11.2.0 -Dpackaging=jar

Hope this solves your problem.

Upvotes: 1

Related Questions