tworzenie projektu struts2

0

Mam problem z utworzeniem projektu struts2 przy wykorzystaniu maven'a.
Na stronie http://struts.apache.org/2.1.6/docs/struts-maven-archetypes.html napisane jest żeby skorzystać z
[code]
mvn archetype:create -DgroupId=tutorial
-DartifactId=tutorial
-DarchetypeGroupId=org.apache.struts
-DarchetypeArtifactId=struts2-archetype-starter
-DarchetypeVersion=2.0.11.2
[code]
Ale na stronie projektu maven napisane jest że zamiast archetype:create powinno się korzystać z generate.
tu napisali jak skorzystać z generate http://struts.apache.org/2.x/docs/struts-2-blank-archetype.html
ale, w repozytorium mavena nie istnieje ścieżka org/apache/struts/struts2-archetype-blank, istnieje natomiast struts2-blank/ ale w nim z kolei nie ma pliku struts2-blank-2.1.6.jar :| więc jak zbudować ten projekt ?

0

na początek mvn archetype:generate. Później wybierasz z listy projekt struts 2 i wszystko się już dzieje samo.

0

nie bardzo mam taka możliwość...

D:\workshop\jee\devel>mvn archetype:generate
[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 {execution: default-cli}]
[INFO] Generating project in Interactive mode
[INFO] No archetype defined. Using maven-archetype-quickstart (org.apache.maven.archetypes:maven-archetype-quickstart:1.0)
Choose archetype:
1: internal -> appfuse-basic-jsf (AppFuse archetype for creating a web application with Hibernate, Spring and JSF)
2: internal -> appfuse-basic-spring (AppFuse archetype for creating a web application with Hibernate, Spring and Spring MVC)
3: internal -> appfuse-basic-struts (AppFuse archetype for creating a web application with Hibernate, Spring and Struts 2)
4: internal -> appfuse-basic-tapestry (AppFuse archetype for creating a web application with Hibernate, Spring and Tapestry 4)
5: internal -> appfuse-core (AppFuse archetype for creating a jar application with Hibernate and Spring and XFire)
6: internal -> appfuse-modular-jsf (AppFuse archetype for creating a modular application with Hibernate, Spring and JSF)
7: internal -> appfuse-modular-spring (AppFuse archetype for creating a modular application with Hibernate, Spring and Spring MVC)
8: internal -> appfuse-modular-struts (AppFuse archetype for creating a modular application with Hibernate, Spring and Struts 2)
9: internal -> appfuse-modular-tapestry (AppFuse archetype for creating a modular application with Hibernate, Spring and Tapestry 4)
10: internal -> maven-archetype-j2ee-simple (A simple J2EE Java application)
11: internal -> maven-archetype-marmalade-mojo (A Maven plugin development project using marmalade)
12: internal -> maven-archetype-mojo (A Maven Java plugin development project)
13: internal -> maven-archetype-portlet (A simple portlet application)
14: internal -> maven-archetype-profiles ()
15: internal -> maven-archetype-quickstart ()
16: internal -> maven-archetype-site-simple (A simple site generation project)
17: internal -> maven-archetype-site (A more complex site project)
18: internal -> maven-archetype-webapp (A simple Java web application)
19: internal -> jini-service-archetype (Archetype for Jini service project creation)
20: internal -> softeu-archetype-seam (JSF+Facelets+Seam Archetype)
21: internal -> softeu-archetype-seam-simple (JSF+Facelets+Seam (no persistence) Archetype)
22: internal -> softeu-archetype-jsf (JSF+Facelets Archetype)
23: internal -> jpa-maven-archetype (JPA application)
24: internal -> spring-osgi-bundle-archetype (Spring-OSGi archetype)
25: internal -> confluence-plugin-archetype (Atlassian Confluence plugin archetype)
26: internal -> jira-plugin-archetype (Atlassian JIRA plugin archetype)
27: internal -> maven-archetype-har (Hibernate Archive)
28: internal -> maven-archetype-sar (JBoss Service Archive)
29: internal -> wicket-archetype-quickstart (A simple Apache Wicket project)
30: internal -> scala-archetype-simple (A simple scala project)
31: internal -> lift-archetype-blank (A blank/empty liftweb project)
32: internal -> lift-archetype-basic (The basic (liftweb) project)
33: internal -> cocoon-22-archetype-block-plain ([http://cocoon.apache.org/2.2/maven-plugins/])
34: internal -> cocoon-22-archetype-block ([http://cocoon.apache.org/2.2/maven-plugins/])
35: internal -> cocoon-22-archetype-webapp ([http://cocoon.apache.org/2.2/maven-plugins/])
36: internal -> myfaces-archetype-helloworld (A simple archetype using MyFaces)
37: internal -> myfaces-archetype-helloworld-facelets (A simple archetype using MyFaces and facelets)
38: internal -> myfaces-archetype-trinidad (A simple archetype using Myfaces and Trinidad)
39: internal -> myfaces-archetype-jsfcomponents (A simple archetype for create custom JSF components using MyFaces)
40: internal -> gmaven-archetype-basic (Groovy basic archetype)
41: internal -> gmaven-archetype-mojo (Groovy mojo archetype)
Choose a number:  (1/2/3/4/5/6/7/8/9/10/11/12/13/14/15/16/17/18/19/20/21/22/23/24/25/26/27/28/29/30/31/32/33/34/35/36/37/38/39/40/41) 1
5: :
`</code>`
0

[rotfl] [rotfl] [rotfl] Nie ma to jak maven. Sorry, nie mogłem się powstrzymać.

Kilkanaście razy chciałem się przekonać do tej technologii (jeszcze za czasów wersji 1, później 1.1, 2.x itd.) i każde starcie z mavenem kończyło się jedną wielką serią WTFów. To jest chyba koronny przykład technologii, która (źle) rozwiązuje kilka problemów i generuje kilkadziesiąt nowych. Ostatnim razem próba kompilacji Jetty ze źródeł zakończyła się ściągnięciem 3/4 internetu na mój dysk i wywaleniem błędów w testach mimo podania "-Dmaven.test.skip".

0

@up: też się zaczynam do niego przekonywać :P

moim zdaniem nie daje się stworzyć przy pomocy mavena projektu dla struts 2.6.1 jedyne co się daje to zrobić to dla wersji 2.0.11.2 :| i to nie blank a starter, nie wiem czym to się różni /maven2/org/apache/struts/struts2-archetype-starter/2.0.11.2/

edit:
dobra, już wiem czym się różni...

1 użytkowników online, w tym zalogowanych: 0, gości: 1