The goal of this maven project is to maintain the code that will generate the xenon-quickstart archetype.
For ease of developing and extending the archetype, please first add files to/edit the java project in src/main/java, using the package name "example.group". You can then build the project as normal with Maven, using commands like "mvn test" or "mvn package".
When you run mvn package
, Maven will run the script "scripts/copy-files.sh" which will copy the files to the
"src/main/resources/archetype-resources" directory where Maven expects to find archetype files. copy-files.sh will
also replace the "example.group" string with ${groupId} string everywhere it finds it in the files that it is copying.
To generate the archetype-ready package, and install it into your local repository (~/.m2)
mvn install
After you have installed it in your local repository or installed it in a remote repository to which you have access, you can create an archetype as follows:
mvn archetype:generate \
-DarchetypeGroupId=com.vmware.xenon \
-DarchetypeArtifactId=xenon-quickstart \
-DgroupId=<com.yourorg> \
-DarchetypeVersion=<version> \
-DartifactId=xenon-quickstart \
-DinteractiveMode=false
The current archetype version as of this writing is 1.3.7-SNAPSHOT, but this appears in the name of the JAR file generated with mvn package
and also in in your local mvn repository (~/.m2/archetype-catalog.xml
, by default)
The archetype project also has a rule to build a jar file with all dependencies, so consumers can immediately run their new application.
cd xenon-quickstart
mvn package
java -jar target/xenon-quickstart-1.0-SNAPSHOT-jar-with-dependencies.jar
If you add new .java files, please edit
scripts/copy-files.sh
and add the new files to the variables at the top. If you are adding something other than a new .java file in src/main/java or src/test/java then you will instead need to manually place it in
src/main/resources/archetype-resources
In some cases you may need to edit
src/main/resources/META-INF/maven/archetype-metadata.xml
which defines which files are to be made available for archetype generation. Right now the file is configured such that you shouldn't need to edit archetype-metadata for for most use cases.
If you need to make chances to the README that the consumer of hte archetype will see or change the pom.xml file that is included with the generated archetype, you can find them in:
src/main/resources/archetype-resources/README.quickstart
src/main/resources/archetype-resources/pom.xml
All tests are integration tests. If you want to run the tests, but not install in the local repository:
mvn integration-test
If you add new unit tests, they will be run by the integration-test target. Currently there is one integration-test, which runs the "integration-test" on an archetype generated by this project. If you want to run other maven commands on the generated archetype as part of the
src/test/resources/projects/