...
Creating the project
To create your project, use copy and paste the following command, modifying the bold elements as desired
...
command line generated after typing in the groupId and artifactId in the corresponding textfields.
HTML | ||
---|---|---|
| ||
<html>
<body>
<script type="text/javascript">
function changeIt()
{
var groupId = document.form.t1.value;
var artifactId = document.form.t2.value;
my_div.innerHTML = 'mvn archetype:create -DarchetypeGroupId=org.apache.wicket -DarchetypeArtifactId=wicket-archetype-quickstart -DarchetypeVersion=1.3.0-rc1 -DgroupId=' + groupId + ' -DartifactId=' + artifactId;
}
</script>
<form name="form">
<b>GroupId:</b>
<input type="text" name=t1 value="com.mycompany" onkeyup=changeIt()>
<b> ArtifactId:</b>
<input type="text" name=t2 value="myproject" onkeyup=changeIt()>
<br><br>
<b>Command Line:</b>
<div id="my_div">mvn archetype:create |
...
-DarchetypeGroupId=org.apache.wicket |
...
-DarchetypeArtifactId=wicket-archetype-quickstart |
...
-DarchetypeVersion=1.3.0-rc1 |
...
-DgroupId=com.mycompany |
...
-DartifactId=myproject </div> </body> </html> |
Results
This will produce the following project structure/files
No Format |
---|
.\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
|
...
At present, running mvn package
or mvn install
will result in a NPE from the Surefire (testing) plugin as the generated pom.xml
has no dependency on either JUnit
or TestNG
, which the plugin appears to expect if a src/test/java
path is present. To avoid this issue, simply add the following to the <dependencies>
section of the pom.xml
.
No Format |
---|
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.2</version>
<scope>test</scope>
</dependency>
|
...