Maven 2

5 respostas
L

Pessoal,
Comprei o livro Pratical Apache Struts 2 Web 2.0 Projects, mas estou tendo problemas em gerar o archetype do struts2-starter-2.0.9. Alguém já passou pelo mesmo problema se algum puder me ajudar desde já agradeço:
o seguinte erro ocorre:

C:\Workspaces>mvn archetype:create -DgroupId=tutorial -DartifactId=tutorial -Dar
chetypeGroupId=org.apache.struts -DarchetypeArtifactId=struts2-archetype-starter
-DarchetypeVersion=2.0.9-SNAPSHOT -DremoteRepositories=http://people.apache.org
/repo/m2-snapshot-repository
[INFO] Scanning for projects…
[INFO] Searching repository for plugin with prefix: ‘archetype’.
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Default Project
[INFO] task-segment: [archetype:create] (aggregator-style)
[INFO] ------------------------------------------------------------------------
[INFO] Setting property: classpath.resource.loader.class => ‘org.codehaus.plexus
.velocity.ContextClassLoaderResourceLoader’.
[INFO] Setting property: velocimacro.messages.on => ‘false’.
[INFO] Setting property: resource.loader => ‘classpath’.
[INFO] Setting property: resource.manager.logwhenfound => ‘false’.
[INFO] [archetype:create]
[WARNING] This goal is deprecated. Please use mvn archetype:generate instead
[INFO] Defaulting package to group ID: tutorial
[INFO] We are using command line specified remote repositories: http://people.ap
ache.org/repo/m2-snapshot-repository
[INFO] snapshot org.apache.struts:struts2-archetype-starter:2.0.9-SNAPSHOT: chec
king for updates from id0
Downloading: http://people.apache.org/repo/m2-snapshot-repository/org/apache/str
uts/struts2-archetype-starter/2.0.9-SNAPSHOT/struts2-archetype-starter-2.0.9-SNA
PSHOT.jar
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to resolve artifact.

GroupId: org.apache.struts
ArtifactId: struts2-archetype-starter
Version: 2.0.9-SNAPSHOT

Reason: Unable to download the artifact from any repository

Try downloading the file manually from the project website.

Then, install it using the command:
mvn install:install-file -DgroupId=org.apache.struts -DartifactId=struts2-ar
chetype-starter -Dversion=2.0.9-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file

Alternatively, if you host your own repository you can deploy the file there:
mvn deploy:deploy-file -DgroupId=org.apache.struts -DartifactId=struts2-arch
etype-starter -Dversion=2.0.9-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file -Dur
l=[url] -DrepositoryId=[id]

org.apache.struts:struts2-archetype-starter:jar:2.0.9-SNAPSHOT

from the specified remote repositories:
id0 (http://people.apache.org/repo/m2-snapshot-repository)

[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4 seconds
[INFO] Finished at: Thu Aug 14 10:05:00 GMT-03:00 2008
[INFO] Final Memory: 8M/14M
[INFO] ------------------------------------------------------------------------

5 Respostas

fiaux

O Maven vai tentar buscar no repositório local e online também as dependências do projeto. Se ele não consegue por alguma razão encontrar, dá isso. Você deve fazer o que ele sugeriu:

Reason: Unable to download the artifact from any repository

Try downloading the file manually from the project website.

Then, install it using the command:
mvn install:install-file -DgroupId=org.apache.struts -DartifactId=struts2-ar
chetype-starter -Dversion=2.0.9-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file


Baixa o jar e roda esse comando para instalar ele manualmente.

L

Cao fiaux,

Estou com dúvida em como preencher o campo -Dfile=path/to/file você sabe como preencher esse campo para o archetype referido…

fiaux

leymoreira:
Cao fiaux,

Estou com dúvida em como preencher o campo -Dfile=path/to/file você sabe como preencher esse campo para o archetype referido…


Path to file é onde está arquivo.

L

cara muito obrigado vou tentar baixar aqui o arquivo manualmente, mas desde já agradeço muito a ajuda valeu…

V

Estava tendo o mesmo problema, então busquei por uma nova versão do archetype.

Tente o seguinte comando:

mvn archetype:create -DgroupId=br.scmba.teste -DartifactId=app -DarchetypeGroupId=org.apache.struts -DarchetypeArtifactId=struts2-archetype-starter -DarchetypeVersion=2.0.11.2-SNAPSHOT -DremoteRepositories=http://people.apache.org/repo/m2-snapshot-repository

A diferença é que a verão do archetype foi alterada.

Criado 14 de agosto de 2008
Ultima resposta 11 de set. de 2008
Respostas 5
Participantes 3