The POM for project is missing, no dependency information available

后端 未结 2 1132
無奈伤痛
無奈伤痛 2021-01-31 14:23

Background

Trying to add a Java library to the local Maven repository using a clean install of Apache Maven 3.1.0, with Java 1.7. Here is how the Java archive file was

相关标签:
2条回答
  • 2021-01-31 14:47

    Change:

    <!-- ANT4X -->
    <dependency>
      <groupId>net.sourceforge</groupId>
      <artifactId>ant4x</artifactId>
      <version>${net.sourceforge.ant4x-version}</version>
      <scope>provided</scope>
    </dependency>
    

    To:

    <!-- ANT4X -->
    <dependency>
      <groupId>net.sourceforge.ant4x</groupId>
      <artifactId>ant4x</artifactId>
      <version>${net.sourceforge.ant4x-version}</version>
      <scope>provided</scope>
    </dependency>
    

    The groupId of net.sourceforge was incorrect. The correct value is net.sourceforge.ant4x.

    0 讨论(0)
  • 2021-01-31 14:57

    The scope <scope>provided</scope> gives you an opportunity to tell that the jar would be available at runtime, so do not bundle it. It does not mean that you do not need it at compile time, hence maven would try to download that.

    Now I think, the below maven artifact do not exist at all. I tries searching google, but not able to find. Hence you are getting this issue.

    Change groupId to <groupId>net.sourceforge.ant4x</groupId> to get the latest jar.

    <dependency>
      <groupId>net.sourceforge.ant4x</groupId>
      <artifactId>ant4x</artifactId>
      <version>${net.sourceforge.ant4x-version}</version>
      <scope>provided</scope>
    </dependency>
    

    Another solution for this problem is:

    1. Run your own maven repo.
    2. download the jar
    3. Install the jar into the repository.
    4. Add a code in your pom.xml something like:

    Where http://localhost/repo is your local repo URL:

    <repositories>
        <repository>
            <id>wmc-central</id>
            <url>http://localhost/repo</url>
        </repository>
        <-- Other repository config ... -->
    </repositories>
    
    0 讨论(0)
提交回复
热议问题