[weld-commits] Weld SVN: r5009 - in extensions/trunk/archetypes/weld-jsf-minimal/src: main and 13 other directories.

weld-commits at lists.jboss.org weld-commits at lists.jboss.org
Thu Nov 12 20:43:14 EST 2009


Author: sboscarine
Date: 2009-11-12 20:43:14 -0500 (Thu, 12 Nov 2009)
New Revision: 5009

Added:
   extensions/trunk/archetypes/weld-jsf-minimal/src/main/
   extensions/trunk/archetypes/weld-jsf-minimal/src/main/resources/
   extensions/trunk/archetypes/weld-jsf-minimal/src/main/resources/META-INF/
   extensions/trunk/archetypes/weld-jsf-minimal/src/main/resources/META-INF/archetype.xml
   extensions/trunk/archetypes/weld-jsf-minimal/src/main/resources/archetype-resources/
   extensions/trunk/archetypes/weld-jsf-minimal/src/main/resources/archetype-resources/pom.xml
   extensions/trunk/archetypes/weld-jsf-minimal/src/main/resources/archetype-resources/src/
   extensions/trunk/archetypes/weld-jsf-minimal/src/main/resources/archetype-resources/src/main/
   extensions/trunk/archetypes/weld-jsf-minimal/src/main/resources/archetype-resources/src/main/java/
   extensions/trunk/archetypes/weld-jsf-minimal/src/main/resources/archetype-resources/src/main/java/HelloWorld.java
   extensions/trunk/archetypes/weld-jsf-minimal/src/main/resources/archetype-resources/src/main/resources/
   extensions/trunk/archetypes/weld-jsf-minimal/src/main/resources/archetype-resources/src/main/resources/META-INF/
   extensions/trunk/archetypes/weld-jsf-minimal/src/main/resources/archetype-resources/src/main/resources/META-INF/beans.xml
   extensions/trunk/archetypes/weld-jsf-minimal/src/main/resources/archetype-resources/src/main/webapp/
   extensions/trunk/archetypes/weld-jsf-minimal/src/main/resources/archetype-resources/src/main/webapp/META-INF/
   extensions/trunk/archetypes/weld-jsf-minimal/src/main/resources/archetype-resources/src/main/webapp/META-INF/context.xml
   extensions/trunk/archetypes/weld-jsf-minimal/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/
   extensions/trunk/archetypes/weld-jsf-minimal/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/faces-config.xml
   extensions/trunk/archetypes/weld-jsf-minimal/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml
   extensions/trunk/archetypes/weld-jsf-minimal/src/main/resources/archetype-resources/src/main/webapp/index.jsp
   extensions/trunk/archetypes/weld-jsf-minimal/src/main/resources/archetype-resources/src/main/webapp/index.xhtml
   extensions/trunk/archetypes/weld-jsf-minimal/src/main/resources/archetype-resources/src/test/
   extensions/trunk/archetypes/weld-jsf-minimal/src/main/resources/archetype-resources/src/test/java/
   extensions/trunk/archetypes/weld-jsf-minimal/src/main/resources/archetype-resources/src/test/resources/
   extensions/trunk/archetypes/weld-jsf-minimal/src/main/resources/archetype-resources/src/test/resources/jetty-env.xml
Log:
fixed commit errors.  passed local test.  Need to test from clean checkout.

Added: extensions/trunk/archetypes/weld-jsf-minimal/src/main/resources/META-INF/archetype.xml
===================================================================
--- extensions/trunk/archetypes/weld-jsf-minimal/src/main/resources/META-INF/archetype.xml	                        (rev 0)
+++ extensions/trunk/archetypes/weld-jsf-minimal/src/main/resources/META-INF/archetype.xml	2009-11-13 01:43:14 UTC (rev 5009)
@@ -0,0 +1,17 @@
+<archetype>
+	<id>weld-archetype-servlet-quickstart</id>
+	<resources>
+		<resource>src/main/webapp/index.xhtml</resource>
+		<resource>src/main/webapp/index.jsp</resource>
+		<resource>src/main/webapp/WEB-INF/web.xml</resource>
+		<resource>src/main/resources/META-INF/beans.xml</resource>
+		<resource>src/main/webapp/META-INF/context.xml</resource>
+	</resources>
+	<sources>
+		<source>src/main/java/HelloWorld.java</source>
+	</sources>
+	<testSources />
+	<testResources>
+		<resource>src/test/resources/jetty-env.xml</resource>
+	</testResources>
+</archetype>
\ No newline at end of file

