- ベストアンサー
struts2のMaven ProjectをEclipseで作成
しようとしたのですが 作成メニューのNexus Indexerのページで struts 2を探したのですが Struts 2最新バージョンのstruts2.1.6でなく struts2.0.11.2しかありません。 struts2.1.6のMaven ProjectをEclipsse3.42で作成したいのですが どうしたらいいでしょうか?
- みんなの回答 (4)
- 専門家の回答
質問者が選んだベストアンサー
あぁ、すみません、 # mvn archetype:generate -B \ > -DremoteRepositories=http://www.lenart.org.pl/maven \ > -DgroupId=tutorial \ > -DartifactId=tutorial \ > -DarchetypeGroupId=org.apache.struts \ > -DarchetypeArtifactId=struts2-archetype-blank \ > -DarchetypeVersion=2.1.6 じゃなくて、 mvn archetype:generate -DarchetypeCatalog=http://www.lenart.org.pl/maven だけでやってみてください。するとインタラクティブなメニューがでると思うので、指示に従って進んでみてください。
その他の回答 (3)
- foxa-gogo
- ベストアンサー率44% (38/85)
うーん、これでどうでしょう?(^^;) mvn archetype:generate -DarchetypeCatalog=http://www.lenart.org.pl/maven これでダメだったらすみません。。。
補足
ありがとうございます。 同じく以下の様にダメでした。 何かそれ用の環境設定が必要なのでしょうか? ブラウザでそのサイトを見ると確かに有りますが 見つからないというエラーが出てしまいます。 OSはfedora10(32bit)です。 mavenのバージョンは2.1.0です。 # mvn archetype:generate -B \ > -DremoteRepositories=http://www.lenart.org.pl/maven \ > -DgroupId=tutorial \ > -DartifactId=tutorial \ > -DarchetypeGroupId=org.apache.struts \ > -DarchetypeArtifactId=struts2-archetype-blank \ > -DarchetypeVersion=2.1.6 [INFO] Scanning for projects... [INFO] Searching repository for plugin with prefix: 'archetype'. [INFO] ------------------------------------------------------------------------ [INFO] Building Maven Default Project [INFO] task-segment: [archetype:generate] (aggregator-style) [INFO] ------------------------------------------------------------------------ [INFO] Preparing archetype:generate [INFO] No goals needed for project - skipping [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:generate] [INFO] Generating project in Batch mode [WARNING] No archetype repository found. Falling back to central repository (http://repo1.maven.org/maven2). [WARNING] Use -DarchetypeRepository=<your repository> if archetype's repository is elsewhere. Downloading: http://repo1.maven.org/maven2/org/apache/struts/struts2-archetype-blank/2.1.6/struts2-archetype-blank-2.1.6.jar [INFO] Unable to find resource 'org.apache.struts:struts2-archetype-blank:jar:2.1.6' in repository struts2-archetype-blank-repo (http://repo1.maven.org/maven2) Downloading: http://repo1.maven.org/maven2/org/apache/struts/struts2-archetype-blank/2.1.6/struts2-archetype-blank-2.1.6.jar [INFO] Unable to find resource 'org.apache.struts:struts2-archetype-blank:jar:2.1.6' in repository central (http://repo1.maven.org/maven2) [INFO] ------------------------------------------------------------------------ [ERROR] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] The desired archetype does not exist (org.apache.struts:struts2-archetype-blank:2.1.6) [INFO] ------------------------------------------------------------------------ [INFO] For more information, run Maven with the -e switch [INFO] ------------------------------------------------------------------------ [INFO] Total time: 12 seconds [INFO] Finished at: Mon Jun 15 22:40:12 JST 2009 [INFO] Final Memory: 8M/14M [INFO] ------------------------------------------------------------------------ #
- foxa-gogo
- ベストアンサー率44% (38/85)
あれ、確か見たと思ったのですが、、、 -DremoteRepositories=http://people.apache.org/builds/struts/m2-staging-repositoryを加えたらどうなるでしょうか?
補足
ありがとうございます。 やはりできませんでした。 ちなみに -DremoteRepositories=http://people.apache.org/builds/struts/struts-archetypes/m2-staging-repository/ でもやってみましたがうまくいきませんでした。 # mvn archetype:generate -B \ > -DremoteRepositories=http://people.apache.org/builds/struts/m2-staging-repository \ > -DgroupId=tutorial \ > -DartifactId=tutorial \ > -DarchetypeGroupId=org.apache.struts \ > -DarchetypeArtifactId=struts2-archetype-blank \ > -DarchetypeVersion=2.1.6 [INFO] Scanning for projects... [INFO] Searching repository for plugin with prefix: 'archetype'. [INFO] ------------------------------------------------------------------------ [INFO] Building Maven Default Project [INFO] task-segment: [archetype:generate] (aggregator-style) [INFO] ------------------------------------------------------------------------ [INFO] Preparing archetype:generate [INFO] No goals needed for project - skipping [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:generate] [INFO] Generating project in Batch mode [WARNING] No archetype repository found. Falling back to central repository (http://repo1.maven.org/maven2). [WARNING] Use -DarchetypeRepository=<your repository> if archetype's repository is elsewhere. Downloading: http://repo1.maven.org/maven2/org/apache/struts/struts2-archetype-blank/2.1.6/struts2-archetype-blank-2.1.6.jar [INFO] Unable to find resource 'org.apache.struts:struts2-archetype-blank:jar:2.1.6' in repository struts2-archetype-blank-repo (http://repo1.maven.org/maven2) Downloading: http://repo1.maven.org/maven2/org/apache/struts/struts2-archetype-blank/2.1.6/struts2-archetype-blank-2.1.6.jar [INFO] Unable to find resource 'org.apache.struts:struts2-archetype-blank:jar:2.1.6' in repository central (http://repo1.maven.org/maven2) [INFO] ------------------------------------------------------------------------ [ERROR] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] The desired archetype does not exist (org.apache.struts:struts2-archetype-blank:2.1.6) [INFO] ------------------------------------------------------------------------ [INFO] For more information, run Maven with the -e switch [INFO] ------------------------------------------------------------------------ [INFO] Total time: 7 seconds [INFO] Finished at: Mon Jun 15 06:43:11 JST 2009 [INFO] Final Memory: 8M/14M [INFO] ------------------------------------------------------------------------ #
- foxa-gogo
- ベストアンサー率44% (38/85)
http://cwiki.apache.org/WW/struts-2-blank-archetype.html より。 ワークスペースに適当なフォルダをつくり、そこで以下を実行してください。 $ mvn archetype:generate -B \ -DgroupId=tutorial \ -DartifactId=tutorial \ -DarchetypeGroupId=org.apache.struts \ -DarchetypeArtifactId=struts2-archetype-blank \ -DarchetypeVersion=2.1.6 あとはエクリプスからインポート。
補足
ありがとうございます。 エラーがでて実行で着ませんでした。 標準のmavenサイトには登録されていないのではないでしょうか? # mvn archetype:generate -B \ > -DgroupId=tutorial \ > -DartifactId=tutorial \ > -DarchetypeGroupId=org.apache.struts \ > -DarchetypeArtifactId=struts2-archetype-blank \ > -DarchetypeVersion=2.1.6 [INFO] Scanning for projects... [INFO] Searching repository for plugin with prefix: 'archetype'. [INFO] ------------------------------------------------------------------------ [INFO] Building Maven Default Project [INFO] task-segment: [archetype:generate] (aggregator-style) [INFO] ------------------------------------------------------------------------ [INFO] Preparing archetype:generate [INFO] No goals needed for project - skipping [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:generate] [INFO] Generating project in Batch mode [WARNING] No archetype repository found. Falling back to central repository (http://repo1.maven.org/maven2). [WARNING] Use -DarchetypeRepository=<your repository> if archetype's repository is elsewhere. Downloading: http://repo1.maven.org/maven2/org/apache/struts/struts2-archetype-blank/2.1.6/struts2-archetype-blank-2.1.6.jar [INFO] Unable to find resource 'org.apache.struts:struts2-archetype-blank:jar:2.1.6' in repository struts2-archetype-blank-repo (http://repo1.maven.org/maven2) Downloading: http://repo1.maven.org/maven2/org/apache/struts/struts2-archetype-blank/2.1.6/struts2-archetype-blank-2.1.6.jar [INFO] Unable to find resource 'org.apache.struts:struts2-archetype-blank:jar:2.1.6' in repository central (http://repo1.maven.org/maven2) [INFO] ------------------------------------------------------------------------ [ERROR] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] The desired archetype does not exist (org.apache.struts:struts2-archetype-blank:2.1.6) [INFO] ------------------------------------------------------------------------ [INFO] For more information, run Maven with the -e switch [INFO] ------------------------------------------------------------------------ [INFO] Total time: 9 seconds [INFO] Finished at: Sun Jun 14 20:15:33 JST 2009 [INFO] Final Memory: 8M/15M [INFO] ------------------------------------------------------------------------ #
お礼
ありがとうございます。 エラーはでませんでした。