Docs » Contributors
Isis archetypes are reverse engineered from example applications. Once reverse engineered, the source is checked into git (replacing any earlier version of the archetype) and released.
Switch to the directory containing the example application; this page uses quickstart_wicket_restful_jdo:
cd example/application/quickstart_wicket_restful_jdo
Make sure that the app's pom.xml:
-SNAPSHOT versionCheck for and fix any missing license header notices:
mvn org.apache.rat:apache-rat-plugin:check -D rat.numUnapprovedLicenses=50 -o for a in `find . -name rat.txt -print`; do grep '!???' $a; done
Finally, double check that the app is running satisfactorily.
Before we generate the archetype, we clear out all non source code artifacts.
Start by doing the regular mvn clean:
mvn clean
To view the remaining files/directories that needs removing, use:
for a in .project .classpath .settings bin target-ide; do find . -name $a -print; done find . -name "*.log" -print
To actually delete these files, use:
for a in .project .classpath .settings bin target-ide; do find . -name $a -exec rm -r {} \;; done
find . -name "*.log" -exec rm {} \;
Now we can create the archetype:
mvn archetype:create-from-project groovy ../../../scripts/updateGeneratedArchetypeSources.groovy -v 1.2.3
where 1.2.3 is the version of isis core that is to be the parent of the generated archetype.
First, build the archetype:
cd target/generated-sources/archetype mvn clean install cd ../../..
Then, in a different session, create a new app from the archetype:
mkdir /tmp/test
cd /tmp/test
mvn archetype:generate \
-D archetypeCatalog=local \
-D archetypeGroupId=org.apache.isis.archetype \
-D archetypeArtifactId=quickstart_wicket_restful_jdo-archetype \
-D groupId=com.mycompany \
-D artifactId=myapp
Build the newly generated app:
cd myapp mvn clean install
And test. For example:
cd viewer-webapp mvn antrun:run
Back in the original session (at example/application/quickstart_wicket_restful_jdo), we are ready to check the archetype source code into git.
If this is an update to an existing archetype:
git rm -rf ../../archetype/quickstart_wicket_restful_jdo rm -rf ../../archetype/quickstart_wicket_restful_jdo
Make sure that the archetype/quickstart_wicket_restful_jdo directory was fully removed, otherwise the next command will not copy the regenerated source into the correct location.
Then, copy over the generated source of the archetype:
cp -r target/generated-sources/archetype \
../../archetype/quickstart_wicket_restful_jdo
git add ../../archetype/quickstart_wicket_restful_jdo
Next, confirm that the -SNAPSHOT version of the archetype is correct:
vi ../../archetype/quickstart_wicket_restful_jdo/pom.xml
If this a new archetype, then add a reference to the archetype to the root pom.xml, eg:
<modules>
...
<module>example/archetype/quickstart</module>
...
</modules>
Finally, commit the changes:
git commit -am "ISIS-nnn: updating archetype"
If the original application projects are imported into Eclipse, note that you'll need to recreate their project configuration afterwards (right click in Package Explorer > Maven > Update Package Configuration)
You may also want to import the new archetype project, using File > Import > Project > Maven > Existing Maven Project.
The procedure for releasing the archetype is the same as for any other releasable module; in essence:
cd example/archetype/quickstart_wicket_restful_jdo mvn release:prepare -P apache-release mvn release:perform -P apache-release
See the release process for full details.