Maven - missing artifact

前端 未结 4 2088
自闭症患者
自闭症患者 2020-12-18 06:36

I\'ve just moved my project from windows to linux ubuntu. After pulling files from repository it turned out that every pom.xml file consists errors. Not even one dependency

相关标签:
4条回答
  • 2020-12-18 06:46

    Ok, so you've just moved from one OS to another...

    There is a big chance, that Maven settings are different, and you just forgot to move some repositories configurations, etc. to the new place.

    Please check global Maven settings.xml or user-specific: ~/.m2/settings.xml on Linux and C:\User\[username]\.m2\settings.xml on Windows.

    Chances are you'll find something interesting.

    After fixing settings (if it's the cause), I would suggest to run Maven dependency plugin goal 'purge-loca-repository' for removing your project's dependencies from your local Maven repository and re-resolving them from scratch:

    mvn dependency:purge-local-repository
    

    Regarding aopalliance-1.0 artifact -> I haven't found it in java.net2/sonatype repositories, so please try Maven Central to resolve it:

    <repository>
      <id>central</id>
      <name>Maven Central</name>
      <url>http://repo1.maven.org/maven2</url>
    </repository>
    

    Good Luck!

    0 讨论(0)
  • 2020-12-18 06:48

    If you use Cntlm as autetification proxy, check if it is alive in your Windows Tasks Manager:

    cntlm.exe

    If not, try executing on a cmd window:

    call \path_to_your_cntlm_folder\Cntlm\cntlm.exe -c \path_to_your_cntlm_folder\Cntlm\cntlm.ini
    
    0 讨论(0)
  • 2020-12-18 06:51

    There are few common causes related to maven migration

    • Your project consists of many internal dependencies (artifact created by yourself / colleagues) stored on your PC maven repository cache, as opposed in a shared internal repository. When you migrated into new PC it's no longer able to resolve these
    • Your company has an internal maven repository (eg: nexus) and your project pom.xml isn't configured to search for this repository
    • Your project is a multi module which aren't setup very neatly such that the topmost artifact in the dependecy map has to be installed first on your local repo before others can pull it
    • Your new pc repository use different maven version / jdk version combinations

    Your pc local repo is normally located at ~/.m2/repository

    0 讨论(0)
  • 2020-12-18 06:56

    i added this and it resolved my problem.

    <!-- https://mvnrepository.com/artifact/com.sun.jersey/jersey-server -->
    <dependency>
        <groupId>com.sun.jersey</groupId>
        <artifactId>jersey-server</artifactId>
        <version>1.8</version>
    </dependency>
    
    0 讨论(0)
提交回复
热议问题