2
votes

I am trying to create Wicket with maven application followed by URL: http://wicket.apache.org/start/quickstart.html , but i get the following error, means the build is getting failed. please help me

executed the below command to generate application

mvn archetype:generate -DarchetypeGroupId=org.apache.wicket -DarchetypeArtifactId=wicket-archetype-quickstart -DarchetypeVersion=1.5-SNAPSHOT -DgroupId=com.mycompany -DartifactId=myproject -DarchetypeRepository=https://repository.apache.org/content/repositories/snapshots/ -DinteractiveMode=false

The build is failed mvn archetype:generate -DarchetypeGroupId=org.apache.wicket -DarchetypeArtifactId=wicket-archetype-quickstart -DarchetypeVersion=1.5-SNAPSHOT -DgroupId=com.mycompany -DartifactId=myproject -DarchetypeRepository=https://repository.apache.org/content/repositories/snapshots/ -DinteractiveMode=false

4
Error: Downloading: repo1.maven.org/maven2/org/apache/maven/plugins/… [WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-clean-plugin:2.4.1: Plugin org.apache.maven.plugins:maven-clean-plug in:2.4.1 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-clean-plugin:jar:2.4. 1 - Delli Kilari
There seems to be something wrong with your Maven setup. This plugin is available in Maven central repo but for some reason it seems you don't have Central in your list of repos. - martin-g

4 Answers

2
votes

It worked for me with the exact command that you issued (shown here on multiple lines for clarity):

mvn archetype:generate 
    -DarchetypeGroupId=org.apache.wicket 
    -DarchetypeArtifactId=wicket-archetype-quickstart 
    -DarchetypeVersion=1.5-SNAPSHOT 
    -DgroupId=com.mycompany -DartifactId=myproject 
    -DarchetypeRepository=https://repository.apache.org/content/repositories/snapshots/ 
    -DinteractiveMode=false

My setup is :

Apache Maven 3.0.3
Java version: 1.6.0_29

Although your error doesn't imply a Maven version problem I would suggest using Maven 3. It has been stable for a long time now.

Do you have direct access to the Internet (and therefore repo1.maven.org) or are you behind a proxy server? If so, does your settings file have the proxy configured?

1
votes

Dont use a SNAPSHOT archetype version unless you have the snapshot repository defined in your settings.xml. Use version 1.5.3 (see http://search.maven.org/#artifactdetails%7Corg.apache.wicket%7Cwicket-archetype-quickstart%7C1.5.3%7Cmaven-archetype) and forget about defining the archetypeRepository.

This works for me:

mvn archetype:generate -DarchetypeGroupId=org.apache.wicket -DarchetypeArtifactId=wicket-archetype-quickstart  -DgroupId=com.mycompany -DartifactId=myproject -DinteractiveMode=false
1
votes

thanks for all responses, apparently the problem got resolved by just changing the proxy settings in maven setting.xml file.

0
votes

Quickstarts are made from a Maven archetype. So, you will need to have Maven 2 installed and working (from the command line) before following this.

mvn archetype:generate -DarchetypeGroupId=org.apache.wicket -DarchetypeArtifactId=wicket-archetype-quickstart -DarchetypeVersion=6.4.0 -DgroupId=com.mycompany -DartifactId=myproject -DarchetypeRepository=https://repository.apache.org/ -DinteractiveMode=false

Results

This will produce the following project structure/files:

   .\myproject
    |   pom.xml
    |
    \---src
        +---main
        |   +---java
        |   |   \---com
        |   |       \---mycompany
        |   |               HomePage.html
        |   |               HomePage.java
        |   |               WicketApplication.java
        |   |
        |   +---resources
        |   |       log4j.properties
        |   |
        |   \---webapp
        |       \---WEB-INF
        |               web.xml
        |
        \---test
            \---java
                \---com
                    \---mycompany
                            Start.java