[weld-commits] Weld SVN: r5191 - in java-se/trunk: src/main/java/org/jboss/weld/environment/se and 2 other directories.

weld-commits at lists.jboss.org weld-commits at lists.jboss.org
Wed Dec 2 08:37:13 EST 2009


Author: peteroyle
Date: 2009-12-02 08:37:11 -0500 (Wed, 02 Dec 2009)
New Revision: 5191

Added:
   java-se/trunk/src/main/java/org/jboss/weld/environment/se/WeldSEBeanRegistrant.java
   java-se/trunk/src/main/resources/META-INF/services/
   java-se/trunk/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension
Removed:
   java-se/trunk/src/main/resources/META-INF/beans.xml
Modified:
   java-se/trunk/pom.xml
   java-se/trunk/src/main/java/org/jboss/weld/environment/se/StartMain.java
Log:
Weld Se produces a shaded jar with all Weld dependencies bundled for easier usage in SE apps.

Modified: java-se/trunk/pom.xml
===================================================================
--- java-se/trunk/pom.xml	2009-12-02 12:08:07 UTC (rev 5190)
+++ java-se/trunk/pom.xml	2009-12-02 13:37:11 UTC (rev 5191)
@@ -58,16 +58,16 @@
          </snapshots>
       </repository>
       <repository>
-        <id>oss.sonatype.org/jboss-snapshots</id>
-        <name>JBoss (Nexus) Snapshots Repository</name>
-        <url>http://oss.sonatype.org/content/repositories/jboss-snapshots</url>
-        <releases>
-          <enabled>false</enabled>
-        </releases>
-        <snapshots>
-          <enabled>true</enabled>
-          <updatePolicy>never</updatePolicy>
-        </snapshots>
+         <id>oss.sonatype.org/jboss-snapshots</id>
+         <name>JBoss (Nexus) Snapshots Repository</name>
+         <url>http://oss.sonatype.org/content/repositories/jboss-snapshots</url>
+         <releases>
+            <enabled>false</enabled>
+         </releases>
+         <snapshots>
+            <enabled>true</enabled>
+            <updatePolicy>never</updatePolicy>
+         </snapshots>
       </repository>
    </repositories>
    
@@ -144,7 +144,6 @@
       <dependency>
          <groupId>org.jboss.weld</groupId>
          <artifactId>weld-core</artifactId>
-         <scope>provided</scope>
       </dependency>
 
       <dependency>
@@ -168,6 +167,25 @@
       </dependency>
    </dependencies>
 
+   <build>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-shade-plugin</artifactId>
+            <executions>
+               <execution>
+                  <phase>package</phase>
+                  <goals>
+                     <goal>shade</goal>
+                  </goals>
+                  <configuration>
+                  </configuration>
+               </execution>
+            </executions>
+         </plugin>
+      </plugins>
+   </build>
+   
 </project>
 
 

Modified: java-se/trunk/src/main/java/org/jboss/weld/environment/se/StartMain.java
===================================================================
--- java-se/trunk/src/main/java/org/jboss/weld/environment/se/StartMain.java	2009-12-02 12:08:07 UTC (rev 5190)
+++ java-se/trunk/src/main/java/org/jboss/weld/environment/se/StartMain.java	2009-12-02 13:37:11 UTC (rev 5191)
@@ -20,9 +20,11 @@
 import org.jboss.weld.environment.se.events.ContainerInitialized;
 
 /**
- * This is the main class that should always be called from the command line for
- * a WeldContainer SE app. Something like: <code>
- * java -jar MyApp.jar org.jboss.weld.environment.se.StarMain arguments
+ * This is the main class that can be called from the command line for
+ * a WeldContainer SE app which makes use of the ContainerInitialized event.
+ * Something like:
+ * <code>
+ * java -cp weld-se.jar:my-app.jar org.jboss.weld.environment.se.StartMain arg1 arg2
  * </code>
  * 
  * @author Peter Royle

Added: java-se/trunk/src/main/java/org/jboss/weld/environment/se/WeldSEBeanRegistrant.java
===================================================================
--- java-se/trunk/src/main/java/org/jboss/weld/environment/se/WeldSEBeanRegistrant.java	                        (rev 0)
+++ java-se/trunk/src/main/java/org/jboss/weld/environment/se/WeldSEBeanRegistrant.java	2009-12-02 13:37:11 UTC (rev 5191)
@@ -0,0 +1,40 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.weld.environment.se;
+
+import javax.enterprise.event.Observes;
+import javax.enterprise.inject.spi.BeanManager;
+import javax.enterprise.inject.spi.BeforeBeanDiscovery;
+import javax.enterprise.inject.spi.Extension;
+import org.jboss.weld.environment.se.beans.InstanceManager;
+import org.jboss.weld.environment.se.beans.ParametersFactory;
+
+/**
+ * Explicitly registers all of the 'built-in' Java SE related beans.
+ * @author Peter Royle
+ */
+public class WeldSEBeanRegistrant implements Extension
+{
+
+   public void registerWeldSEBeans(@Observes BeforeBeanDiscovery event, BeanManager beanManager)
+   {
+      event.addAnnotatedType(beanManager.createAnnotatedType(ShutdownManager.class));
+      event.addAnnotatedType(beanManager.createAnnotatedType(ParametersFactory.class));
+      event.addAnnotatedType(beanManager.createAnnotatedType(InstanceManager.class));
+   }
+
+}

Deleted: java-se/trunk/src/main/resources/META-INF/beans.xml
===================================================================
--- java-se/trunk/src/main/resources/META-INF/beans.xml	2009-12-02 12:08:07 UTC (rev 5190)
+++ java-se/trunk/src/main/resources/META-INF/beans.xml	2009-12-02 13:37:11 UTC (rev 5191)
@@ -1,19 +0,0 @@
-<!--
-
-    JBoss, Home of Professional Open Source
-    Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual
-    contributors by the @authors tag. See the copyright.txt in the
-    distribution for a full listing of individual contributors.
-
-    Licensed under the Apache License, Version 2.0 (the "License");
-    you may not use this file except in compliance with the License.
-    You may obtain a copy of the License at
-    http://www.apache.org/licenses/LICENSE-2.0
-    Unless required by applicable law or agreed to in writing, software
-    distributed under the License is distributed on an "AS IS" BASIS,
-    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-    See the License for the specific language governing permissions and
-    limitations under the License.
-
--->
-<beans></beans>

Added: java-se/trunk/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension
===================================================================
--- java-se/trunk/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension	                        (rev 0)
+++ java-se/trunk/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension	2009-12-02 13:37:11 UTC (rev 5191)
@@ -0,0 +1 @@
+org.jboss.weld.environment.se.WeldSEBeanRegistrant



More information about the weld-commits mailing list