Author: dan.j.allen
Date: 2010-06-20 02:34:46 -0400 (Sun, 20 Jun 2010)
New Revision: 6568
Added:
archetypes/trunk/jsf-weld-servlet-webapp/
archetypes/trunk/jsf-weld-servlet-webapp/archetype-pom.xml
archetypes/trunk/jsf-weld-servlet-webapp/archetype.properties
archetypes/trunk/jsf-weld-servlet-webapp/build.sh
archetypes/trunk/jsf-weld-servlet-webapp/pom.xml
archetypes/trunk/jsf-weld-servlet-webapp/readme.txt
archetypes/trunk/jsf-weld-servlet-webapp/src/
archetypes/trunk/jsf-weld-servlet-webapp/src/main/
archetypes/trunk/jsf-weld-servlet-webapp/src/main/java/
archetypes/trunk/jsf-weld-servlet-webapp/src/main/java/com/
archetypes/trunk/jsf-weld-servlet-webapp/src/main/java/com/mycompany/
archetypes/trunk/jsf-weld-servlet-webapp/src/main/java/com/mycompany/HelloWorld.java
archetypes/trunk/jsf-weld-servlet-webapp/src/main/resources/
archetypes/trunk/jsf-weld-servlet-webapp/src/main/resources/META-INF/
archetypes/trunk/jsf-weld-servlet-webapp/src/main/resources/META-INF/beans.xml
archetypes/trunk/jsf-weld-servlet-webapp/src/main/webapp/
archetypes/trunk/jsf-weld-servlet-webapp/src/main/webapp/META-INF/
archetypes/trunk/jsf-weld-servlet-webapp/src/main/webapp/META-INF/context.xml
archetypes/trunk/jsf-weld-servlet-webapp/src/main/webapp/WEB-INF/
archetypes/trunk/jsf-weld-servlet-webapp/src/main/webapp/WEB-INF/faces-config.xml
archetypes/trunk/jsf-weld-servlet-webapp/src/main/webapp/WEB-INF/templates/
archetypes/trunk/jsf-weld-servlet-webapp/src/main/webapp/WEB-INF/templates/default.xhtml
archetypes/trunk/jsf-weld-servlet-webapp/src/main/webapp/WEB-INF/web.xml
archetypes/trunk/jsf-weld-servlet-webapp/src/main/webapp/home.xhtml
archetypes/trunk/jsf-weld-servlet-webapp/src/main/webapp/index.jsp
archetypes/trunk/jsf-weld-servlet-webapp/src/main/webapp/resources/
archetypes/trunk/jsf-weld-servlet-webapp/src/main/webapp/resources/css/
archetypes/trunk/jsf-weld-servlet-webapp/src/main/webapp/resources/css/screen.css
archetypes/trunk/jsf-weld-servlet-webapp/src/main/webapp/resources/gfx/
archetypes/trunk/jsf-weld-servlet-webapp/src/main/webapp/resources/gfx/banner.png
archetypes/trunk/jsf-weld-servlet-webapp/src/main/webapp/resources/gfx/weld.png
archetypes/trunk/jsf-weld-servlet-webapp/src/test/
archetypes/trunk/jsf-weld-servlet-webapp/src/test/java/
archetypes/trunk/jsf-weld-servlet-webapp/src/test/java/com/
archetypes/trunk/jsf-weld-servlet-webapp/src/test/java/com/mycompany/
archetypes/trunk/jsf-weld-servlet-webapp/src/test/java/com/mycompany/BeanManagerTest.java
archetypes/trunk/jsf-weld-servlet-webapp/src/test/java/com/mycompany/HelloWorldTest.java
archetypes/trunk/jsf-weld-servlet-webapp/src/test/resources/
archetypes/trunk/jsf-weld-servlet-webapp/src/test/resources/jetty-env.xml
archetypes/trunk/jsf-weld-servlet-webapp/target/
archetypes/trunk/jsf-weld-servlet-webapp/target/archetype/
archetypes/trunk/jsf-weld-servlet-webapp/target/archetype/pom.xml
archetypes/trunk/jsf-weld-servlet-webapp/target/archetype/src/
archetypes/trunk/jsf-weld-servlet-webapp/target/archetype/src/main/
archetypes/trunk/jsf-weld-servlet-webapp/target/archetype/src/main/resources/
archetypes/trunk/jsf-weld-servlet-webapp/target/archetype/src/main/resources/META-INF/
archetypes/trunk/jsf-weld-servlet-webapp/target/archetype/src/main/resources/META-INF/maven/
archetypes/trunk/jsf-weld-servlet-webapp/target/archetype/src/main/resources/META-INF/maven/archetype-metadata.xml
archetypes/trunk/jsf-weld-servlet-webapp/target/archetype/src/main/resources/archetype-resources/
archetypes/trunk/jsf-weld-servlet-webapp/target/archetype/src/main/resources/archetype-resources/pom.xml
archetypes/trunk/jsf-weld-servlet-webapp/target/archetype/src/main/resources/archetype-resources/readme.txt
archetypes/trunk/jsf-weld-servlet-webapp/target/archetype/src/main/resources/archetype-resources/src/
archetypes/trunk/jsf-weld-servlet-webapp/target/archetype/src/main/resources/archetype-resources/src/main/
archetypes/trunk/jsf-weld-servlet-webapp/target/archetype/src/main/resources/archetype-resources/src/main/java/
archetypes/trunk/jsf-weld-servlet-webapp/target/archetype/src/main/resources/archetype-resources/src/main/java/HelloWorld.java
archetypes/trunk/jsf-weld-servlet-webapp/target/archetype/src/main/resources/archetype-resources/src/main/resources/
archetypes/trunk/jsf-weld-servlet-webapp/target/archetype/src/main/resources/archetype-resources/src/main/resources/META-INF/
archetypes/trunk/jsf-weld-servlet-webapp/target/archetype/src/main/resources/archetype-resources/src/main/resources/META-INF/beans.xml
archetypes/trunk/jsf-weld-servlet-webapp/target/archetype/src/main/resources/archetype-resources/src/main/webapp/
archetypes/trunk/jsf-weld-servlet-webapp/target/archetype/src/main/resources/archetype-resources/src/main/webapp/META-INF/
archetypes/trunk/jsf-weld-servlet-webapp/target/archetype/src/main/resources/archetype-resources/src/main/webapp/META-INF/context.xml
archetypes/trunk/jsf-weld-servlet-webapp/target/archetype/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/
archetypes/trunk/jsf-weld-servlet-webapp/target/archetype/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/faces-config.xml
archetypes/trunk/jsf-weld-servlet-webapp/target/archetype/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/templates/
archetypes/trunk/jsf-weld-servlet-webapp/target/archetype/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/templates/default.xhtml
archetypes/trunk/jsf-weld-servlet-webapp/target/archetype/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml
archetypes/trunk/jsf-weld-servlet-webapp/target/archetype/src/main/resources/archetype-resources/src/main/webapp/home.xhtml
archetypes/trunk/jsf-weld-servlet-webapp/target/archetype/src/main/resources/archetype-resources/src/main/webapp/index.jsp
archetypes/trunk/jsf-weld-servlet-webapp/target/archetype/src/main/resources/archetype-resources/src/main/webapp/resources/
archetypes/trunk/jsf-weld-servlet-webapp/target/archetype/src/main/resources/archetype-resources/src/main/webapp/resources/css/
archetypes/trunk/jsf-weld-servlet-webapp/target/archetype/src/main/resources/archetype-resources/src/main/webapp/resources/css/screen.css
archetypes/trunk/jsf-weld-servlet-webapp/target/archetype/src/main/resources/archetype-resources/src/main/webapp/resources/gfx/
archetypes/trunk/jsf-weld-servlet-webapp/target/archetype/src/main/resources/archetype-resources/src/main/webapp/resources/gfx/banner.png
archetypes/trunk/jsf-weld-servlet-webapp/target/archetype/src/main/resources/archetype-resources/src/main/webapp/resources/gfx/weld.png
archetypes/trunk/jsf-weld-servlet-webapp/target/archetype/src/main/resources/archetype-resources/src/test/
archetypes/trunk/jsf-weld-servlet-webapp/target/archetype/src/main/resources/archetype-resources/src/test/java/
archetypes/trunk/jsf-weld-servlet-webapp/target/archetype/src/main/resources/archetype-resources/src/test/java/BeanManagerTest.java
archetypes/trunk/jsf-weld-servlet-webapp/target/archetype/src/main/resources/archetype-resources/src/test/java/HelloWorldTest.java
archetypes/trunk/jsf-weld-servlet-webapp/target/archetype/src/main/resources/archetype-resources/src/test/resources/
archetypes/trunk/jsf-weld-servlet-webapp/target/archetype/src/main/resources/archetype-resources/src/test/resources/jetty-env.xml
archetypes/trunk/jsf-weld-servlet-webapp/target/archetype/src/test/
archetypes/trunk/jsf-weld-servlet-webapp/target/archetype/src/test/resources/
archetypes/trunk/jsf-weld-servlet-webapp/target/archetype/src/test/resources/projects/
archetypes/trunk/jsf-weld-servlet-webapp/target/archetype/src/test/resources/projects/basic/
archetypes/trunk/jsf-weld-servlet-webapp/target/archetype/src/test/resources/projects/basic/archetype.properties
archetypes/trunk/jsf-weld-servlet-webapp/target/archetype/src/test/resources/projects/basic/goal.txt
Log:
initial import
Added: archetypes/trunk/jsf-weld-servlet-webapp/archetype-pom.xml
===================================================================
--- archetypes/trunk/jsf-weld-servlet-webapp/archetype-pom.xml
(rev 0)
+++ archetypes/trunk/jsf-weld-servlet-webapp/archetype-pom.xml 2010-06-20 06:34:46 UTC
(rev 6568)
@@ -0,0 +1,80 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project
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/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.jboss.weld</groupId>
+ <artifactId>weld-parent</artifactId>
+ <version>11</version>
+ </parent>
+
+ <groupId>org.jboss.weld.archetypes</groupId>
+ <artifactId>jboss-jsf-weld-servlet-webapp</artifactId>
+ <version>1.0.1-SNAPSHOT</version>
+ <packaging>maven-archetype</packaging>
+
+ <name>JBoss CDI and JSF Servlet Webapp</name>
+
+ <description>An archetype that generates a basic JSF Servlet webapp project with
CDI capabilities</description>
+
+
<
url>http://seamframework.org/Documentation/WeldQuickstartForMavenUsers...
+
+ <developers>
+ <developer>
+ <name>Steven Boscarine</name>
+ <roles>
+ <role>Weld archetypes lead</role>
+ </roles>
+ <email>steven.boscarine(a)childrens.harvard.edu</email>
+ <organization>Children's Hospital Boston: Informatics
Program</organization>
+ <
organizationUrl>http://chip.org/</organizationUrl>
+ <
url>http://info.rmatics.org/</url>
+ </developer>
+ <developer>
+ <name>Dan Allen</name>
+ <roles>
+ <role>Weld archetypes lead</role>
+ </roles>
+ <email>dan.j.allen(a)gmail.com</email>
+ <organization>JBoss, by Red Hat</organization>
+ <
organizationUrl>http://redhat.com/jboss</organizationUrl>
+ <
url>http://community.jboss.org/people/dan.j.allen</url>
+ </developer>
+ <developer>
+ <name>Pete Muir</name>
+ <roles>
+ <role>Weld project lead</role>
+ </roles>
+ <email>pete.muir(a)jboss.org</email>
+ <organization>Red Hat Inc.</organization>
+ <
organizationUrl>http://redhat.com/jboss</organizationUrl>
+ <url>http://in.relation.to/Bloggers/Pete</url>
+ </developer>
+ </developers>
+
+ <build>
+ <extensions>
+ <extension>
+ <groupId>org.apache.maven.archetype</groupId>
+ <artifactId>archetype-packaging</artifactId>
+ <version>2.0-alpha-5</version>
+ </extension>
+ </extensions>
+
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <artifactId>maven-archetype-plugin</artifactId>
+ <version>2.0-alpha-5</version>
+ <extensions>true</extensions>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+
+ <scm>
+
<
connection>scm:svn:http://anonsvn.jboss.org/repos/weld/archetypes/trun...
+
<
developerConnection>scm:svn:https://svn.jboss.org/repos/weld/archetype...
+
<
url>http://fisheye.jboss.org/browse/weld/archetypes/trunk/jsf-weld-ser...
+ </scm>
+</project>
Added: archetypes/trunk/jsf-weld-servlet-webapp/archetype.properties
===================================================================
--- archetypes/trunk/jsf-weld-servlet-webapp/archetype.properties
(rev 0)
+++ archetypes/trunk/jsf-weld-servlet-webapp/archetype.properties 2010-06-20 06:34:46 UTC
(rev 6568)
@@ -0,0 +1,8 @@
+archetype.groupId=org.jboss.weld.archetypes
+archetype.artifactId=jboss-jsf-weld-servlet-webapp
+archetype.version=1.0.1-SNAPSHOT
+#archetype.package=com.acme.webapp
+archetype.languages=java
+# value of <artifactId> is converted to ${artifactId} expression in filtered files
+archetype.filteredExtensions=java,txt
+name=JSF and CDI webapp
Added: archetypes/trunk/jsf-weld-servlet-webapp/build.sh
===================================================================
--- archetypes/trunk/jsf-weld-servlet-webapp/build.sh (rev 0)
+++ archetypes/trunk/jsf-weld-servlet-webapp/build.sh 2010-06-20 06:34:46 UTC (rev 6568)
@@ -0,0 +1,41 @@
+#!/bin/sh
+
+ARCHETYPE_BUILD_DIR=target/generated-sources/archetype
+ARCHETYPE_DIR=target/archetype
+ARCHETYPE_RESOURCES_DIR=$ARCHETYPE_DIR/src/main/resources/archetype-resources
+
+echo Generating archetype from project into $ARCHETYPE_BUILD_DIR...
+rm -Rf $ARCHETYPE_DIR/target
+#svn rm --force $ARCHETYPE_DIR/*
+rm -Rf target/generated-*
+mvn archetype:create-from-project -Darchetype.properties=archetype.properties
+echo Relocating generated archetype project to $ARCHETYPE_DIR...
+rsync -az --exclude `basename $0` --exclude archetype-pom.xml $ARCHETYPE_BUILD_DIR/src
$ARCHETYPE_DIR/
+#svn revert -R $ARCHETYPE_DIR
+cp -f archetype-pom.xml $ARCHETYPE_DIR/pom.xml
+mvn -f $ARCHETYPE_DIR/pom.xml clean
+echo Patching generated archetype...
+# could also use col -b
+sed -i 's;
+;;' $ARCHETYPE_RESOURCES_DIR/pom.xml
+sed -i 's;
+;;' $ARCHETYPE_RESOURCES_DIR/readme.txt
+sed -i
's;<name>jboss-jsf-weld-servlet-webapp-src</name>;<name>${name}</name>;'
$ARCHETYPE_RESOURCES_DIR/pom.xml
+if [ ! -z $1 ] && [ "$1" = "install" ]; then
+ echo Installing archetype...
+ shift
+ mvn -f $ARCHETYPE_DIR/pom.xml install
+fi
+
+if [ ! -z $1 ] && [ "$1" = "generate" ]; then
+ echo Generating project from archetype...
+ cd target
+ mvn archetype:generate -B -DarchetypeCatalog=local \
+ -DarchetypeArtifactId=jboss-jsf-weld-webapp
-DarchetypeGroupId=org.jboss.weld.archetypes -DarchetypeVersion=1.0.1-SNAPSHOT \
+ -DartifactId=generated-project -DgroupId=com.acme -Dversion=1.0.0-SNAPSHOT
-Dname="JSF and CDI Webapp"
+fi
+
+#cd target/archetype
+#mvn release:prepare --batch-mode -Drelease -DdevelopmentVersion=1.0.1-SNAPSHOT
-DreleaseVersion=1.0.1.Beta1 -Dtag=basic-javaee6-webapp-1.0.1.Beta1 -DdryRun=true
+#mvn release:prepare --batch-mode -Drelease -DdevelopmentVersion=1.0.1-SNAPSHOT
-DreleaseVersion=1.0.1.Beta1 -Dtag=basic-javaee6-webapp-1.0.1.Beta1 -Dresume=false
+#mvn release:perform nexus:staging-close -Drelease
Property changes on: archetypes/trunk/jsf-weld-servlet-webapp/build.sh
___________________________________________________________________
Name: svn:executable
+ *
Added: archetypes/trunk/jsf-weld-servlet-webapp/pom.xml
===================================================================
--- archetypes/trunk/jsf-weld-servlet-webapp/pom.xml (rev 0)
+++ archetypes/trunk/jsf-weld-servlet-webapp/pom.xml 2010-06-20 06:34:46 UTC (rev 6568)
@@ -0,0 +1,244 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project
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/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.jboss.weld.archetypes</groupId>
+ <artifactId>jboss-jsf-weld-servlet-webapp-src</artifactId>
+ <version>1.0.1-SNAPSHOT</version>
+ <packaging>war</packaging>
+
+ <name>jboss-jsf-weld-servlet-webapp-src</name>
+ <description>A basic JSF and CDI webapp project for servlet containers generated
from the jboss-jsf-weld-servlet-webapp archetype</description>
+
+ <properties>
+ <!--
+ Explicitly declaring the source encoding eliminates the following message:
+ [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources,
i.e. build is platform dependent!
+ -->
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <weld-servlet.version>1.0.1-Final</weld-servlet.version>
+ <arquillian.version>1.0.0-SNAPSHOT</arquillian.version>
+ </properties>
+
+ <repositories>
+ <!-- The JBoss public Nexus repository is a composite repository of several
major repositories -->
+ <!-- see
http://community.jboss.org/wiki/MavenGettingStarted-Users -->
+ <!-- The goal is to get everything you would need into the central, but it's
not there yet -->
+ <repository>
+ <id>jboss-public-repository</id>
+ <name>JBoss Repository</name>
+ <
url>https://repository.jboss.org/nexus/content/groups/public</url>
+ <releases>
+ <enabled>true</enabled>
+ <updatePolicy>never</updatePolicy>
+ </releases>
+ <snapshots>
+ <enabled>true</enabled>
+ <updatePolicy>daily</updatePolicy>
+ </snapshots>
+ </repository>
+ </repositories>
+
+ <pluginRepositories>
+ <pluginRepository>
+ <id>jboss-public-repository</id>
+ <name>JBoss Repository</name>
+ <
url>https://repository.jboss.org/nexus/content/groups/public</url>
+ <releases>
+ <enabled>true</enabled>
+ <updatePolicy>never</updatePolicy>
+ </releases>
+ <snapshots>
+ <enabled>false</enabled>
+ <updatePolicy>daily</updatePolicy>
+ </snapshots>
+ </pluginRepository>
+ </pluginRepositories>
+
+ <dependencyManagement>
+ <dependencies>
+ <!-- Import scope will provide versions for dependencies below. -->
+ <dependency>
+ <groupId>org.jboss.weld.servlet</groupId>
+ <artifactId>weld-servlet-parent</artifactId>
+ <version>${weld-servlet.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
+ <dependencies>
+
+ <!-- Common to JEE and Servlet containers -->
+ <dependency>
+ <groupId>javax.enterprise</groupId>
+ <artifactId>cdi-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.annotation</groupId>
+ <artifactId>jsr250-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <!-- JSF 2.0 API -->
+ <dependency>
+ <groupId>javax.faces</groupId>
+ <artifactId>jsf-api</artifactId>
+ <version>2.0.2-FCS</version>
+ </dependency>
+
+ <!-- Jetty/Tomcat-specific scopes and artifacts -->
+
+ <!-- JSF 2.0 -->
+ <dependency>
+ <groupId>javax.faces</groupId>
+ <artifactId>jsf-impl</artifactId>
+ <scope>runtime</scope>
+ <version>2.0.2-FCS</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.weld.servlet</groupId>
+ <artifactId>weld-servlet</artifactId>
+ <scope>runtime</scope>
+ </dependency>
+
+ <!--
+ <dependency>
+ <groupId>org.glassfish.web</groupId>
+ <artifactId>el-impl</artifactId>
+ <scope>runtime</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>javax.el</groupId>
+ <artifactId>el-api</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ -->
+ <!-- end Jetty/Tomcat-specific scopes and artifacts -->
+
+ <!-- Bean Validation API (JSR 303) -->
+ <dependency>
+ <groupId>javax.validation</groupId>
+ <artifactId>validation-api</artifactId>
+ </dependency>
+
+ <!-- Bean Validation Implementation -->
+ <!-- Provides portable constraints such as @NotEmpty, @Email and @Url -->
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-validator</artifactId>
+ <version>4.0.0.GA</version>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.8.1</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.arquillian</groupId>
+ <artifactId>arquillian-junit</artifactId>
+ <version>${arquillian.version}</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <finalName>jboss-jsf-weld-servlet-webapp-src</finalName>
+ <plugins>
+ <!-- Compiler plugin enforces Java 1.5 compatibility -->
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>2.3.1</version>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+
+ <!-- Embedded Jetty (jetty:run) -->
+ <plugin>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>maven-jetty-plugin</artifactId>
+ <version>6.1.24</version>
+ <configuration>
+ <!-- Delete this block to have Jetty run default port (8080) -->
+ <connectors>
+ <connector
implementation="org.mortbay.jetty.nio.SelectChannelConnector">
+ <port>9090</port>
+ </connector>
+ </connectors>
+ <!-- force friendly name instead of artifact name + version -->
+ <contextPath>${project.build.finalName}</contextPath>
+ <!-- Where the BeanManager is constructed. This is where you'll
declare datasources. -->
+
<jettyEnvXml>${basedir}/src/test/resources/jetty-env.xml</jettyEnvXml>
+ <!-- This parameter will auto-deploy modified classes. -->
+ <!-- You can save changes in a file or class and refresh your browser
to view the changes. -->
+ <scanIntervalSeconds>3</scanIntervalSeconds>
+ </configuration>
+ </plugin>
+
+ <!-- Embedded Tomcat (package tomcat:run) -->
+ <!-- Standalone Tomcat (package tomcat:deploy) -->
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>tomcat-maven-plugin</artifactId>
+ <configuration>
+ <path>/${project.build.finalName}</path>
+ <!-- Embedded port -->
+ <port>9090</port>
+ <!--
+ The default authentication credentials for remote deployment are
username "admin" with no password To
+ override credentials, define a server in settings.xml and activate it
using the <server> element
+ -->
+ <url>http://localhost:9090/manager</url>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <profiles>
+ <profile>
+ <id>weld-embedded</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.arquillian.container</groupId>
+ <artifactId>arquillian-weld-embedded</artifactId>
+ <version>${arquillian.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.weld</groupId>
+ <artifactId>weld-core</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.weld</groupId>
+ <artifactId>weld-api</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-simple</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.el</groupId>
+ <artifactId>el-api</artifactId>
+ <version>2.2</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ </profile>
+ </profiles>
+</project>
Added: archetypes/trunk/jsf-weld-servlet-webapp/readme.txt
===================================================================
--- archetypes/trunk/jsf-weld-servlet-webapp/readme.txt (rev 0)
+++ archetypes/trunk/jsf-weld-servlet-webapp/readme.txt 2010-06-20 06:34:46 UTC (rev
6568)
@@ -0,0 +1,101 @@
+
+ jboss-jsf-weld-servlet-webapp-src
+
+ Source archetype: jboss-jsf-weld-servlet-webapp
+
+ What is it?
+ ===========
+
+ This is your project! It's a barebones, deployable Maven 2 project to help you
+ get your foot in the door developing with Java EE 6. Specifically, this
+ project is setup to allow you to create a JSF 2.0 and CDI 1.0 application that
+ can run on Servlet Containers like Tomcat 6 and Jetty 6. You may be satisfied
+ with this combination in the long run, or you may eventually migrate to a true
+ Java EE 6 environment to leverage EJB 3.1, JPA 2.0 and other platform
+ technologies.
+
+ System requirements
+ ===================
+
+ All you need to run this project is Java 5.0 (Java SDK 1.5) or greator and
+ Maven 2.0.10 or greater. This application is setup to be run on a Servlet
+ Container. The embedded Jetty and Tomcat containers get downloaded
+ automatically by the Maven commands.
+
+ If you want to deploy the application to a standalone Servlet Container, then
+ you will need to set one up.
+
+ Please note that Maven 2 project needs to use the JBoss Maven repository
+ because there are certain Java EE API JARs that are not yet publised to the
+ Maven Central Repository (see
https://jira.jboss.org/jira/browse/WELD-222)
+
+ Deploying the application
+ =========================
+
+ You can deploy the application without moving any files around using the
+ embedded Jetty or Tomcat containers.
+
+ To run the application using embedded Jetty, execute this command:
+
+ mvn jetty:run
+
+ To run the application using embedded Tomcat, execute this command:
+
+ mvn compile tomcat:run
+
+ The application will be running at the following URL:
+
+
http://localhost:9090/jboss-jsf-weld-servlet-webapp-src
+
+ To run the application on a standalone container, first execute this command:
+
+ mvn package
+
+ Then copy the archive target/jboss-jsf-weld-servlet-webapp.war to the hot deploy
directory of
+ the container (e.g., the webapps directory of Tomcat). Of course, you also
+ need to start the container.
+
+ Importing the project into an IDE
+ =================================
+
+ If you created the project using the Maven 2 archetype wizard in your IDE
+ (Eclipse, NetBeans or IntelliJ IDEA), then there is nothing to do. You should
+ already have an IDE project.
+
+ If you created the project from the commandline using archetype:generate, then
+ you need to bring the project into your IDE. If you are using NetBeans 6.8 or
+ IntelliJ IDEA 9, then all you have to do is open the project as an existing
+ project. Both of these IDEs recognize Maven 2 projects natively.
+
+ To import into Eclipse, you first need to install the m2eclipse plugin. To get
+ started, add the m2eclipse update site (
http://m2eclipse.sonatype.org/update/)
+ to Eclipse and install the m2eclipse plugin and required dependencies. Once
+ that is installed, you'll be ready to import the project into Eclipse.
+
+ Select File > Import... and select "Import... > Maven Projects" and
select
+ your project directory. m2eclipse should take it from there.
+
+ Once in the IDE, you can execute the Maven commands through the IDE controls
+ to run the application on an embedded Servlet Container.
+
+ Downloading the sources and Javadocs
+ ====================================
+
+ If you want to be able to debug into the source code or look at the Javadocs
+ of any library in the project, you can run either of the following two
+ commands to pull them into your local repository. The IDE should then detect
+ them.
+
+ mvn dependency:sources
+ mvn dependency:resolve -Dclassifier=javadoc
+
+ Resources
+ =========
+
+ Weld archetypes:
+ - Quickstart:
http://seamframework.org/Documentation/WeldQuickstartForMavenUsers
+ - Issue tracker:
https://jira.jboss.org/jira/browse/WELDRAD
+ - Source code:
http://anonsvn.jboss.org/repos/weld/archetypes
+ - Forums:
http://seamframework.org/Community/WeldUsers
+ JSR-299 overview:
http://seamframework.org/Weld
+ JSF community site:
http://www.javaserverfaces.org
Added:
archetypes/trunk/jsf-weld-servlet-webapp/src/main/java/com/mycompany/HelloWorld.java
===================================================================
--- archetypes/trunk/jsf-weld-servlet-webapp/src/main/java/com/mycompany/HelloWorld.java
(rev 0)
+++
archetypes/trunk/jsf-weld-servlet-webapp/src/main/java/com/mycompany/HelloWorld.java 2010-06-20
06:34:46 UTC (rev 6568)
@@ -0,0 +1,74 @@
+package com.mycompany;
+
+import javax.annotation.PostConstruct;
+import javax.enterprise.inject.Model;
+import javax.validation.constraints.Digits;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Pattern;
+
+import org.hibernate.validator.constraints.Email;
+import org.hibernate.validator.constraints.NotEmpty;
+
+public @Model class HelloWorld
+{
+ private final String text = "Hello, World!";
+
+ private String letters;
+
+ private String numbers;
+
+ private String email;
+
+ public HelloWorld() {}
+
+ @PostConstruct
+ public void initialize()
+ {
+ System.out.println(this.getClass().getSimpleName() + " was
constructed");
+ }
+
+ public String getText()
+ {
+ return text;
+ }
+
+ @NotNull
+ @NotEmpty
+ @Pattern(regexp = "[A-Za-z]*", message = "must contain only
letters")
+ public String getLetters()
+ {
+ return letters;
+ }
+
+ public void setLetters(String letters)
+ {
+ this.letters = letters;
+ }
+
+ @NotNull
+ @NotEmpty
+ @Digits(fraction = 0, integer = 2)
+ public String getNumbers()
+ {
+ return numbers;
+ }
+
+ public void setNumbers(String numbers)
+ {
+ this.numbers = numbers;
+ }
+
+ @NotNull
+ @NotEmpty
+ @Email
+ public String getEmail()
+ {
+ return email;
+ }
+
+ public void setEmail(String email)
+ {
+ this.email = email;
+ }
+
+}
Added: archetypes/trunk/jsf-weld-servlet-webapp/src/main/resources/META-INF/beans.xml
===================================================================
--- archetypes/trunk/jsf-weld-servlet-webapp/src/main/resources/META-INF/beans.xml
(rev 0)
+++
archetypes/trunk/jsf-weld-servlet-webapp/src/main/resources/META-INF/beans.xml 2010-06-20
06:34:46 UTC (rev 6568)
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ The contents of this file is permitted to be empty.
+ The schema definition is provided for your convenience.
+-->
+<beans
xmlns="http://java.sun.com/xml/ns/javaee"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+
http://java.sun.com/xml/ns/javaee
+
http://java.sun.com/xml/ns/javaee/beans_1_0.xsd">
+</beans>
Added: archetypes/trunk/jsf-weld-servlet-webapp/src/main/webapp/META-INF/context.xml
===================================================================
--- archetypes/trunk/jsf-weld-servlet-webapp/src/main/webapp/META-INF/context.xml
(rev 0)
+++
archetypes/trunk/jsf-weld-servlet-webapp/src/main/webapp/META-INF/context.xml 2010-06-20
06:34:46 UTC (rev 6568)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Context>
+ <!-- disable storage of sessions across restarts -->
+ <Manager pathname=""/>
+ <Resource name="BeanManager" auth="Container"
type="javax.enterprise.inject.spi.BeanManager"
factory="org.jboss.weld.resources.ManagerObjectFactory"/>
+ <!-- Uncomment to enable injection into Servlets, Servlet Listeners and Filters in
Tomcat -->
+ <!-- <Listener
className="org.jboss.weld.environment.tomcat.WeldLifecycleListener"/> -->
+</Context>
Added: archetypes/trunk/jsf-weld-servlet-webapp/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- archetypes/trunk/jsf-weld-servlet-webapp/src/main/webapp/WEB-INF/faces-config.xml
(rev 0)
+++
archetypes/trunk/jsf-weld-servlet-webapp/src/main/webapp/WEB-INF/faces-config.xml 2010-06-20
06:34:46 UTC (rev 6568)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- This file is not required if you don't need any extra configuration. -->
+<faces-config version="2.0"
+
xmlns="http://java.sun.com/xml/ns/javaee"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+
http://java.sun.com/xml/ns/javaee
+
http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd">
+
+ <!-- Write your navigation rules here. You should use CDI for creating @Named
managed beans! -->
+
+</faces-config>
Added:
archetypes/trunk/jsf-weld-servlet-webapp/src/main/webapp/WEB-INF/templates/default.xhtml
===================================================================
---
archetypes/trunk/jsf-weld-servlet-webapp/src/main/webapp/WEB-INF/templates/default.xhtml
(rev 0)
+++
archetypes/trunk/jsf-weld-servlet-webapp/src/main/webapp/WEB-INF/templates/default.xhtml 2010-06-20
06:34:46 UTC (rev 6568)
@@ -0,0 +1,52 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:ui="http://java.sun.com/jsf/facelets">
+ <h:head>
+ <title>CDI and JSF 2 Starter Application</title>
+ <meta http-equiv="Content-Type" content="text/html;
charset=utf-8" />
+ <h:outputStylesheet name="css/screen.css"/>
+ </h:head>
+ <h:body>
+ <div id="container">
+ <div id="content">
+ <div id="sidebar">
+ <h3>Find out more</h3>
+ <p>
+ Explore JavaServer Faces.
+ </p>
+ <ul>
+ <li><a href="http://www.javaserverfaces.org">JSF
community site</a></li>
+ </ul>
+ <p>
+ Learn more about Java EE 6 and the extensions provided by Weld and
Seam.
+ </p>
+ <ul>
+ <li><a
href="http://seamframework.org/Weld/JSR299AndWeldOverview">O...
+ <li><a href="http://seamframework.org">Project
site</a></li>
+ <li><a
href="http://seamframework.org/Documentation/SeamDocumentation#H-Wel...
+ <li><a
href="http://seamframework.org/Community/Forums">User
forums</a></li>
+ <li><a
href="http://seamframework.org/Community/MailingLists">Mailing
lists</a></li>
+ <li><a
href="https://jira.jboss.org/jira/browse/WELD">Issue
tracker</a></li>
+ </ul>
+ <p>
+ If you have an add-on, please <a
href="http://seamframework.org/Community/Forums">let us know</a> and
+ consider <a
href="http://seamframework.org/Community/Contribute">contrib...
it back to the
+ community!
+ </p>
+ </div>
+ <ui:insert name="content">
+ [Template content will be inserted here]
+ </ui:insert>
+ </div>
+ <div id="footer">
+ <h:graphicImage value="/resources/gfx/weld.png" alt="Weld
logo"/>
+ <p>
+ This project was generated from a Maven archetype maintained by the Weld
team.<br/>
+ Weld is the reference implementation of CDI, released under the Apache
License, Version 2.0.<br/>
+ </p>
+ </div>
+ </div>
+ </h:body>
+</html>
Added: archetypes/trunk/jsf-weld-servlet-webapp/src/main/webapp/WEB-INF/web.xml
===================================================================
--- archetypes/trunk/jsf-weld-servlet-webapp/src/main/webapp/WEB-INF/web.xml
(rev 0)
+++ archetypes/trunk/jsf-weld-servlet-webapp/src/main/webapp/WEB-INF/web.xml 2010-06-20
06:34:46 UTC (rev 6568)
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app version="2.5"
+
xmlns="http://java.sun.com/xml/ns/javaee"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+
http://java.sun.com/xml/ns/javaee
+
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
+
+ <!-- Activate the JSF 2.0 servlet -->
+ <servlet>
+ <servlet-name>Faces Servlet</servlet-name>
+ <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+
+ <!-- Tell the context which URLs to send through JSF -->
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>*.jsf</url-pattern>
+ </servlet-mapping>
+
+ <!-- This is an optional parameter, but it makes troubleshooting errors much easier
-->
+ <!-- You are advised to remove this context parameter before a production
deployment -->
+ <context-param>
+ <param-name>javax.faces.PROJECT_STAGE</param-name>
+ <param-value>Development</param-value>
+ </context-param>
+
+ <!-- Weld Jetty/Tomcat specific configuration parameters -->
+ <!-- *** The <listener> and <resource-env-ref> elements can be deleted
when running in a Java EE 6 container *** -->
+ <listener>
+
<listener-class>org.jboss.weld.environment.servlet.Listener</listener-class>
+ </listener>
+
+ <resource-env-ref>
+ <description>Object factory for the CDI Bean Manager</description>
+ <resource-env-ref-name>BeanManager</resource-env-ref-name>
+
<resource-env-ref-type>javax.enterprise.inject.spi.BeanManager</resource-env-ref-type>
+ </resource-env-ref>
+
+</web-app>
Added: archetypes/trunk/jsf-weld-servlet-webapp/src/main/webapp/home.xhtml
===================================================================
--- archetypes/trunk/jsf-weld-servlet-webapp/src/main/webapp/home.xhtml
(rev 0)
+++ archetypes/trunk/jsf-weld-servlet-webapp/src/main/webapp/home.xhtml 2010-06-20
06:34:46 UTC (rev 6568)
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui:composition
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:h="http://java.sun.com/jsf/html"
+ template="/WEB-INF/templates/default.xhtml">
+ <ui:define name="content">
+ <h1>Hello World!</h1>
+ <p>Your CDI bean <code>HelloWorld</code> says <span
style="color: blue;">#{helloWorld.text}</span> using the Unified
EL.</p>
+
+ <h:form id="bv">
+ <h2>Bean Validation examples</h2>
+ <p>Enforces annotation-based constraints defined on the model
class.</p>
+ <table>
+ <tr>
+ <th style="text-align: right;">
+ <h:outputLabel for="letters"
value="Letters:"/>
+ </th>
+ <td>
+ <h:inputText id="letters"
value="#{helloWorld.letters}"/>
+ <h:message for="letters"
errorClass="invalid"/>
+ </td>
+ </tr>
+ <tr>
+ <th style="text-align: right;">
+ <h:outputLabel for="numbers"
value="Numbers:"/>
+ </th>
+ <td>
+ <h:inputText id="numbers"
value="#{helloWorld.numbers}"/>
+ <h:message for="numbers"
errorClass="invalid"/>
+ </td>
+ </tr>
+ <tr>
+ <th style="text-align: right;">
+ <h:outputLabel for="email" value="Email:"/>
+ </th>
+ <td>
+ <h:inputText id="email"
value="#{helloWorld.email}"/>
+ <h:message for="email"
errorClass="invalid"/>
+ </td>
+ </tr>
+ </table>
+ <p>
+ <h:commandButton id="check" value="Check values"/>
+ <h:outputText value=" All clear!"
rendered="#{facesContext.postback and empty facesContext.messageList}"
style="color: green;"/>
+ </p>
+ </h:form>
+ </ui:define>
+</ui:composition>
Added: archetypes/trunk/jsf-weld-servlet-webapp/src/main/webapp/index.jsp
===================================================================
--- archetypes/trunk/jsf-weld-servlet-webapp/src/main/webapp/index.jsp
(rev 0)
+++ archetypes/trunk/jsf-weld-servlet-webapp/src/main/webapp/index.jsp 2010-06-20 06:34:46
UTC (rev 6568)
@@ -0,0 +1 @@
+<% response.sendRedirect("home.jsf"); %>
Added: archetypes/trunk/jsf-weld-servlet-webapp/src/main/webapp/resources/css/screen.css
===================================================================
--- archetypes/trunk/jsf-weld-servlet-webapp/src/main/webapp/resources/css/screen.css
(rev 0)
+++
archetypes/trunk/jsf-weld-servlet-webapp/src/main/webapp/resources/css/screen.css 2010-06-20
06:34:46 UTC (rev 6568)
@@ -0,0 +1,39 @@
+body {
+ margin: 0;
+ padding: 0;
+ background-color: #EAECEE;
+ font-family: Verdana, sans-serif;
+ font-size: 0.9em;
+}
+#container {
+ margin: 0 auto;
+ padding: 0 20px 10px 20px;
+ border: 1px solid #666666;
+ width: 865px; /* subtract 40px from banner width for padding */
+ background: #FFFFFF url(#{request.contextPath}/resources/gfx/banner.png) no-repeat;
+ padding-top: 110px;
+}
+#sidebar {
+ font-size: 0.9em;
+ width: 225px;
+ float: right;
+ border: 1px solid #666666;
+ background: #EAECEE;
+ padding: 0 15px 5px 15px;
+}
+#sidebar ul {
+ padding-left: 30px;
+}
+#footer {
+ clear: both;
+ text-align: center;
+ color: #666666;
+ font-size: 0.85em;
+}
+code {
+ font-size: 1.1em;
+}
+span.invalid {
+ padding-left: 3px;
+ color: red;
+}
\ No newline at end of file
Added: archetypes/trunk/jsf-weld-servlet-webapp/src/main/webapp/resources/gfx/banner.png
===================================================================
(Binary files differ)
Property changes on:
archetypes/trunk/jsf-weld-servlet-webapp/src/main/webapp/resources/gfx/banner.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: archetypes/trunk/jsf-weld-servlet-webapp/src/main/webapp/resources/gfx/weld.png
===================================================================
(Binary files differ)
Property changes on:
archetypes/trunk/jsf-weld-servlet-webapp/src/main/webapp/resources/gfx/weld.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
archetypes/trunk/jsf-weld-servlet-webapp/src/test/java/com/mycompany/BeanManagerTest.java
===================================================================
---
archetypes/trunk/jsf-weld-servlet-webapp/src/test/java/com/mycompany/BeanManagerTest.java
(rev 0)
+++
archetypes/trunk/jsf-weld-servlet-webapp/src/test/java/com/mycompany/BeanManagerTest.java 2010-06-20
06:34:46 UTC (rev 6568)
@@ -0,0 +1,36 @@
+package com.mycompany;
+
+import javax.enterprise.inject.spi.BeanManager;
+import javax.inject.Inject;
+import static org.junit.Assert.*;
+import org.jboss.arquillian.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.spec.JavaArchive;
+import org.jboss.shrinkwrap.impl.base.asset.ByteArrayAsset;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+(a)RunWith(Arquillian.class)
+public class BeanManagerTest
+{
+ @Deployment
+ public static Archive<?> createTestArchive() {
+ return ShrinkWrap.create("test.jar", JavaArchive.class)
+ .addClass(HelloWorld.class)
+ .addManifestResource(new ByteArrayAsset(new byte[0]), "beans.xml");
+ }
+
+ @Inject BeanManager beanManager;
+
+ @Inject HelloWorld helloWorld;
+
+ @Test
+ public void testCdiBootstrap()
+ {
+ assertNotNull(beanManager);
+ assertFalse(beanManager.getBeans(BeanManager.class).isEmpty());
+ assertEquals("Hello, World!", helloWorld.getText());
+ }
+}
Added:
archetypes/trunk/jsf-weld-servlet-webapp/src/test/java/com/mycompany/HelloWorldTest.java
===================================================================
---
archetypes/trunk/jsf-weld-servlet-webapp/src/test/java/com/mycompany/HelloWorldTest.java
(rev 0)
+++
archetypes/trunk/jsf-weld-servlet-webapp/src/test/java/com/mycompany/HelloWorldTest.java 2010-06-20
06:34:46 UTC (rev 6568)
@@ -0,0 +1,13 @@
+package com.mycompany;
+
+import static org.junit.Assert.*;
+import org.junit.Test;
+
+public class HelloWorldTest
+{
+ @Test
+ public void testGetText() {
+ HelloWorld fixture = new HelloWorld();
+ assertEquals("Hello, World!", fixture.getText());
+ }
+}
Added: archetypes/trunk/jsf-weld-servlet-webapp/src/test/resources/jetty-env.xml
===================================================================
--- archetypes/trunk/jsf-weld-servlet-webapp/src/test/resources/jetty-env.xml
(rev 0)
+++ archetypes/trunk/jsf-weld-servlet-webapp/src/test/resources/jetty-env.xml 2010-06-20
06:34:46 UTC (rev 6568)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN"
"http://jetty.mortbay.org/configure.dtd">
+<Configure id="webAppCtx"
class="org.mortbay.jetty.webapp.WebAppContext">
+ <New id="beanManager"
class="org.mortbay.jetty.plus.naming.Resource">
+ <Arg>
+ <Ref id="webAppCtx"/>
+ </Arg>
+ <Arg>BeanManager</Arg>
+ <Arg>
+ <New class="javax.naming.Reference">
+ <Arg>javax.enterprise.inject.spi.BeanManager</Arg>
+ <Arg>org.jboss.weld.resources.ManagerObjectFactory</Arg>
+ <Arg/>
+ </New>
+ </Arg>
+ </New>
+</Configure>
Property changes on: archetypes/trunk/jsf-weld-servlet-webapp/target
___________________________________________________________________
Name: svn:ignore
+ generated-*
Added: archetypes/trunk/jsf-weld-servlet-webapp/target/archetype/pom.xml
===================================================================
--- archetypes/trunk/jsf-weld-servlet-webapp/target/archetype/pom.xml
(rev 0)
+++ archetypes/trunk/jsf-weld-servlet-webapp/target/archetype/pom.xml 2010-06-20 06:34:46
UTC (rev 6568)
@@ -0,0 +1,80 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project
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/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.jboss.weld</groupId>
+ <artifactId>weld-parent</artifactId>
+ <version>11</version>
+ </parent>
+
+ <groupId>org.jboss.weld.archetypes</groupId>
+ <artifactId>jboss-jsf-weld-servlet-webapp</artifactId>
+ <version>1.0.1-SNAPSHOT</version>
+ <packaging>maven-archetype</packaging>
+
+ <name>JBoss CDI and JSF Servlet Webapp</name>
+
+ <description>An archetype that generates a basic JSF Servlet webapp project with
CDI capabilities</description>
+
+
<
url>http://seamframework.org/Documentation/WeldQuickstartForMavenUsers...
+
+ <developers>
+ <developer>
+ <name>Steven Boscarine</name>
+ <roles>
+ <role>Weld archetypes lead</role>
+ </roles>
+ <email>steven.boscarine(a)childrens.harvard.edu</email>
+ <organization>Children's Hospital Boston: Informatics
Program</organization>
+ <
organizationUrl>http://chip.org/</organizationUrl>
+ <
url>http://info.rmatics.org/</url>
+ </developer>
+ <developer>
+ <name>Dan Allen</name>
+ <roles>
+ <role>Weld archetypes lead</role>
+ </roles>
+ <email>dan.j.allen(a)gmail.com</email>
+ <organization>JBoss, by Red Hat</organization>
+ <
organizationUrl>http://redhat.com/jboss</organizationUrl>
+ <
url>http://community.jboss.org/people/dan.j.allen</url>
+ </developer>
+ <developer>
+ <name>Pete Muir</name>
+ <roles>
+ <role>Weld project lead</role>
+ </roles>
+ <email>pete.muir(a)jboss.org</email>
+ <organization>Red Hat Inc.</organization>
+ <
organizationUrl>http://redhat.com/jboss</organizationUrl>
+ <url>http://in.relation.to/Bloggers/Pete</url>
+ </developer>
+ </developers>
+
+ <build>
+ <extensions>
+ <extension>
+ <groupId>org.apache.maven.archetype</groupId>
+ <artifactId>archetype-packaging</artifactId>
+ <version>2.0-alpha-5</version>
+ </extension>
+ </extensions>
+
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <artifactId>maven-archetype-plugin</artifactId>
+ <version>2.0-alpha-5</version>
+ <extensions>true</extensions>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+
+ <scm>
+
<
connection>scm:svn:http://anonsvn.jboss.org/repos/weld/archetypes/trun...
+
<
developerConnection>scm:svn:https://svn.jboss.org/repos/weld/archetype...
+
<
url>http://fisheye.jboss.org/browse/weld/archetypes/trunk/jsf-weld-ser...
+ </scm>
+</project>
Added:
archetypes/trunk/jsf-weld-servlet-webapp/target/archetype/src/main/resources/META-INF/maven/archetype-metadata.xml
===================================================================
---
archetypes/trunk/jsf-weld-servlet-webapp/target/archetype/src/main/resources/META-INF/maven/archetype-metadata.xml
(rev 0)
+++
archetypes/trunk/jsf-weld-servlet-webapp/target/archetype/src/main/resources/META-INF/maven/archetype-metadata.xml 2010-06-20
06:34:46 UTC (rev 6568)
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<archetype-descriptor
xsi:schemaLocation="http://maven.apache.org/plugins/maven-archetype-...
http://maven.apache.org/xsd/archetype-descriptor-1.0.0.xsd"
name="jboss-jsf-weld-servlet-webapp-src"
+
xmlns="http://maven.apache.org/plugins/maven-archetype-plugin/archet...
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <requiredProperties>
+ <requiredProperty key="name">
+ <defaultValue>JSF and CDI webapp</defaultValue>
+ </requiredProperty>
+ </requiredProperties>
+ <fileSets>
+ <fileSet filtered="true" packaged="true"
encoding="UTF-8">
+ <directory>src/main/java</directory>
+ <includes>
+ <include>**/*.java</include>
+ </includes>
+ </fileSet>
+ <fileSet encoding="UTF-8">
+ <directory>src/main/webapp</directory>
+ <includes>
+ <include>**/*.jsp</include>
+ <include>**/*.png</include>
+ <include>**/*.xhtml</include>
+ <include>**/*.xml</include>
+ <include>**/*.css</include>
+ </includes>
+ </fileSet>
+ <fileSet encoding="UTF-8">
+ <directory>src/main/resources</directory>
+ <includes>
+ <include>**/*.xml</include>
+ </includes>
+ </fileSet>
+ <fileSet filtered="true" packaged="true"
encoding="UTF-8">
+ <directory>src/test/java</directory>
+ <includes>
+ <include>**/*.java</include>
+ </includes>
+ </fileSet>
+ <fileSet encoding="UTF-8">
+ <directory>src/test/resources</directory>
+ <includes>
+ <include>**/*.xml</include>
+ </includes>
+ </fileSet>
+ <fileSet filtered="true" encoding="UTF-8">
+ <directory></directory>
+ <includes>
+ <include>readme.txt</include>
+ </includes>
+ </fileSet>
+ <fileSet encoding="UTF-8">
+ <directory></directory>
+ <includes>
+ <include>archetype-pom.xml</include>
+ <include>build.sh</include>
+ </includes>
+ </fileSet>
+ </fileSets>
+</archetype-descriptor>
Added:
archetypes/trunk/jsf-weld-servlet-webapp/target/archetype/src/main/resources/archetype-resources/pom.xml
===================================================================
---
archetypes/trunk/jsf-weld-servlet-webapp/target/archetype/src/main/resources/archetype-resources/pom.xml
(rev 0)
+++
archetypes/trunk/jsf-weld-servlet-webapp/target/archetype/src/main/resources/archetype-resources/pom.xml 2010-06-20
06:34:46 UTC (rev 6568)
@@ -0,0 +1,240 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project
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/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>${groupId}</groupId>
+ <artifactId>${artifactId}</artifactId>
+ <version>${version}</version>
+ <packaging>war</packaging>
+
+ <name>${name}</name>
+ <description>A basic JSF and CDI webapp project for servlet containers generated
from the jboss-jsf-weld-servlet-webapp archetype</description>
+
+ <properties>
+ <!--
+ Explicitly declaring the source encoding eliminates the following message:
+ [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources,
i.e. build is platform dependent!
+ -->
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <weld-servlet.version>1.0.1-Final</weld-servlet.version>
+ <arquillian.version>1.0.0-SNAPSHOT</arquillian.version>
+ </properties>
+
+ <repositories>
+ <!-- The JBoss public Nexus repository is a composite repository of several
major repositories -->
+ <!-- see
http://community.jboss.org/wiki/MavenGettingStarted-Users -->
+ <!-- The goal is to get everything you would need into the central, but it's
not there yet -->
+ <repository>
+ <id>jboss-public-repository</id>
+ <name>JBoss Repository</name>
+ <
url>https://repository.jboss.org/nexus/content/groups/public</url>
+ <releases>
+ <updatePolicy>never</updatePolicy>
+ </releases>
+ <snapshots>
+ <updatePolicy>daily</updatePolicy>
+ </snapshots>
+ </repository>
+ </repositories>
+
+ <pluginRepositories>
+ <pluginRepository>
+ <id>jboss-public-repository</id>
+ <name>JBoss Repository</name>
+ <
url>https://repository.jboss.org/nexus/content/groups/public</url>
+ <releases>
+ <updatePolicy>never</updatePolicy>
+ </releases>
+ <snapshots>
+ <enabled>false</enabled>
+ <updatePolicy>daily</updatePolicy>
+ </snapshots>
+ </pluginRepository>
+ </pluginRepositories>
+
+ <dependencyManagement>
+ <dependencies>
+ <!-- Import scope will provide versions for dependencies below. -->
+ <dependency>
+ <groupId>org.jboss.weld.servlet</groupId>
+ <artifactId>weld-servlet-parent</artifactId>
+ <version>${weld-servlet.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
+ <dependencies>
+
+ <!-- Common to JEE and Servlet containers -->
+ <dependency>
+ <groupId>javax.enterprise</groupId>
+ <artifactId>cdi-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.annotation</groupId>
+ <artifactId>jsr250-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <!-- JSF 2.0 API -->
+ <dependency>
+ <groupId>javax.faces</groupId>
+ <artifactId>jsf-api</artifactId>
+ <version>2.0.2-FCS</version>
+ </dependency>
+
+ <!-- Jetty/Tomcat-specific scopes and artifacts -->
+
+ <!-- JSF 2.0 -->
+ <dependency>
+ <groupId>javax.faces</groupId>
+ <artifactId>jsf-impl</artifactId>
+ <scope>runtime</scope>
+ <version>2.0.2-FCS</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.weld.servlet</groupId>
+ <artifactId>weld-servlet</artifactId>
+ <scope>runtime</scope>
+ </dependency>
+
+ <!--
+ <dependency>
+ <groupId>org.glassfish.web</groupId>
+ <artifactId>el-impl</artifactId>
+ <scope>runtime</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>javax.el</groupId>
+ <artifactId>el-api</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ -->
+ <!-- end Jetty/Tomcat-specific scopes and artifacts -->
+
+ <!-- Bean Validation API (JSR 303) -->
+ <dependency>
+ <groupId>javax.validation</groupId>
+ <artifactId>validation-api</artifactId>
+ </dependency>
+
+ <!-- Bean Validation Implementation -->
+ <!-- Provides portable constraints such as @NotEmpty, @Email and @Url -->
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-validator</artifactId>
+ <version>4.0.0.GA</version>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.8.1</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.arquillian</groupId>
+ <artifactId>arquillian-junit</artifactId>
+ <version>${arquillian.version}</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <finalName>jboss-jsf-weld-servlet-webapp-src</finalName>
+ <plugins>
+ <!-- Compiler plugin enforces Java 1.5 compatibility -->
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>2.3.1</version>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+
+ <!-- Embedded Jetty (jetty:run) -->
+ <plugin>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>maven-jetty-plugin</artifactId>
+ <version>6.1.24</version>
+ <configuration>
+ <!-- Delete this block to have Jetty run default port (8080) -->
+ <connectors>
+ <connector
implementation="org.mortbay.jetty.nio.SelectChannelConnector">
+ <port>9090</port>
+ </connector>
+ </connectors>
+ <!-- force friendly name instead of artifact name + version -->
+ <contextPath>${project.build.finalName}</contextPath>
+ <!-- Where the BeanManager is constructed. This is where you'll
declare datasources. -->
+
<jettyEnvXml>${basedir}/src/test/resources/jetty-env.xml</jettyEnvXml>
+ <!-- This parameter will auto-deploy modified classes. -->
+ <!-- You can save changes in a file or class and refresh your browser
to view the changes. -->
+ <scanIntervalSeconds>3</scanIntervalSeconds>
+ </configuration>
+ </plugin>
+
+ <!-- Embedded Tomcat (package tomcat:run) -->
+ <!-- Standalone Tomcat (package tomcat:deploy) -->
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>tomcat-maven-plugin</artifactId>
+ <configuration>
+ <path>/${project.build.finalName}</path>
+ <!-- Embedded port -->
+ <port>9090</port>
+ <!--
+ The default authentication credentials for remote deployment are
username "admin" with no password To
+ override credentials, define a server in settings.xml and activate it
using the <server> element
+ -->
+ <url>http://localhost:9090/manager</url>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <profiles>
+ <profile>
+ <id>weld-embedded</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.arquillian.container</groupId>
+ <artifactId>arquillian-weld-embedded</artifactId>
+ <version>${arquillian.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.weld</groupId>
+ <artifactId>weld-core</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.weld</groupId>
+ <artifactId>weld-api</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-simple</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.el</groupId>
+ <artifactId>el-api</artifactId>
+ <version>2.2</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ </profile>
+ </profiles>
+</project>
Added:
archetypes/trunk/jsf-weld-servlet-webapp/target/archetype/src/main/resources/archetype-resources/readme.txt
===================================================================
---
archetypes/trunk/jsf-weld-servlet-webapp/target/archetype/src/main/resources/archetype-resources/readme.txt
(rev 0)
+++
archetypes/trunk/jsf-weld-servlet-webapp/target/archetype/src/main/resources/archetype-resources/readme.txt 2010-06-20
06:34:46 UTC (rev 6568)
@@ -0,0 +1,104 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+
+ ${artifactId}
+
+ Source archetype: jboss-jsf-weld-servlet-webapp
+
+ What is it?
+ ===========
+
+ This is your project! It's a barebones, deployable Maven 2 project to help you
+ get your foot in the door developing with Java EE 6. Specifically, this
+ project is setup to allow you to create a JSF 2.0 and CDI 1.0 application that
+ can run on Servlet Containers like Tomcat 6 and Jetty 6. You may be satisfied
+ with this combination in the long run, or you may eventually migrate to a true
+ Java EE 6 environment to leverage EJB 3.1, JPA 2.0 and other platform
+ technologies.
+
+ System requirements
+ ===================
+
+ All you need to run this project is Java 5.0 (Java SDK 1.5) or greator and
+ Maven 2.0.10 or greater. This application is setup to be run on a Servlet
+ Container. The embedded Jetty and Tomcat containers get downloaded
+ automatically by the Maven commands.
+
+ If you want to deploy the application to a standalone Servlet Container, then
+ you will need to set one up.
+
+ Please note that Maven 2 project needs to use the JBoss Maven repository
+ because there are certain Java EE API JARs that are not yet publised to the
+ Maven Central Repository (see
https://jira.jboss.org/jira/browse/WELD-222)
+
+ Deploying the application
+ =========================
+
+ You can deploy the application without moving any files around using the
+ embedded Jetty or Tomcat containers.
+
+ To run the application using embedded Jetty, execute this command:
+
+ mvn jetty:run
+
+ To run the application using embedded Tomcat, execute this command:
+
+ mvn compile tomcat:run
+
+ The application will be running at the following URL:
+
+
http://localhost:9090/${artifactId}
+
+ To run the application on a standalone container, first execute this command:
+
+ mvn package
+
+ Then copy the archive target/jboss-jsf-weld-servlet-webapp.war to the hot deploy
directory of
+ the container (e.g., the webapps directory of Tomcat). Of course, you also
+ need to start the container.
+
+ Importing the project into an IDE
+ =================================
+
+ If you created the project using the Maven 2 archetype wizard in your IDE
+ (Eclipse, NetBeans or IntelliJ IDEA), then there is nothing to do. You should
+ already have an IDE project.
+
+ If you created the project from the commandline using archetype:generate, then
+ you need to bring the project into your IDE. If you are using NetBeans 6.8 or
+ IntelliJ IDEA 9, then all you have to do is open the project as an existing
+ project. Both of these IDEs recognize Maven 2 projects natively.
+
+ To import into Eclipse, you first need to install the m2eclipse plugin. To get
+ started, add the m2eclipse update site (
http://m2eclipse.sonatype.org/update/)
+ to Eclipse and install the m2eclipse plugin and required dependencies. Once
+ that is installed, you'll be ready to import the project into Eclipse.
+
+ Select File > Import... and select "Import... > Maven Projects" and
select
+ your project directory. m2eclipse should take it from there.
+
+ Once in the IDE, you can execute the Maven commands through the IDE controls
+ to run the application on an embedded Servlet Container.
+
+ Downloading the sources and Javadocs
+ ====================================
+
+ If you want to be able to debug into the source code or look at the Javadocs
+ of any library in the project, you can run either of the following two
+ commands to pull them into your local repository. The IDE should then detect
+ them.
+
+ mvn dependency:sources
+ mvn dependency:resolve -Dclassifier=javadoc
+
+ Resources
+ =========
+
+ Weld archetypes:
+ - Quickstart:
http://seamframework.org/Documentation/WeldQuickstartForMavenUsers
+ - Issue tracker:
https://jira.jboss.org/jira/browse/WELDRAD
+ - Source code:
http://anonsvn.jboss.org/repos/weld/archetypes
+ - Forums:
http://seamframework.org/Community/WeldUsers
+ JSR-299 overview:
http://seamframework.org/Weld
+ JSF community site:
http://www.javaserverfaces.org
Added:
archetypes/trunk/jsf-weld-servlet-webapp/target/archetype/src/main/resources/archetype-resources/src/main/java/HelloWorld.java
===================================================================
---
archetypes/trunk/jsf-weld-servlet-webapp/target/archetype/src/main/resources/archetype-resources/src/main/java/HelloWorld.java
(rev 0)
+++
archetypes/trunk/jsf-weld-servlet-webapp/target/archetype/src/main/resources/archetype-resources/src/main/java/HelloWorld.java 2010-06-20
06:34:46 UTC (rev 6568)
@@ -0,0 +1,77 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+package ${package};
+
+import javax.annotation.PostConstruct;
+import javax.enterprise.inject.Model;
+import javax.validation.constraints.Digits;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Pattern;
+
+import org.hibernate.validator.constraints.Email;
+import org.hibernate.validator.constraints.NotEmpty;
+
+public @Model class HelloWorld
+{
+ private final String text = "Hello, World!";
+
+ private String letters;
+
+ private String numbers;
+
+ private String email;
+
+ public HelloWorld() {}
+
+ @PostConstruct
+ public void initialize()
+ {
+ System.out.println(this.getClass().getSimpleName() + " was
constructed");
+ }
+
+ public String getText()
+ {
+ return text;
+ }
+
+ @NotNull
+ @NotEmpty
+ @Pattern(regexp = "[A-Za-z]*", message = "must contain only
letters")
+ public String getLetters()
+ {
+ return letters;
+ }
+
+ public void setLetters(String letters)
+ {
+ this.letters = letters;
+ }
+
+ @NotNull
+ @NotEmpty
+ @Digits(fraction = 0, integer = 2)
+ public String getNumbers()
+ {
+ return numbers;
+ }
+
+ public void setNumbers(String numbers)
+ {
+ this.numbers = numbers;
+ }
+
+ @NotNull
+ @NotEmpty
+ @Email
+ public String getEmail()
+ {
+ return email;
+ }
+
+ public void setEmail(String email)
+ {
+ this.email = email;
+ }
+
+}
Added:
archetypes/trunk/jsf-weld-servlet-webapp/target/archetype/src/main/resources/archetype-resources/src/main/resources/META-INF/beans.xml
===================================================================
---
archetypes/trunk/jsf-weld-servlet-webapp/target/archetype/src/main/resources/archetype-resources/src/main/resources/META-INF/beans.xml
(rev 0)
+++
archetypes/trunk/jsf-weld-servlet-webapp/target/archetype/src/main/resources/archetype-resources/src/main/resources/META-INF/beans.xml 2010-06-20
06:34:46 UTC (rev 6568)
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ The contents of this file is permitted to be empty.
+ The schema definition is provided for your convenience.
+-->
+<beans
xmlns="http://java.sun.com/xml/ns/javaee"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+
http://java.sun.com/xml/ns/javaee
+
http://java.sun.com/xml/ns/javaee/beans_1_0.xsd">
+</beans>
Added:
archetypes/trunk/jsf-weld-servlet-webapp/target/archetype/src/main/resources/archetype-resources/src/main/webapp/META-INF/context.xml
===================================================================
---
archetypes/trunk/jsf-weld-servlet-webapp/target/archetype/src/main/resources/archetype-resources/src/main/webapp/META-INF/context.xml
(rev 0)
+++
archetypes/trunk/jsf-weld-servlet-webapp/target/archetype/src/main/resources/archetype-resources/src/main/webapp/META-INF/context.xml 2010-06-20
06:34:46 UTC (rev 6568)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Context>
+ <!-- disable storage of sessions across restarts -->
+ <Manager pathname=""/>
+ <Resource name="BeanManager" auth="Container"
type="javax.enterprise.inject.spi.BeanManager"
factory="org.jboss.weld.resources.ManagerObjectFactory"/>
+ <!-- Uncomment to enable injection into Servlets, Servlet Listeners and Filters in
Tomcat -->
+ <!-- <Listener
className="org.jboss.weld.environment.tomcat.WeldLifecycleListener"/> -->
+</Context>
Added:
archetypes/trunk/jsf-weld-servlet-webapp/target/archetype/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
---
archetypes/trunk/jsf-weld-servlet-webapp/target/archetype/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/faces-config.xml
(rev 0)
+++
archetypes/trunk/jsf-weld-servlet-webapp/target/archetype/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/faces-config.xml 2010-06-20
06:34:46 UTC (rev 6568)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- This file is not required if you don't need any extra configuration. -->
+<faces-config version="2.0"
+
xmlns="http://java.sun.com/xml/ns/javaee"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+
http://java.sun.com/xml/ns/javaee
+
http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd">
+
+ <!-- Write your navigation rules here. You should use CDI for creating @Named
managed beans! -->
+
+</faces-config>
Added:
archetypes/trunk/jsf-weld-servlet-webapp/target/archetype/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/templates/default.xhtml
===================================================================
---
archetypes/trunk/jsf-weld-servlet-webapp/target/archetype/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/templates/default.xhtml
(rev 0)
+++
archetypes/trunk/jsf-weld-servlet-webapp/target/archetype/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/templates/default.xhtml 2010-06-20
06:34:46 UTC (rev 6568)
@@ -0,0 +1,52 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:ui="http://java.sun.com/jsf/facelets">
+ <h:head>
+ <title>CDI and JSF 2 Starter Application</title>
+ <meta http-equiv="Content-Type" content="text/html;
charset=utf-8" />
+ <h:outputStylesheet name="css/screen.css"/>
+ </h:head>
+ <h:body>
+ <div id="container">
+ <div id="content">
+ <div id="sidebar">
+ <h3>Find out more</h3>
+ <p>
+ Explore JavaServer Faces.
+ </p>
+ <ul>
+ <li><a href="http://www.javaserverfaces.org">JSF
community site</a></li>
+ </ul>
+ <p>
+ Learn more about Java EE 6 and the extensions provided by Weld and
Seam.
+ </p>
+ <ul>
+ <li><a
href="http://seamframework.org/Weld/JSR299AndWeldOverview">O...
+ <li><a href="http://seamframework.org">Project
site</a></li>
+ <li><a
href="http://seamframework.org/Documentation/SeamDocumentation#H-Wel...
+ <li><a
href="http://seamframework.org/Community/Forums">User
forums</a></li>
+ <li><a
href="http://seamframework.org/Community/MailingLists">Mailing
lists</a></li>
+ <li><a
href="https://jira.jboss.org/jira/browse/WELD">Issue
tracker</a></li>
+ </ul>
+ <p>
+ If you have an add-on, please <a
href="http://seamframework.org/Community/Forums">let us know</a> and
+ consider <a
href="http://seamframework.org/Community/Contribute">contrib...
it back to the
+ community!
+ </p>
+ </div>
+ <ui:insert name="content">
+ [Template content will be inserted here]
+ </ui:insert>
+ </div>
+ <div id="footer">
+ <h:graphicImage value="/resources/gfx/weld.png" alt="Weld
logo"/>
+ <p>
+ This project was generated from a Maven archetype maintained by the Weld
team.<br/>
+ Weld is the reference implementation of CDI, released under the Apache
License, Version 2.0.<br/>
+ </p>
+ </div>
+ </div>
+ </h:body>
+</html>
Added:
archetypes/trunk/jsf-weld-servlet-webapp/target/archetype/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml
===================================================================
---
archetypes/trunk/jsf-weld-servlet-webapp/target/archetype/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml
(rev 0)
+++
archetypes/trunk/jsf-weld-servlet-webapp/target/archetype/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml 2010-06-20
06:34:46 UTC (rev 6568)
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app version="2.5"
+
xmlns="http://java.sun.com/xml/ns/javaee"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+
http://java.sun.com/xml/ns/javaee
+
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
+
+ <!-- Activate the JSF 2.0 servlet -->
+ <servlet>
+ <servlet-name>Faces Servlet</servlet-name>
+ <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+
+ <!-- Tell the context which URLs to send through JSF -->
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>*.jsf</url-pattern>
+ </servlet-mapping>
+
+ <!-- This is an optional parameter, but it makes troubleshooting errors much easier
-->
+ <!-- You are advised to remove this context parameter before a production
deployment -->
+ <context-param>
+ <param-name>javax.faces.PROJECT_STAGE</param-name>
+ <param-value>Development</param-value>
+ </context-param>
+
+ <!-- Weld Jetty/Tomcat specific configuration parameters -->
+ <!-- *** The <listener> and <resource-env-ref> elements can be deleted
when running in a Java EE 6 container *** -->
+ <listener>
+
<listener-class>org.jboss.weld.environment.servlet.Listener</listener-class>
+ </listener>
+
+ <resource-env-ref>
+ <description>Object factory for the CDI Bean Manager</description>
+ <resource-env-ref-name>BeanManager</resource-env-ref-name>
+
<resource-env-ref-type>javax.enterprise.inject.spi.BeanManager</resource-env-ref-type>
+ </resource-env-ref>
+
+</web-app>
Added:
archetypes/trunk/jsf-weld-servlet-webapp/target/archetype/src/main/resources/archetype-resources/src/main/webapp/home.xhtml
===================================================================
---
archetypes/trunk/jsf-weld-servlet-webapp/target/archetype/src/main/resources/archetype-resources/src/main/webapp/home.xhtml
(rev 0)
+++
archetypes/trunk/jsf-weld-servlet-webapp/target/archetype/src/main/resources/archetype-resources/src/main/webapp/home.xhtml 2010-06-20
06:34:46 UTC (rev 6568)
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui:composition
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:h="http://java.sun.com/jsf/html"
+ template="/WEB-INF/templates/default.xhtml">
+ <ui:define name="content">
+ <h1>Hello World!</h1>
+ <p>Your CDI bean <code>HelloWorld</code> says <span
style="color: blue;">#{helloWorld.text}</span> using the Unified
EL.</p>
+
+ <h:form id="bv">
+ <h2>Bean Validation examples</h2>
+ <p>Enforces annotation-based constraints defined on the model
class.</p>
+ <table>
+ <tr>
+ <th style="text-align: right;">
+ <h:outputLabel for="letters"
value="Letters:"/>
+ </th>
+ <td>
+ <h:inputText id="letters"
value="#{helloWorld.letters}"/>
+ <h:message for="letters"
errorClass="invalid"/>
+ </td>
+ </tr>
+ <tr>
+ <th style="text-align: right;">
+ <h:outputLabel for="numbers"
value="Numbers:"/>
+ </th>
+ <td>
+ <h:inputText id="numbers"
value="#{helloWorld.numbers}"/>
+ <h:message for="numbers"
errorClass="invalid"/>
+ </td>
+ </tr>
+ <tr>
+ <th style="text-align: right;">
+ <h:outputLabel for="email" value="Email:"/>
+ </th>
+ <td>
+ <h:inputText id="email"
value="#{helloWorld.email}"/>
+ <h:message for="email"
errorClass="invalid"/>
+ </td>
+ </tr>
+ </table>
+ <p>
+ <h:commandButton id="check" value="Check values"/>
+ <h:outputText value=" All clear!"
rendered="#{facesContext.postback and empty facesContext.messageList}"
style="color: green;"/>
+ </p>
+ </h:form>
+ </ui:define>
+</ui:composition>
Added:
archetypes/trunk/jsf-weld-servlet-webapp/target/archetype/src/main/resources/archetype-resources/src/main/webapp/index.jsp
===================================================================
---
archetypes/trunk/jsf-weld-servlet-webapp/target/archetype/src/main/resources/archetype-resources/src/main/webapp/index.jsp
(rev 0)
+++
archetypes/trunk/jsf-weld-servlet-webapp/target/archetype/src/main/resources/archetype-resources/src/main/webapp/index.jsp 2010-06-20
06:34:46 UTC (rev 6568)
@@ -0,0 +1 @@
+<% response.sendRedirect("home.jsf"); %>
Added:
archetypes/trunk/jsf-weld-servlet-webapp/target/archetype/src/main/resources/archetype-resources/src/main/webapp/resources/css/screen.css
===================================================================
---
archetypes/trunk/jsf-weld-servlet-webapp/target/archetype/src/main/resources/archetype-resources/src/main/webapp/resources/css/screen.css
(rev 0)
+++
archetypes/trunk/jsf-weld-servlet-webapp/target/archetype/src/main/resources/archetype-resources/src/main/webapp/resources/css/screen.css 2010-06-20
06:34:46 UTC (rev 6568)
@@ -0,0 +1,39 @@
+body {
+ margin: 0;
+ padding: 0;
+ background-color: #EAECEE;
+ font-family: Verdana, sans-serif;
+ font-size: 0.9em;
+}
+#container {
+ margin: 0 auto;
+ padding: 0 20px 10px 20px;
+ border: 1px solid #666666;
+ width: 865px; /* subtract 40px from banner width for padding */
+ background: #FFFFFF url(#{request.contextPath}/resources/gfx/banner.png) no-repeat;
+ padding-top: 110px;
+}
+#sidebar {
+ font-size: 0.9em;
+ width: 225px;
+ float: right;
+ border: 1px solid #666666;
+ background: #EAECEE;
+ padding: 0 15px 5px 15px;
+}
+#sidebar ul {
+ padding-left: 30px;
+}
+#footer {
+ clear: both;
+ text-align: center;
+ color: #666666;
+ font-size: 0.85em;
+}
+code {
+ font-size: 1.1em;
+}
+span.invalid {
+ padding-left: 3px;
+ color: red;
+}
\ No newline at end of file
Added:
archetypes/trunk/jsf-weld-servlet-webapp/target/archetype/src/main/resources/archetype-resources/src/main/webapp/resources/gfx/banner.png
===================================================================
(Binary files differ)
Property changes on:
archetypes/trunk/jsf-weld-servlet-webapp/target/archetype/src/main/resources/archetype-resources/src/main/webapp/resources/gfx/banner.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
archetypes/trunk/jsf-weld-servlet-webapp/target/archetype/src/main/resources/archetype-resources/src/main/webapp/resources/gfx/weld.png
===================================================================
(Binary files differ)
Property changes on:
archetypes/trunk/jsf-weld-servlet-webapp/target/archetype/src/main/resources/archetype-resources/src/main/webapp/resources/gfx/weld.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
archetypes/trunk/jsf-weld-servlet-webapp/target/archetype/src/main/resources/archetype-resources/src/test/java/BeanManagerTest.java
===================================================================
---
archetypes/trunk/jsf-weld-servlet-webapp/target/archetype/src/main/resources/archetype-resources/src/test/java/BeanManagerTest.java
(rev 0)
+++
archetypes/trunk/jsf-weld-servlet-webapp/target/archetype/src/main/resources/archetype-resources/src/test/java/BeanManagerTest.java 2010-06-20
06:34:46 UTC (rev 6568)
@@ -0,0 +1,39 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+package ${package};
+
+import javax.enterprise.inject.spi.BeanManager;
+import javax.inject.Inject;
+import static org.junit.Assert.*;
+import org.jboss.arquillian.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.spec.JavaArchive;
+import org.jboss.shrinkwrap.impl.base.asset.ByteArrayAsset;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+(a)RunWith(Arquillian.class)
+public class BeanManagerTest
+{
+ @Deployment
+ public static Archive<?> createTestArchive() {
+ return ShrinkWrap.create("test.jar", JavaArchive.class)
+ .addClass(HelloWorld.class)
+ .addManifestResource(new ByteArrayAsset(new byte[0]), "beans.xml");
+ }
+
+ @Inject BeanManager beanManager;
+
+ @Inject HelloWorld helloWorld;
+
+ @Test
+ public void testCdiBootstrap()
+ {
+ assertNotNull(beanManager);
+ assertFalse(beanManager.getBeans(BeanManager.class).isEmpty());
+ assertEquals("Hello, World!", helloWorld.getText());
+ }
+}
Added:
archetypes/trunk/jsf-weld-servlet-webapp/target/archetype/src/main/resources/archetype-resources/src/test/java/HelloWorldTest.java
===================================================================
---
archetypes/trunk/jsf-weld-servlet-webapp/target/archetype/src/main/resources/archetype-resources/src/test/java/HelloWorldTest.java
(rev 0)
+++
archetypes/trunk/jsf-weld-servlet-webapp/target/archetype/src/main/resources/archetype-resources/src/test/java/HelloWorldTest.java 2010-06-20
06:34:46 UTC (rev 6568)
@@ -0,0 +1,16 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+package ${package};
+
+import static org.junit.Assert.*;
+import org.junit.Test;
+
+public class HelloWorldTest
+{
+ @Test
+ public void testGetText() {
+ HelloWorld fixture = new HelloWorld();
+ assertEquals("Hello, World!", fixture.getText());
+ }
+}
Added:
archetypes/trunk/jsf-weld-servlet-webapp/target/archetype/src/main/resources/archetype-resources/src/test/resources/jetty-env.xml
===================================================================
---
archetypes/trunk/jsf-weld-servlet-webapp/target/archetype/src/main/resources/archetype-resources/src/test/resources/jetty-env.xml
(rev 0)
+++
archetypes/trunk/jsf-weld-servlet-webapp/target/archetype/src/main/resources/archetype-resources/src/test/resources/jetty-env.xml 2010-06-20
06:34:46 UTC (rev 6568)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN"
"http://jetty.mortbay.org/configure.dtd">
+<Configure id="webAppCtx"
class="org.mortbay.jetty.webapp.WebAppContext">
+ <New id="beanManager"
class="org.mortbay.jetty.plus.naming.Resource">
+ <Arg>
+ <Ref id="webAppCtx"/>
+ </Arg>
+ <Arg>BeanManager</Arg>
+ <Arg>
+ <New class="javax.naming.Reference">
+ <Arg>javax.enterprise.inject.spi.BeanManager</Arg>
+ <Arg>org.jboss.weld.resources.ManagerObjectFactory</Arg>
+ <Arg/>
+ </New>
+ </Arg>
+ </New>
+</Configure>
Added:
archetypes/trunk/jsf-weld-servlet-webapp/target/archetype/src/test/resources/projects/basic/archetype.properties
===================================================================
---
archetypes/trunk/jsf-weld-servlet-webapp/target/archetype/src/test/resources/projects/basic/archetype.properties
(rev 0)
+++
archetypes/trunk/jsf-weld-servlet-webapp/target/archetype/src/test/resources/projects/basic/archetype.properties 2010-06-20
06:34:46 UTC (rev 6568)
@@ -0,0 +1,5 @@
+#Sun Jun 20 02:33:08 EDT 2010
+version=0.1-SNAPSHOT
+name=JSF and CDI webapp
+groupId=archetype.it
+artifactId=basic
Added:
archetypes/trunk/jsf-weld-servlet-webapp/target/archetype/src/test/resources/projects/basic/goal.txt
===================================================================