skip to Main Content

The following is the maven dependencies i want to access in my project pom.xml but it’s unable to recognize that one, it’s showing org.apache.commons.math4: 4.0 snapshot not found.

please, help me how can i fix it?

    **<dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-math4</artifactId>
        <version>4.0-SNAPSHOT</version>
    </dependency>**

2

Answers


  1. According to maven repository (https://mvnrepository.com/artifact/org.apache.commons/), there is no math4.

    What you need to use is math3:

    <!-- https://mvnrepository.com/artifact/org.apache.commons/commons-math3 -->
    <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-math3</artifactId>
        <version>3.6.1</version>
    </dependency>
    
    Login or Signup to reply.
  2. You’ll just need to add the repository config:

    <dependencies>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-math4</artifactId>
            <version>4.0-SNAPSHOT</version>
        </dependency>
    </dependencies>
    
    <repositories>
        <repository>
            <id>apache</id>
            <name>apache_snapshots</name>
            <url>http://repository.apache.org/snapshots</url>
        </repository>
    </repositories>
    

    And after that you need to run maven command:

    mvn -U clean install
    

    Flag -U Forces a check for updated releases and snapshots on remote repositories

    Because you want to use the SNAPSHOT version. Snapshot version can change every day.

    It should help you, I’ve checked just now.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search