You can find the full source code for this website in the Seam package in the directory /examples/wiki. It is licensed under the LGPL.
Before you start, take a look at the getting started guide.
The maven release plugin is very powerful, and will transform all your POMs to a release version, tag them, and then revert trunk or the branch back to a development version. We can also do a dry run to check there are no snapshot dependencies (for example, a developer might have mistakenly put the version in a sub-module). If there are any problems, you need to fix them, and check in the changes.
Make sure all the changes are checked in using:
svn status
Let X.X.X be the current version (minus the -SNAPSHOT) part and Y.Y.Y be the next version. Run:
mvn release:prepare --batch-mode -Drelease -DdevelopmentVersion=Y.Y.Y-SNAPSHOT -DreleaseVersion=X.X.X -Dtag=X.X.X -DdryRun
This will run through the release process, but not actually perform the tagging (as indicated by the -DdryRun flag).
If the build fails, go back and correct the problems ;)
Now we are ready to tag the release. Make sure the tag doesn't already exist, and run:
mvn release:prepare --batch-mode -Drelease -DdevelopmentVersion=Y.Y.Y-SNAPSHOT -DreleaseVersion=X.X.X -Dtag=X.X.X -Dresume=false
Now, run:
mvn release:perform nexus:staging-close -Drelease
You should see all the artifacts uploaded to the staging repository. You can promote so they become live
in the Maven Central Repository in the web interface. Choose JBoss Releases as the target repository.
This section contains instructions on verifying a release of the Maven Archetypes for the Weld Project.
First, have a developer stage a release, which is documented in the previous few sections. Then, have the developer give you the unique URL of the staging repository. You can browse it to see that it contains our archetypes. Here's how you use it to test.
Open up $HOME/.m2/settings.xml and add the following profile, filling in the staging URL where you see orgjbossweld-XXX
:
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/settings-1.0.0.xsd">
<profiles>
<profile>
<id>weld-staging</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<repositories>
<repository>
<id>oss.sonatype.org/weld-staging</id>
<releases>
<enabled/>
</releases>
<url>http://oss.sonatype.org/content/repositories/orgjbossweld-XXX</url>
</repository>
</repositories>
</profile>
</profiles>
</settings>
In order to use the interactive mode of archetype:generate, you have to tell it about the new archetypes. So create the file archetype-catalog.xml anywhere on disk with this content:
<?xml version="1.0" encoding="UTF-8"?>
<archetype-catalog>
<archetypes>
<archetype>
<groupId>org.jboss.weld.archetypes</groupId>
<artifactId>weld-jsf-servlet-minimal</artifactId>
<version>1.0.0-BETA1</version>
<description>Weld archetype for creating an application using JSF 2.0 and CDI 1.0 for Servlet Containers (Tomcat 6 / Jetty 6)</description>
</archetype>
<archetype>
<groupId>org.jboss.weld.archetypes</groupId>
<artifactId>weld-jsf-jee-minimal</artifactId>
<version>1.0.0-BETA1</version>
<description>Weld archetype for creating a minimal Java EE 6 application using JSF 2.0 and CDI 1.0 (no persistence unit)</description>
</archetype>
<archetype>
<groupId>org.jboss.weld.archetypes</groupId>
<artifactId>weld-jsf-jee</artifactId>
<version>1.0.0-BETA1</version>
<description>Weld archetype for creating a Java EE 6 application using JSF 2.0, CDI 1.0, EJB 3.1 and JPA 2.0 (persistence unit included)</description>
</archetype>
</archetypes>
</archetype-catalog>
Then run:
mvn archetype:generate -DarchetypeCatalog=file:///path/to/archetype-catalog.xml
Then you will see:
Choose archetype: 1: file:///path/to/archetype-catalog.xml -> weld-jsf-servlet-minimal (Weld archetype for creating an application using JSF 2.0 and CDI 1.0 for Servlet Containers (Tomcat 6 / Jetty 6)) 2: file:///path/to/archetype-catalog.xml -> weld-jsf-jee-minimal (Weld archetype for creating a minimal Java EE 6 application using JSF 2.0, CDI 1.0 and EJB 3.1 (persistence unit not included)) 3: file:///path/to/archetype-catalog.xml -> weld-jsf-jee (Weld archetype for creating a Java EE 6 application using JSF 2.0, CDI 1.0, EJB 3.1 and JPA 2.0 (persistence unit included)) Choose a number: (1/2/3):
#create new repo home in temp directory. #We don't want to our tests to pass because we have a locally cached version of a dependency that is otherwise unavailable. mkdir /tmp/m2/repository/org/jboss/weld/archetypes/ -p #remove all trace of old archetypes and downloaded code rm -rf ~/.m2/repository/org/jboss/weld/archetype/* /tmp/m2/repository/org/jboss/weld/archetypes/* archetypes myproject #check out from Anonymous SVN svn co http://anonsvn.jboss.org/repos/weld/archetypes/tags/1.0.0-BETA1 archetypes #build archetypes in regular repo mvn clean install -farchetypes/pom.xml #copy archetypes only to temp repo cp ~/.m2/repository/org/jboss/weld/archetypes/* /tmp/m2/repository/org/jboss/weld/archetypes/ -r #create new project from temp repo to ensure we're not using locally cached jars from building the archetypes or anything else on this machine. mvn archetype:generate -DinteractiveMode=n -DarchetypeArtifactId=weld-jsf-servlet-minimal -DarchetypeGroupId=org.jboss.weld.archetypes -DarchetypeVersion=1.0.0-BETA1 -DgroupId=com.mycompany -DartifactId=myproject -Dmaven.repo.local=/tmp/m2/repository/ #Build project from temp repo and launch in Jetty mvn clean test jetty:run -f myproject/pom.xml -Dmaven.repo.local=/tmp/m2/repository/ #Build project from temp repo and launch in Tomcat mvn clean test tomcat:run -f myproject/pom.xml -Dmaven.repo.local=/tmp/m2/repository/
We hope to leverage the expertise of the QA team to setup up a testing strategy for the archetypes. We've also inquired on the Maven forums to gather feedback on how other people approach the problem of testing archetypes.