Weld SVN: r7185 - in archetypes/javaee6-webapp/trunk: src/main/java/com/mycompany/data and 1 other directories.
by weld-commits@lists.jboss.org
Author: dan.j.allen
Date: 2011-01-20 02:19:45 -0500 (Thu, 20 Jan 2011)
New Revision: 7185
Added:
archetypes/javaee6-webapp/trunk/src/main/resources-jbossas/default-ds.xml
Removed:
archetypes/javaee6-webapp/trunk/src/main/resources-jbossas/application-ds.xml
Modified:
archetypes/javaee6-webapp/trunk/create-archetype.sh
archetypes/javaee6-webapp/trunk/pom.xml
archetypes/javaee6-webapp/trunk/readme.txt
archetypes/javaee6-webapp/trunk/src/main/java/com/mycompany/data/SeedDataImporter.java
Log:
switch back to default-ds.xml; add javadoc
Modified: archetypes/javaee6-webapp/trunk/create-archetype.sh
===================================================================
--- archetypes/javaee6-webapp/trunk/create-archetype.sh 2011-01-19 22:31:59 UTC (rev 7184)
+++ archetypes/javaee6-webapp/trunk/create-archetype.sh 2011-01-20 07:19:45 UTC (rev 7185)
@@ -31,9 +31,9 @@
;;' $ARCHETYPE_RESOURCES_DIR/readme.txt
sed -i 's;<name>jboss-javaee6-webapp-src</name>;<name>${name}</name>;' $ARCHETYPE_RESOURCES_DIR/pom.xml
sed -i 's;eclipse-dot-files/\?;;' $ARCHETYPE_DIR/src/main/resources/META-INF/maven/archetype-metadata.xml
-#sed -i 's;\(<jndi-name>\)[^<]\+\(</jndi-name>\);\1jdbc/${artifactId}\2;' $ARCHETYPE_RESOURCES_DIR/src/main/resources-jbossas/application-ds.xml
+#sed -i 's;\(<jndi-name>\)[^<]\+\(</jndi-name>\);\1jdbc/${artifactId}\2;' $ARCHETYPE_RESOURCES_DIR/src/main/resources-jbossas/default-ds.xml
#sed -i 's;\(<jta-data-source>\)[^<]\+\(</jta-data-source>\);\1jdbc/${artifactId}\2;' $ARCHETYPE_RESOURCES_DIR/src/main/resources/META-INF/persistence.xml
-mv $ARCHETYPE_RESOURCES_DIR/src/main/resources-jbossas/application-ds.xml $ARCHETYPE_RESOURCES_DIR/src/main/resources-jbossas/__artifactId__-ds.xml
+#mv $ARCHETYPE_RESOURCES_DIR/src/main/resources-jbossas/default-ds.xml $ARCHETYPE_RESOURCES_DIR/src/main/resources-jbossas/__artifactId__-ds.xml
rsync -az eclipse-dot-files/ $ARCHETYPE_RESOURCES_DIR/
# fix the archetype plugin being an idiot
find $ARCHETYPE_RESOURCES_DIR -type f -exec sed -i 's;packageInPathFormat;package;g' {} \;
@@ -52,5 +52,5 @@
cd target
mvn archetype:generate -B -DarchetypeCatalog=local \
-DarchetypeArtifactId=jboss-javaee6-webapp -DarchetypeGroupId=org.jboss.weld.archetypes -DarchetypeVersion=1.0.1-SNAPSHOT \
- -DartifactId=test-project -DgroupId=com.acme -Dpackage=com.acme.test -Dversion=1.0.0-SNAPSHOT -Dname="Java EE 6 webapp project"
+ -DartifactId=example-project -DgroupId=com.acme -Dpackage=com.acme.example -Dversion=1.0.0-SNAPSHOT -Dname="Java EE 6 webapp project"
fi
Modified: archetypes/javaee6-webapp/trunk/pom.xml
===================================================================
--- archetypes/javaee6-webapp/trunk/pom.xml 2011-01-19 22:31:59 UTC (rev 7184)
+++ archetypes/javaee6-webapp/trunk/pom.xml 2011-01-20 07:19:45 UTC (rev 7185)
@@ -173,7 +173,7 @@
<serverName>${jboss.domain}</serverName>
<fileNames>
<!-- JNDI DataSource that connects to in-memory HSQLDB to demonstrate JPA -->
- <fileName>src/main/resources-jbossas/${project.artifactId}-ds.xml</fileName>
+ <fileName>src/main/resources-jbossas/default-ds.xml</fileName>
<!-- DataSource needs to go before the application -->
<fileName>${project.build.directory}/${project.build.finalName}.war</fileName>
</fileNames>
Modified: archetypes/javaee6-webapp/trunk/readme.txt
===================================================================
--- archetypes/javaee6-webapp/trunk/readme.txt 2011-01-19 22:31:59 UTC (rev 7184)
+++ archetypes/javaee6-webapp/trunk/readme.txt 2011-01-20 07:19:45 UTC (rev 7185)
@@ -22,7 +22,7 @@
SDK 1.6) and Maven 3.
The application this project produces is designed to be run on a Java EE 6
- application server. We recommend JBoss AS 6.0.0.CR1 or GlassFish 3.0.1, though
+ application server. We recommend JBoss AS 6.0.0.Final or GlassFish 3.1, though
it should work on any server that is Java EE 6 compliant.
NOTE:
@@ -35,7 +35,7 @@
NOTE:
Prior to JBoss AS 6.0.0.CR1, modifications were required to get JAX-RS working
- properly on JBoss AS. We strongly recommend upgrading to 6.0.0.CR1.
+ properly on JBoss AS. We strongly recommend upgrading to 6.0.0.Final.
With the prerequisites out of the way, you're ready to build and deploy.
@@ -66,7 +66,7 @@
<activeByDefault>true</activeByDefault>
</activation>
<properties>
- <jboss.home>/path/to/jboss-as-6.0.0.M4</jboss.home>
+ <jboss.home>/path/to/jboss-as-6.0.0.Final</jboss.home>
</properties>
</profile>
</profiles>
@@ -90,7 +90,7 @@
You can also set jboss.home on the commandline:
- mvn package jboss:hard-deploy -Djboss.home=/path/to/jboss-as-6.0.0.M4
+ mvn package jboss:hard-deploy -Djboss.home=/path/to/jboss-as-6.0.0.Final
In all, you have three options to set the path of your JBoss AS installation:
Modified: archetypes/javaee6-webapp/trunk/src/main/java/com/mycompany/data/SeedDataImporter.java
===================================================================
--- archetypes/javaee6-webapp/trunk/src/main/java/com/mycompany/data/SeedDataImporter.java 2011-01-19 22:31:59 UTC (rev 7184)
+++ archetypes/javaee6-webapp/trunk/src/main/java/com/mycompany/data/SeedDataImporter.java 2011-01-20 07:19:45 UTC (rev 7185)
@@ -1,7 +1,5 @@
package com.mycompany.data;
-import org.jboss.seam.solder.log.Category;
-import com.mycompany.model.Member;
import javax.annotation.PostConstruct;
import javax.ejb.Singleton;
import javax.ejb.Startup;
@@ -11,12 +9,18 @@
import javax.transaction.UserTransaction;
import org.jboss.logging.Logger;
+import org.jboss.seam.solder.log.Category;
+import com.mycompany.model.Member;
+
/**
- * Import seed data into the database on application startup using
- * a startup singleton EJB.
+ * Import seed data into the database on application startup.
*
- * FIXME Better would be to make this a ServletContextListener (first verify it works on all containers)
+ * <p>Observes the context initialized event and loads seed data
+ * into the database using JPA.</p>
+ *
+ * <p>As an alternative, you can perform the data loading by observing the context
+ * initialized event of a ServletContextListener</p>
*
* @author Dan Allen
*/
Deleted: archetypes/javaee6-webapp/trunk/src/main/resources-jbossas/application-ds.xml
===================================================================
--- archetypes/javaee6-webapp/trunk/src/main/resources-jbossas/application-ds.xml 2011-01-19 22:31:59 UTC (rev 7184)
+++ archetypes/javaee6-webapp/trunk/src/main/resources-jbossas/application-ds.xml 2011-01-20 07:19:45 UTC (rev 7185)
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE datasources PUBLIC "-//JBoss//DTD JBOSS JCA Config 1.5//EN"
- "http://www.jboss.org/j2ee/dtd/jboss-ds_1_5.dtd">
-<datasources>
- <local-tx-datasource>
- <jndi-name>jdbc/__default</jndi-name>
- <use-java-context>false</use-java-context>
- <connection-url>jdbc:hsqldb:.</connection-url>
- <driver-class>org.hsqldb.jdbcDriver</driver-class>
- <user-name>sa</user-name>
- <password></password>
- <min-pool-size>5</min-pool-size>
- <max-pool-size>20</max-pool-size>
- </local-tx-datasource>
-</datasources>
Copied: archetypes/javaee6-webapp/trunk/src/main/resources-jbossas/default-ds.xml (from rev 7184, archetypes/javaee6-webapp/trunk/src/main/resources-jbossas/application-ds.xml)
===================================================================
--- archetypes/javaee6-webapp/trunk/src/main/resources-jbossas/default-ds.xml (rev 0)
+++ archetypes/javaee6-webapp/trunk/src/main/resources-jbossas/default-ds.xml 2011-01-20 07:19:45 UTC (rev 7185)
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE datasources PUBLIC "-//JBoss//DTD JBOSS JCA Config 1.5//EN"
+ "http://www.jboss.org/j2ee/dtd/jboss-ds_1_5.dtd">
+<datasources>
+ <local-tx-datasource>
+ <jndi-name>jdbc/__default</jndi-name>
+ <use-java-context>false</use-java-context>
+ <connection-url>jdbc:hsqldb:.</connection-url>
+ <driver-class>org.hsqldb.jdbcDriver</driver-class>
+ <user-name>sa</user-name>
+ <password></password>
+ <min-pool-size>5</min-pool-size>
+ <max-pool-size>20</max-pool-size>
+ </local-tx-datasource>
+</datasources>