Added: extensions/trunk/archetypes/weld-jsf-minimal/src/main/resources/archetype-resources/pom.xml
===================================================================
--- extensions/trunk/archetypes/weld-jsf-minimal/src/main/resources/archetype-resources/pom.xml	                        (rev 0)
+++ extensions/trunk/archetypes/weld-jsf-minimal/src/main/resources/archetype-resources/pom.xml	2009-11-13 01:43:14 UTC (rev 5009)
@@ -0,0 +1,167 @@
+<?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>
+	<packaging>war</packaging>
+	<name>${artifactId}</name>
+	<version>${version}</version>
+	<properties>
+		<!--
+			eliminates [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>
+	</properties>
+	<repositories>
+		<!--
+			As of October 2009, a few of the weld dependencies were not yet on the main maven repo. The JBoss repo is updated
+			more frequently.
+		-->
+		<repository>
+			<id>repository.jboss.org</id>
+			<name>JBoss Repository</name>
+			<url>http://repository.jboss.org/maven2</url>
+			<releases>
+				<enabled>true</enabled>
+			</releases>
+			<snapshots>
+				<enabled>false</enabled>
+			</snapshots>
+		</repository>
+	</repositories>
+	<dependencyManagement>
+		<dependencies>
+			<!-- Import scope will provide versions and scopes for dependency below. -->
+			<dependency>
+				<groupId>org.jboss.weld</groupId>
+				<artifactId>weld-extensions-bom</artifactId>
+				<version>1.0.0-CR2</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>
+		</dependency>
+		<dependency>
+			<groupId>javax.annotation</groupId>
+			<artifactId>jsr250-api</artifactId>
+		</dependency>
+		<!-- JSF 2.0 -->
+		<dependency>
+			<groupId>javax.faces</groupId>
+			<artifactId>jsf-api</artifactId>
+		</dependency>
+
+		<!-- Optional, but pretty useful.   -->
+		<!--		<dependency>-->
+		<!--			<groupId>javax.servlet</groupId>-->
+		<!--			<artifactId>jstl</artifactId>-->
+		<!--		</dependency>-->
+
+		<!-- Optional, but highly recommended. -->
+		<dependency>
+			<groupId>org.testng</groupId>
+			<artifactId>testng</artifactId>
+			<version>5.10</version>
+			<scope>test</scope>
+			<classifier>jdk15</classifier>
+		</dependency>
+
+
+		<!-- Jetty/Tomcat-specific scopes and artifacts -->
+
+		<!-- JSF 2.0 -->
+		<dependency>
+			<groupId>javax.faces</groupId>
+			<artifactId>jsf-impl</artifactId>
+		</dependency>
+
+		<dependency>
+			<groupId>org.jboss.weld.servlet</groupId>
+			<artifactId>weld-servlet</artifactId>
+		</dependency>
+
+		<dependency>
+			<groupId>org.glassfish.web</groupId>
+			<artifactId>el-impl</artifactId>
+			<exclusions>
+				<exclusion>
+					<groupId>javax.el</groupId>
+					<artifactId>el-api</artifactId>
+				</exclusion>
+			</exclusions>
+		</dependency>
+		<!-- end Jetty/Tomcat-specific scopes and artifacts -->
+
+		<!-- Sun Bean Validation API (JSR 303) -->
+		<!--		<dependency>-->
+		<!--			<groupId>javax.validation</groupId>-->
+		<!--			<artifactId>validation-api</artifactId>-->
+		<!--			<version>1.0.0.GA</version>-->
+		<!--		</dependency>-->
+		<!-- hibernate bean validation impl -->
+		<!--		<dependency>-->
+		<!--			<groupId>org.hibernate</groupId>-->
+		<!--			<artifactId>hibernate-validator</artifactId>-->
+		<!--			<version>4.0.0.GA</version>-->
+		<!--		</dependency>-->
+		<!-- For some reason, this is a dependency of Bean Validation -->
+		<!--		<dependency>-->
+		<!--			<groupId>org.slf4j</groupId>-->
+		<!--			<artifactId>slf4j-log4j12</artifactId>-->
+		<!--			<version>1.4.2</version>-->
+		<!--		</dependency>-->
+	</dependencies>
+	<build>
+		<finalName>${artifactId}</finalName>
+		<plugins>
+			<!-- Compiler plugin enforces Java 1.6 -->
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-compiler-plugin</artifactId>
+				<configuration>
+					<source>1.6</source>
+					<target>1.6</target>
+				</configuration>
+			</plugin>
+
+			<!-- Eclipse plugin enforces download of source and JavaDoc jars -->
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-eclipse-plugin</artifactId>
+				<configuration>
+					<wtpversion>2.0</wtpversion>
+					<downloadSources>true</downloadSources>
+					<downloadJavadocs>true</downloadJavadocs>
+				</configuration>
+			</plugin>
+			<!-- Embedded Jetty (jetty:run) -->
+			<plugin>
+				<groupId>org.mortbay.jetty</groupId>
+				<artifactId>maven-jetty-plugin</artifactId>
+				<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>${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>
+		</plugins>
+	</build>
+</project>
\ No newline at end of file

Added: extensions/trunk/archetypes/weld-jsf-minimal/src/main/resources/archetype-resources/src/main/java/HelloWorld.java
===================================================================
--- extensions/trunk/archetypes/weld-jsf-minimal/src/main/resources/archetype-resources/src/main/java/HelloWorld.java	                        (rev 0)
+++ extensions/trunk/archetypes/weld-jsf-minimal/src/main/resources/archetype-resources/src/main/java/HelloWorld.java	2009-11-13 01:43:14 UTC (rev 5009)
@@ -0,0 +1,24 @@
+package ${package};
+
+import java.io.Serializable;
+
+import javax.enterprise.context.RequestScoped;
+import javax.inject.Named;
+ at RequestScoped
+ at Named
+public class HelloWorld implements Serializable
+{
+   public HelloWorld()
+   {
+      System.out.println(this.getClass().getSimpleName() + " was constructed");
+   }
+
+   private final String text = "Hello World!";
+
+   public String getText()
+   {
+      return text;
+   }
+
+   private static final long serialVersionUID = 1L;
+}
\ No newline at end of file

Added: extensions/trunk/archetypes/weld-jsf-minimal/src/main/resources/archetype-resources/src/main/resources/META-INF/beans.xml
===================================================================
--- extensions/trunk/archetypes/weld-jsf-minimal/src/main/resources/archetype-resources/src/main/resources/META-INF/beans.xml	                        (rev 0)
+++ extensions/trunk/archetypes/weld-jsf-minimal/src/main/resources/archetype-resources/src/main/resources/META-INF/beans.xml	2009-11-13 01:43:14 UTC (rev 5009)
@@ -0,0 +1,7 @@
+<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">
+	<alternatives />
+	<decorators />
+	<interceptors />
+</beans>
\ No newline at end of file

Added: extensions/trunk/archetypes/weld-jsf-minimal/src/main/resources/archetype-resources/src/main/webapp/META-INF/context.xml
===================================================================
--- extensions/trunk/archetypes/weld-jsf-minimal/src/main/resources/archetype-resources/src/main/webapp/META-INF/context.xml	                        (rev 0)
+++ extensions/trunk/archetypes/weld-jsf-minimal/src/main/resources/archetype-resources/src/main/webapp/META-INF/context.xml	2009-11-13 01:43:14 UTC (rev 5009)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Context>
+	<Manager pathname="" /> <!-- disables storage of sessions across restarts -->
+	<Resource name="BeanManager" auth="Container"
+		type="javax.enterprise.inject.spi.BeanManager" factory="org.jboss.weld.resources.ManagerObjectFactory" />
+	<!-- Uncomment to enable injection into Servlet -->
+	<!-- <Listener className="org.jboss.weld.environment.tomcat.WeldLifecycleListener"/>	-->
+</Context>

Added: extensions/trunk/archetypes/weld-jsf-minimal/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- extensions/trunk/archetypes/weld-jsf-minimal/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/faces-config.xml	                        (rev 0)
+++ extensions/trunk/archetypes/weld-jsf-minimal/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/faces-config.xml	2009-11-13 01:43:14 UTC (rev 5009)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+	<!--	This file is optional.  It can be deleted at any time. -->
+<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">
+</faces-config>
\ No newline at end of file

Added: extensions/trunk/archetypes/weld-jsf-minimal/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml
===================================================================
--- extensions/trunk/archetypes/weld-jsf-minimal/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml	                        (rev 0)
+++ extensions/trunk/archetypes/weld-jsf-minimal/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml	2009-11-13 01:43:14 UTC (rev 5009)
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app 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" version="2.5">
+	
+	<!-- Standard JSF 2.0 Configuration Paramters. -->
+	<context-param>
+		<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
+		<param-value>.xhtml</param-value>
+	</context-param>
+	<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 process as facelets.  -->
+	<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 may want to delete it before final deployment -->
+	<context-param>
+		<param-name>facelets.DEVELOPMENT</param-name>
+		<param-value>true</param-value>
+	</context-param>
+
+	<!-- Weld Jetty/Tomcat specific configuration parameters -->
+	<!-- Both the listener and resource-env-ref tags can be deleted in JEE6 containers.    -->
+	<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>
\ No newline at end of file

Added: extensions/trunk/archetypes/weld-jsf-minimal/src/main/resources/archetype-resources/src/main/webapp/index.jsp
===================================================================
--- extensions/trunk/archetypes/weld-jsf-minimal/src/main/resources/archetype-resources/src/main/webapp/index.jsp	                        (rev 0)
+++ extensions/trunk/archetypes/weld-jsf-minimal/src/main/resources/archetype-resources/src/main/webapp/index.jsp	2009-11-13 01:43:14 UTC (rev 5009)
@@ -0,0 +1,5 @@
+<html>
+<head>
+<meta HTTP-EQUIV="REFRESH" content="0; url=index.jsf">
+</head>
+</html>

Added: extensions/trunk/archetypes/weld-jsf-minimal/src/main/resources/archetype-resources/src/main/webapp/index.xhtml
===================================================================
--- extensions/trunk/archetypes/weld-jsf-minimal/src/main/resources/archetype-resources/src/main/webapp/index.xhtml	                        (rev 0)
+++ extensions/trunk/archetypes/weld-jsf-minimal/src/main/resources/archetype-resources/src/main/webapp/index.xhtml	2009-11-13 01:43:14 UTC (rev 5009)
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+	xmlns:h="http://java.sun.com/jsf/html">
+<h:head>
+	<title>JSF Demo</title>
+</h:head>
+<h:body>
+	<h1>Does Weld Work?</h1>
+	<p>My weld-injected bean says: #{helloWorld.text} in a JSF EL dialect.</p>
+	<p>You can write the same value using UEL ${helloWorld.text}</p>
+</h:body>
+</html>
\ No newline at end of file

Added: extensions/trunk/archetypes/weld-jsf-minimal/src/main/resources/archetype-resources/src/test/resources/jetty-env.xml
===================================================================
--- extensions/trunk/archetypes/weld-jsf-minimal/src/main/resources/archetype-resources/src/test/resources/jetty-env.xml	                        (rev 0)
+++ extensions/trunk/archetypes/weld-jsf-minimal/src/main/resources/archetype-resources/src/test/resources/jetty-env.xml	2009-11-13 01:43:14 UTC (rev 5009)
@@ -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="appManager" 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>



More information about the weld-commits mailing list