Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to fix error with install maven jar plugin dependency?

Tags:

java

maven

I am making an application into a jar file in maven. However, when I pull the jar plugin repository from maven and run these three command in Terminal:

mvn clean
mvn compile
mvn package

At mvn package, I get this error. Error:

    Failed to execute goal org.apache.maven.plugins:maven-jar-plugin:3.1.0:jar (default-jar) on project A2ATest2: Execution default-jar of goal org.apache.maven.plugins:maven-jar-plugin:3.1.0:jar failed: Plugin org.apache.maven.plugins:maven-jar-plugin:3.1.0 or one of its dependencies could not be resolved: Failed to collect dependencies at org.apache.maven.plugins:maven-jar-plugin:jar:3.1.0 -> org.apache.maven:maven-archiver:jar:3.2.0: Failed to read artifact descriptor for org.apache.maven:maven-
archiver:jar:3.2.0: Could not transfer artifact org.apache.maven:maven-archiver:pom:3.2.0 from/to central (https://repo.maven.apache.org/maven2): No such host is known (
repo.maven.apache.org) -> [Help 1]

However, when I use the 2.4 version instead of the 3.1.0 version it works just fine. I'm not sure if its a bug, or if I did something wrong. Thanks again for your help

like image 588
tharriott Avatar asked Oct 15 '25 14:10

tharriott


1 Answers

Maven is not being able to connect to repo.maven.apache.org "No such host is known"

Check your repository tag in settings.xml and also check your network connection and do a mvn clean install. Hope this helps

like image 121
Malkeith Singh Avatar answered Oct 17 '25 03:10

Malkeith Singh