Mallikharjuna
Mallikharjuna

Reputation: 119

maven: how to fix dependency issue in intellji

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>**

Upvotes: 1

Views: 1720

Answers (2)

Eugene Roldukhin
Eugene Roldukhin

Reputation: 657

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.

Upvotes: 5

Mark Nenadov
Mark Nenadov

Reputation: 6907

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>

Upvotes: 1

Related Questions