[ 
https://issues.apache.org/jira/browse/ARCHETYPE-530?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16373797#comment-16373797
 ] 

Michal Telpski commented on ARCHETYPE-530:
------------------------------------------

It looks like same applies to authentication to repositories using:
{code:java}
<server>
  <id>id</id>
  <username>user</username>
  <password>pass</password>
</server>{code}
Command-line call:

{{mvn -s <settings.xml different than in ~/.m2> archetype:create-from-project 
-Darchetype.postPhase=deploy}}

results in maven-deploy-plugin failure:

{{Could not transfer metadata from/to maven-snapshots: Not authorized , 
ReasonPhrase:Unauthorized. -> [Help 1]}}

although that call (w/o archetype generation) would work:

{{mvn -s <settings.xml different than in ~/.m2> deploy}}

 

There is a workaround though: separate archetype creation and deployment:

{{mvn -s <settings> archetype:create-from-project && mvn -s <settings> -f 
target/generated-sources/archetype deploy}}

 

Btw. is this the same issue as originally reported one?

> [archetype:create-from-project] Proxy configuration from settings.xml is not 
> taken into account
> -----------------------------------------------------------------------------------------------
>
>                 Key: ARCHETYPE-530
>                 URL: https://issues.apache.org/jira/browse/ARCHETYPE-530
>             Project: Maven Archetype
>          Issue Type: Bug
>          Components: Plugin
>    Affects Versions: 3.0.1
>            Reporter: Vadym Lotar
>            Priority: Major
>
> Hello,
> While trying to create an archetype out of source project applying global 
> settings.xml which contains proxy configuration, plugin fails with the 
> following error:
> {color:red}[INFO] Scanning for projects...
> [INFO] Downloading: 
> https://repo.maven.apache.org/maven2/org/apache/maven/archetype/archetype-packaging/3.0.1/archetype-packaging-3.0.1.pom
> [ERROR] [ERROR] Some problems were encountered while processing the POMs:
> [ERROR] Unresolveable build extension: Plugin 
> org.apache.maven.archetype:archetype-packaging:3.0.1 or one of its 
> dependencies could not be resolved: Failed to read artifact descriptor for 
> org.apache.maven.archetype:archetype-packaging:jar:3.0.1 @ 
> [ERROR] Unknown packaging: maven-archetype @ line 8, column 14
>  @ 
> [ERROR] The build could not read 1 project -> [Help 1]
> [ERROR]   
> [ERROR]   The project com.adidas.pc:kafka_consumer-archetype:1.0-SNAPSHOT 
> (/opt/jenkins/workspace/PC/pcdsp/archetypes/kafka-consumer-archetype-build/target/generated-sources/archetype/pom.xml)
>  has 2 errors
> [ERROR]     Unresolveable build extension: Plugin 
> org.apache.maven.archetype:archetype-packaging:3.0.1 or one of its 
> dependencies could not be resolved: Failed to read artifact descriptor for 
> org.apache.maven.archetype:archetype-packaging:jar:3.0.1: Could not transfer 
> artifact org.apache.maven.archetype:archetype-packaging:pom:3.0.1 from/to 
> central (https://repo.maven.apache.org/maven2): Connect to 
> repo.maven.apache.org:443 [repo.maven.apache.org/151.101.112.215] failed: 
> Connection timed out (Connection timed out) -> [Help 2]
> [ERROR]     Unknown packaging: maven-archetype @ line 8, column 14{color}
> It appeared that the plugin creates new 
> org.apache.maven.shared.invoker.InvocationRequest to "package" the archetype 
> without applying configuration specified in settings.xml.
> Being more precise, I feel like the invocation request itself has to be built 
> in a little bit different way here, so local and global settings.xml are 
> passed:
> org/apache/maven/archetype/creator/FilesetArchetypeCreator.java:281
> Please, let me know if more information needs to be provided.
> Best.
> ----
> {color:red}[ERROR] Failed to execute goal 
> org.apache.maven.plugins:maven-archetype-plugin:3.0.1:create-from-project 
> (default-cli) on project kafka_consumer: Invoker process ended with result 
> different than 0! -> [Help 1]
> org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute 
> goal 
> org.apache.maven.plugins:maven-archetype-plugin:3.0.1:create-from-project 
> (default-cli) on project kafka_consumer: Invoker process ended with result 
> different than 0!
>       at 
> org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
>       at 
> org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
>       at 
> org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
>       at 
> org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
>       at 
> org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
>       at 
> org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
>       at 
> org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
>       at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
>       at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
>       at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
>       at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
>       at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
>       at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
>       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>       at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>       at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>       at java.lang.reflect.Method.invoke(Method.java:498)
>       at 
> org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
>       at 
> org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
>       at 
> org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
>       at 
> org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
> Caused by: org.apache.maven.plugin.MojoFailureException: Invoker process 
> ended with result different than 0!
>       at 
> org.apache.maven.archetype.mojos.CreateArchetypeFromProjectMojo.execute(CreateArchetypeFromProjectMojo.java:261)
>       at 
> org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
>       at 
> org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
>       ... 20 more{color}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to