Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maven2: Missing artifact but jars are in place

People also ask

What does missing artifact mean?

xml “missing artifact maven” occurs when the artifact is missing in local repository and remote repository. In eclipse, missing artifact maven error shows in the programs window. Maven is a software tool for building artifacts. The maven exception “Missing artifact” is thrown when a new dependency is added in the pom.

How do I enable maven nature in STS?

To enable Maven nature, right click on the project and in the context menu, select Configure → Convert To Maven Project. M2E Plugin enables the Maven nature and adds pom. xml to the project.

Can we add external jar in maven project?

Approach 2: Include jar as part of the maven project. In this approach you need to first create a folder in your maven project & add your external jar file. Once the jar file is added, include the jar file in your pom using following notation.


There are a few other options apart from Project->Clean, some of which are more along the lines of turning it off and on again.

  • Try right-clicking on the project and selecting Maven->Update Project Configuration.
  • Disable then re-enable dependency management (right-click Maven->Disable Dependency Management then Maven->Enable Dependency Management
  • Close the project and reopen it.
  • Check that your Maven settings are configured correctly. If you are behind a proxy you'll need to configure the proxy settings in the global or user settings.
  • Check you're using the Maven installation you expect. By default m2eclipse uses the embedder, if you have a separate installation you may want to configure m2eclipse to use the external installation so that CLI and Eclipse builds are consistent. This also ensures you're configured to connect through any proxy as above.

I received this same issue on SpringSource Tools ver 2.8.0.RELEASE. I had to do Maven -> Update Maven Dependencies and check the option for "Force Update of Snapshot/Releases".


I encountered similar issue. The missing artifacts (jar files) exists in ~/.m2 directory and somehow eclipse is unable to find it.

For example: Missing artifact org.jdom:jdom:jar:1.1:compile

I looked through this directory ~/.m2/repository/org/jdom/jdom/1.1 and I noticed there is this file _maven.repositories. I opened it using text editor and saw the following entry:

#NOTE: This is an internal implementation file, its format can be changed without prior notice.
#Wed Feb 13 17:12:29 SGT 2013
jdom-1.1.jar>central=
jdom-1.1.pom>central=

I simply removed the "central" word from the file:

#NOTE: This is an internal implementation file, its format can be changed without prior notice.
#Wed Feb 13 17:12:29 SGT 2013
jdom-1.1.jar>=
jdom-1.1.pom>=

and run Maven > Update Project from eclipse and it just worked :) Note that your file may contain other keyword instead of "central".


I had the same problem. Rich Seller's solution didn't work for my situation, I fixed it by cancel the Window -> Preferences -> Maven. Do not automatically update dependencies from remote repositories option, then right-clicking on the project and selecting Maven->Update Project.


I had similar problem. it was showing error "Missing artifact......".After digging in, I found that I have proxy settings enabled which should be configured (proxyname, user/pwd) in setting.xml inside conf folder of Maven. As a resolution go to Eclipse....Windows->preferences->Maven->UserSettings....and update the user setting to point the setting.xml which you have inside conf folder of Maven. After that go to Project->Update All Maven Dependencies. It should work fine after the build.


I was facing the same error with Spring Boot dependencies. What solved for me was letting Maven resolve the dependencies wrapping them with dependency management:

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>1.3.0.RELEASE</version>
</parent>

<dependencyManagement>
    <dependencies>
      <dependency>...</dependency>
      ...
    </dependencies>
</dependencyManagement>