Maven Archetype generate proxy issue, searching for remote catalog

1.4k views Asked by At

Maven seem to be having a bug related to proxy when fetching archetype from maven's remote catalog.

My computer is behind a proxy server. I am trying to generate a project from maven command line.

 D:\test>mvn archetype:generate -DarchetypeArtifactId=scala-archetype-simple -DinteractiveMode=false -DgroupId=com.sparktest -DartifactId=myspark -DarchetypeGroupId=net.alchim31.maven -DarchetypeVersion=1.6 -DarchetypeCatalog=remote -e -X

[DEBUG] Searching for remote catalog: http://repo.maven.apache.org/maven2/archetype-catalog.xml

[DEBUG] Archetype org.apache.maven.archetypes:scala-archetype-simple:1.6 doesn't exist
org.apache.maven.archetype.downloader.DownloadNotFoundException: 
Requested org.apache.maven.archetypes:scala-archetype-simple:jar:1.6 download does not exist.

Below Eclipse Bugs are related, however the issue seems to be with maven rather than Eclipse. https://bugs.eclipse.org/bugs/show_bug.cgi?id=390183#add_comment

Please note there is no issue working on existing maven project. The dependencies get downloaded without any issue once maven proxy is configured in settings.xml. The issue comes when generating a project using archetype:generate and using maven remote archetype-catalog. Maven archetype-catelog can be opened in a browser without any issue http://repo.maven.apache.org/maven2/archetype-catalog.xml

2

There are 2 answers

1
Mickael On

It's seems that scala-archetype-simple archetype with groupId org.apache.maven.archetypes doesn't actually exist.

You should try one of these :

0
BenTaylor On

I had this exact issue and the following worked for me: have two proxies, one for http and one for https.

<proxy>
   <id>my-proxy-http</id>
   <active>true</active>
   <protocol>http</protocol>
   <host>xx.xx.x.xxx</host>
   <port>8080</port>
   <username>myusername</username>
   <password>mypassword</password>
</proxy>
<proxy>
   <id>my-proxy-https</id>
   <active>true</active>
   <protocol>https</protocol>
   <host>xx.xx.x.xxx</host>
   <port>8080</port>
   <username>myusername</username>
   <password>mypassword</password>
</proxy>