Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maven fails to transfer one of many artifacts on same repo

I'm trying to create an archetype from an existing project using mvn archetype:create-from-project but I'm getting

Could not transfer artifact org.apache.maven.archetype:archetype-packaging:pom:3.0.0 
from/to central (https://repo.maven.apache.org/maven2):
sun.security.validator.ValidatorException: PKIX path building failed:
sun.security.provider.certpath.SunCertPathBuilderException: 
unable to find valid certification path to requested target

I am behind a firewall so I followed this post https://stackoverflow.com/a/25912982/358794 and then executed:

$ mvn archetype:create-from-project -Djavax.net.ssl.keyStore=trustCARoot.jks
 -Djavax.net.ssl.keyStorePassword=password  
 -Djavax.net.ssl.keyStoreType=JKS
 -Djavax.net.ssl.trustStore=trustCARoot.jks  
 -Djavax.net.ssl.trustStorePassword=password  
 -Djavax.net.ssl.trustStoreType=JKS

I still get the same PKIX path build failure but just for archetype-packaging

[INFO] Setting default groupId: com.domain.rozycki
[INFO] Setting default artifactId: SkillsApp
[INFO] Setting default version: 0.0.1-SNAPSHOT
[INFO] Setting default package: com.domain.skillsapp
[INFO] Scanning for projects...
[INFO] Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/archetype/archetype-packaging/3.0.0/archetype-packaging-3.0.0.pom
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[ERROR] Unresolveable build extension: Plugin org.apache.maven.archetype:archetype-packaging:3.0.0 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.m
aven.archetype:archetype-packaging:jar:3.0.0 @
[ERROR] Unknown packaging: maven-archetype @ line 8, column 14
 @
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR]   The project com.gdeb.rozycki:SkillsApp-archetype:0.0.1-SNAPSHOT (C:\Users\jrozycki\Development\Archetype\SkillsApp\target\generated-sources\archetype\pom.xml) has 2 errors
[ERROR]     Unresolveable build extension: Plugin org.apache.maven.archetype:archetype-packaging:3.0.0 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apac
he.maven.archetype:archetype-packaging:jar:3.0.0: Could not transfer artifact org.apache.maven.archetype:archetype-packaging:pom:3.0.0 from/to central (https://repo.maven.apache.org/maven2): sun.secur
ity.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target -> [Help 2]
[ERROR]     Unknown packaging: maven-archetype @ line 8, column 14
[ERROR]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------

enter image description here

If I clear a dependency as a test of setting up my trustStore, mv archetype-catalog archetype-catalog_backup and rerun it does connect to the repo and redownloads archetype-catalog but still gets hung up on archetype-packaging

Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/archetype/archetype-catalog/3.0.0/archetype-catalog-3.0.0.pom
Downloaded: https://repo.maven.apache.org/maven2/org/apache/maven/archetype/archetype-catalog/3.0.0/archetype-catalog-3.0.0.pom (2 KB at 2.5 KB/sec)
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/archetype/archetype-catalog/3.0.0/archetype-catalog-3.0.0.jar
Downloaded: https://repo.maven.apache.org/maven2/org/apache/maven/archetype/archetype-catalog/3.0.0/archetype-catalog-3.0.0.jar (19 KB at 70.1 KB/sec)
[INFO] Setting default groupId: com.domain.rozycki
[INFO] Setting default artifactId: SkillsApp
[INFO] Setting default version: 0.0.1-SNAPSHOT
[INFO] Setting default package: com.domain.skillsapp
[INFO] Scanning for projects...
[INFO] Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/archetype/archetype-packaging/3.0.0/archetype-packaging-3.0.0.pom
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[ERROR] Unresolveable build extension: Plugin org.apache.maven.archetype:archetype-packaging:3.0.0 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.m
aven.archetype:archetype-packaging:jar:3.0.0 @
[ERROR] Unknown packaging: maven-archetype @ line 8, column 14
 @
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR]   The project com.gdeb.rozycki:SkillsApp-archetype:0.0.1-SNAPSHOT (C:\Users\jrozycki\Development\Archetype\SkillsApp\target\generated-sources\archetype\pom.xml) has 2 errors
[ERROR]     Unresolveable build extension: Plugin org.apache.maven.archetype:archetype-packaging:3.0.0 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apac
he.maven.archetype:archetype-packaging:jar:3.0.0: Could not transfer artifact org.apache.maven.archetype:archetype-packaging:pom:3.0.0 from/to central (https://repo.maven.apache.org/maven2): sun.secur
ity.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target -> [Help 2]
[ERROR]     Unknown packaging: maven-archetype @ line 8, column 14
[ERROR]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------

Trying to download just archetype-packaging yields the same error

mvn org.apache.maven.plugins:maven-dependency-plugin:2.1:get \
    -DrepoUrl=https://repo.maven.apache.org/maven2 \
    -Dartifact=org.apache.maven.archetype:archetype-packaging:3.0.0
    -Djavax.net.ssl.keyStore=trustCARoot.jks -Djavax.net.ssl.keyStorePassword=password -Djavax.net.ssl.keyStoreType=JKS  -Djavax.net.ssl.trustStore=trustCARoot.jks  -Djavax.net.ssl.trustStorePassword=password -Djavax.net.ssl.trustStoreType=JKS

Any ideas on how to get a BUILD SUCCESS? I'm able to right click on each file in the browser and save into the local repository but when I try to execute goal mvn archetype:create-from-project maven still tries to download the archetype-packaging

like image 723
jeff Avatar asked Mar 06 '17 15:03

jeff


1 Answers

The answer provided here, adding the new maven repository in my settings.xml finally solved the issue Problems using Maven and SSL behind proxy

Earlier, I kept focusing on trying to generate the cert and including it in my trustStore but that never solved the issue.

I still needed to specify my proxy in the settings.xml as well

like image 54
jeff Avatar answered Nov 14 '22 03:11

jeff