Weld SVN: r5489 - build/trunk/dist-tck.
by weld-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2010-01-18 12:57:01 -0500 (Mon, 18 Jan 2010)
New Revision: 5489
Modified:
build/trunk/dist-tck/pom.xml
Log:
update version
Modified: build/trunk/dist-tck/pom.xml
===================================================================
--- build/trunk/dist-tck/pom.xml 2010-01-18 16:02:56 UTC (rev 5488)
+++ build/trunk/dist-tck/pom.xml 2010-01-18 17:57:01 UTC (rev 5489)
@@ -8,7 +8,7 @@
</parent>
<groupId>org.jboss.jsr299.tck</groupId>
<artifactId>jsr299-tck-dist</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <version>1.0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<name>JSR-299 TCK Distribution</name>
16 years, 2 months
Weld SVN: r5488 - in core/trunk/tests/src: test/java/org/jboss/weld/tests and 2 other directories.
by weld-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2010-01-18 11:02:56 -0500 (Mon, 18 Jan 2010)
New Revision: 5488
Added:
core/trunk/tests/src/test/java/org/jboss/weld/tests/TestableObserverMethod.java
Modified:
core/trunk/tests/src/main/java/org/jboss/weld/test/BeanManagerLocator.java
core/trunk/tests/src/test/java/org/jboss/weld/tests/activities/ActivitiesTest.java
core/trunk/tests/src/test/java/org/jboss/weld/tests/activities/current/EventCurrentActivityTest.java
Log:
WELD-83
Modified: core/trunk/tests/src/main/java/org/jboss/weld/test/BeanManagerLocator.java
===================================================================
--- core/trunk/tests/src/main/java/org/jboss/weld/test/BeanManagerLocator.java 2010-01-18 15:11:18 UTC (rev 5487)
+++ core/trunk/tests/src/main/java/org/jboss/weld/test/BeanManagerLocator.java 2010-01-18 16:02:56 UTC (rev 5488)
@@ -22,11 +22,11 @@
{
if (ServletTestRunner.getCurrentServletContext() != null)
{
- return ServletHelper.getModuleBeanManager(ServletTestRunner.getCurrentServletContext());
+ return ServletHelper.getModuleBeanManager(ServletTestRunner.getCurrentServletContext()).getCurrent();
}
else if (getTestArchive() != null)
{
- return Container.instance().beanDeploymentArchives().get(getTestArchive());
+ return Container.instance().beanDeploymentArchives().get(getTestArchive()).getCurrent();
}
else
{
Added: core/trunk/tests/src/test/java/org/jboss/weld/tests/TestableObserverMethod.java
===================================================================
--- core/trunk/tests/src/test/java/org/jboss/weld/tests/TestableObserverMethod.java (rev 0)
+++ core/trunk/tests/src/test/java/org/jboss/weld/tests/TestableObserverMethod.java 2010-01-18 16:02:56 UTC (rev 5488)
@@ -0,0 +1,10 @@
+package org.jboss.weld.tests;
+
+import javax.enterprise.inject.spi.ObserverMethod;
+
+public interface TestableObserverMethod<T> extends ObserverMethod<T>
+{
+
+ public boolean isObserved();
+
+}
\ No newline at end of file
Property changes on: core/trunk/tests/src/test/java/org/jboss/weld/tests/TestableObserverMethod.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Modified: core/trunk/tests/src/test/java/org/jboss/weld/tests/activities/ActivitiesTest.java
===================================================================
--- core/trunk/tests/src/test/java/org/jboss/weld/tests/activities/ActivitiesTest.java 2010-01-18 15:11:18 UTC (rev 5487)
+++ core/trunk/tests/src/test/java/org/jboss/weld/tests/activities/ActivitiesTest.java 2010-01-18 16:02:56 UTC (rev 5488)
@@ -11,38 +11,44 @@
import javax.enterprise.context.spi.Context;
import javax.enterprise.context.spi.Contextual;
import javax.enterprise.context.spi.CreationalContext;
+import javax.enterprise.event.Reception;
+import javax.enterprise.event.TransactionPhase;
import javax.enterprise.inject.UnsatisfiedResolutionException;
import javax.enterprise.inject.spi.Annotated;
import javax.enterprise.inject.spi.Bean;
import javax.enterprise.inject.spi.BeanManager;
import javax.enterprise.inject.spi.InjectionPoint;
+import javax.enterprise.inject.spi.ObserverMethod;
import javax.enterprise.util.AnnotationLiteral;
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.weld.bean.ForwardingBean;
+import org.jboss.weld.literal.AnyLiteral;
import org.jboss.weld.literal.DefaultLiteral;
import org.jboss.weld.manager.BeanManagerImpl;
import org.jboss.weld.test.AbstractWeldTest;
+import org.jboss.weld.util.collections.Arrays2;
import org.testng.annotations.Test;
-
/**
*
* Spec version: 20090519
- *
+ *
*/
@Artifact
public class ActivitiesTest extends AbstractWeldTest
{
- private static final Set<Annotation> DEFAULT_QUALIFIERS = Collections.<Annotation>singleton(DefaultLiteral.INSTANCE);
+ private static final Set<Annotation> DEFAULT_QUALIFIERS = Collections.<Annotation> singleton(DefaultLiteral.INSTANCE);
private Bean<?> createDummyBean(BeanManager beanManager, final Type injectionPointType)
{
final Set<InjectionPoint> injectionPoints = new HashSet<InjectionPoint>();
final Set<Type> types = new HashSet<Type>();
final Set<Annotation> bindings = new HashSet<Annotation>();
- bindings.add(new AnnotationLiteral<Tame>() {});
+ bindings.add(new AnnotationLiteral<Tame>()
+ {
+ });
types.add(Object.class);
final Bean<?> bean = new Bean<Object>()
{
@@ -192,15 +198,15 @@
assert childActivity.getInjectableReference(dummyBean.getInjectionPoints().iterator().next(), childActivity.createCreationalContext(dummyBean)) != null;
}
-// @Test
-// public void testObserverBelongingToParentActivityBelongsToChildActivity()
-// {
-// assert getCurrentManager().resolveObservers(new NightTime()).size() == 1;
-// Observer<?> observer = getCurrentManager().resolveObservers(new NightTime()).iterator().next();
-// BeanManager childActivity = getCurrentManager().createActivity();
-// assert childActivity.resolveObservers(new NightTime()).size() == 1;
-// assert childActivity.resolveObservers(new NightTime()).iterator().next().equals(observer);
-// }
+ @Test
+ public void testObserverBelongingToParentActivityBelongsToChildActivity()
+ {
+ assert getCurrentManager().resolveObserverMethods(new NightTime()).size() == 1;
+ ObserverMethod<?> observer = getCurrentManager().resolveObserverMethods(new NightTime()).iterator().next();
+ BeanManager childActivity = getCurrentManager().createActivity();
+ assert childActivity.resolveObserverMethods(new NightTime()).size() == 1;
+ assert childActivity.resolveObserverMethods(new NightTime()).iterator().next().equals(observer);
+ }
@Test
public void testObserverBelongingToParentFiresForChildActivity()
@@ -236,10 +242,12 @@
BeanManagerImpl childActivity = getCurrentManager().createActivity();
Bean<?> dummyBean = createDummyBean(childActivity, Cow.class);
childActivity.addBean(dummyBean);
- assert getBeans(Object.class, new AnnotationLiteral<Tame>() {}).size() == 0;
+ assert getBeans(Object.class, new AnnotationLiteral<Tame>()
+ {
+ }).size() == 0;
}
- @Test(expectedExceptions=UnsatisfiedResolutionException.class)
+ @Test(expectedExceptions = UnsatisfiedResolutionException.class)
public void testInstanceProcessedByParentActivity()
{
Context dummyContext = new DummyContext();
@@ -248,9 +256,11 @@
final Bean<Cow> bean = getBeans(Cow.class).iterator().next();
BeanManagerImpl childActivity = getCurrentManager().createActivity();
final Set<Annotation> bindingTypes = new HashSet<Annotation>();
- bindingTypes.add(new AnnotationLiteral<Tame>() {});
+ bindingTypes.add(new AnnotationLiteral<Tame>()
+ {
+ });
childActivity.addBean(new ForwardingBean<Cow>()
- {
+ {
@Override
protected Bean<Cow> delegate()
@@ -270,28 +280,52 @@
return Collections.emptySet();
}
- });
+ });
getReference(Field.class).get();
}
@Test
public void testObserverBelongingToChildDoesNotFireForParentActivity()
{
-
-// BeanManager childActivity = getCurrentManager().createActivity();
-// ObserverMethod<NightTime> observer = new Observer<NightTime>()
-// {
-//
-// public boolean notify(NightTime event)
-// {
-// assert false;
-// return false;
-// }
-//
-// };
-// //TODO Fix this test to use an observer method in a child activity
-//// childActivity.addObserver(observer);
-// getCurrentManager().fireEvent(new NightTime());
+
+ BeanManagerImpl childActivity = getCurrentManager().createActivity();
+ ObserverMethod<NightTime> observer = new ObserverMethod<NightTime>()
+ {
+
+ public void notify(NightTime event)
+ {
+ assert false;
+ }
+
+ public Class<?> getBeanClass()
+ {
+ return NightTime.class;
+ }
+
+ public Set<Annotation> getObservedQualifiers()
+ {
+ return Arrays2.asSet(AnyLiteral.INSTANCE, DefaultLiteral.INSTANCE);
+ }
+
+ public Type getObservedType()
+ {
+ return NightTime.class;
+ }
+
+ public Reception getReception()
+ {
+ return Reception.ALWAYS;
+ }
+
+ public TransactionPhase getTransactionPhase()
+ {
+ return TransactionPhase.IN_PROGRESS;
+ }
+
+ };
+ // TODO Fix this test to use an observer method in a child activity
+ childActivity.addObserver(observer);
+ getCurrentManager().fireEvent(new NightTime());
}
}
Modified: core/trunk/tests/src/test/java/org/jboss/weld/tests/activities/current/EventCurrentActivityTest.java
===================================================================
--- core/trunk/tests/src/test/java/org/jboss/weld/tests/activities/current/EventCurrentActivityTest.java 2010-01-18 15:11:18 UTC (rev 5487)
+++ core/trunk/tests/src/test/java/org/jboss/weld/tests/activities/current/EventCurrentActivityTest.java 2010-01-18 16:02:56 UTC (rev 5488)
@@ -1,30 +1,35 @@
package org.jboss.weld.tests.activities.current;
import java.lang.annotation.Annotation;
+import java.lang.reflect.Type;
+import java.util.Collections;
+import java.util.Set;
import javax.enterprise.context.spi.Context;
import javax.enterprise.context.spi.Contextual;
import javax.enterprise.context.spi.CreationalContext;
+import javax.enterprise.event.Reception;
+import javax.enterprise.event.TransactionPhase;
import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.weld.literal.AnyLiteral;
+import org.jboss.weld.manager.BeanManagerImpl;
import org.jboss.weld.test.AbstractWeldTest;
+import org.jboss.weld.tests.TestableObserverMethod;
import org.testng.annotations.Test;
/**
*
* Spec version: 20090519
- *
+ *
*/
@Artifact
public class EventCurrentActivityTest extends AbstractWeldTest
{
-
private static class DummyContext implements Context
{
- private boolean active = true;
-
public <T> T get(Contextual<T> contextual)
{
return null;
@@ -42,44 +47,62 @@
public boolean isActive()
{
- return active;
+ return true;
}
- public void setActive(boolean active)
- {
- this.active = active;
- }
-
}
- @Test
+
+ @Test(groups = "broken")
public void testEventProcessedByCurrentActivity()
{
-// Context dummyContext = new DummyContext();
-// getCurrentManager().addContext(dummyContext);
-// WeldManager childActivity = getCurrentManager().createActivity();
-// TestableObserver<NightTime> observer = new TestableObserver<NightTime>()
-// {
-//
-// boolean observed = false;
-//
-// public boolean notify(NightTime event)
-// {
-// observed = true;
-// return false;
-// }
-//
-// public boolean isObserved()
-// {
-// return observed;
-// }
+ DummyContext dummyContext = new DummyContext();
+ getCurrentManager().addContext(dummyContext);
+ BeanManagerImpl childActivity = getCurrentManager().createActivity();
+ TestableObserverMethod<NightTime> observer = new TestableObserverMethod<NightTime>()
+ {
-// };
- //TODO Fix this test to use observer method within a child activity
-// childActivity.addObserver(observer);
-// childActivity.setCurrent(dummyContext.getScopeType());
-// createContextualInstance(Dusk.class).ping();
-// assert observer.isObserved();
+ boolean observed = false;
+
+ public void notify(NightTime event)
+ {
+ observed = true;
+ }
+
+ public boolean isObserved()
+ {
+ return observed;
+ }
+
+ public Class<?> getBeanClass()
+ {
+ return NightTime.class;
+ }
+
+ public Set<Annotation> getObservedQualifiers()
+ {
+ return Collections.<Annotation>singleton(AnyLiteral.INSTANCE);
+ }
+
+ public Type getObservedType()
+ {
+ return NightTime.class;
+ }
+
+ public Reception getReception()
+ {
+ return Reception.ALWAYS;
+ }
+
+ public TransactionPhase getTransactionPhase()
+ {
+ return TransactionPhase.IN_PROGRESS;
+ }
+
+ };
+ childActivity.addObserver(observer);
+ childActivity.setCurrent(dummyContext.getScope());
+ getReference(Dusk.class).ping();
+ assert observer.isObserved();
}
-
}
16 years, 2 months
Weld SVN: r5487 - api/trunk/weld-spi/src/main/java/org/jboss/weld/injection/spi/helpers.
by weld-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2010-01-18 10:11:18 -0500 (Mon, 18 Jan 2010)
New Revision: 5487
Modified:
api/trunk/weld-spi/src/main/java/org/jboss/weld/injection/spi/helpers/AbstractResourceServices.java
Log:
WELD-383
Modified: api/trunk/weld-spi/src/main/java/org/jboss/weld/injection/spi/helpers/AbstractResourceServices.java
===================================================================
--- api/trunk/weld-spi/src/main/java/org/jboss/weld/injection/spi/helpers/AbstractResourceServices.java 2010-01-18 07:23:57 UTC (rev 5486)
+++ api/trunk/weld-spi/src/main/java/org/jboss/weld/injection/spi/helpers/AbstractResourceServices.java 2010-01-18 15:11:18 UTC (rev 5487)
@@ -13,7 +13,7 @@
public abstract class AbstractResourceServices implements Service
{
- private static final String RESOURCE_LOOKUP_PREFIX = "java:/comp/env";
+ private static final String RESOURCE_LOOKUP_PREFIX = "java:comp/env";
/* (non-Javadoc)
* @see org.jboss.weld.resources.spi.helpers.ResourceServices#resolveResource(javax.inject.manager.InjectionPoint)
16 years, 2 months
Weld SVN: r5486 - extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/reannotated.
by weld-commits@lists.jboss.org
Author: swd847
Date: 2010-01-18 02:23:57 -0500 (Mon, 18 Jan 2010)
New Revision: 5486
Modified:
extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/reannotated/Reannotated.java
Log:
Added the ability to remove annotations from Reannitated
Modified: extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/reannotated/Reannotated.java
===================================================================
--- extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/reannotated/Reannotated.java 2010-01-16 17:29:12 UTC (rev 5485)
+++ extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/reannotated/Reannotated.java 2010-01-18 07:23:57 UTC (rev 5486)
@@ -31,7 +31,13 @@
AnnotationSet(Map<Class<? extends Annotation>, Annotation> annotations, Set<Annotation> delegateAnnotations)
{
- list.addAll(annotations.values());
+ for (Annotation a : annotations.values())
+ {
+ if (a != null)
+ {
+ list.add(a);
+ }
+ }
for (Annotation ann : delegateAnnotations)
{
if (!annotations.containsKey(ann.annotationType()))
@@ -70,21 +76,14 @@
if (isAnnotationPresent(annotationType))
{
X redefined = visitor.redefine(getAnnotation(annotationType), this);
- if (redefined == null)
- {
- annotations.remove(annotationType);
- }
- else
- {
- annotations.put(annotationType, redefined);
- }
+ annotations.put(annotationType, redefined);
}
}
- /*
- * public void undefine(Class<? extends Annotation> annotationType) {
- * annotations.put(annotationType, null); }
- */
+ public void undefine(Class<? extends Annotation> annotationType)
+ {
+ annotations.put(annotationType, null);
+ }
public void define(Annotation ann)
{
@@ -124,9 +123,10 @@
{
throw new IllegalArgumentException("annotationType argument must not be null");
}
- Annotation ann = annotations.get(annotationType);
- if (ann != null)
+
+ if (annotations.containsKey(annotationType))
{
+ Annotation ann = annotations.get(annotationType);
return annotationType.cast(ann);
}
else
@@ -152,7 +152,11 @@
public boolean isAnnotationPresent(Class<? extends Annotation> annotationType)
{
- return annotations.containsKey(annotationType) || delegate().isAnnotationPresent(annotationType);
+ if (annotations.containsKey(annotationType))
+ {
+ return annotations.get(annotationType) != null;
+ }
+ return delegate().isAnnotationPresent(annotationType);
}
}
16 years, 2 months
Weld SVN: r5485 - core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events and 2 other directories.
by weld-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2010-01-16 12:29:12 -0500 (Sat, 16 Jan 2010)
New Revision: 5485
Modified:
cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/broken/passivatingScope/AddingPassivatingScopeTest.java
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/BeforeBeanDiscoveryImpl.java
core/trunk/impl/src/main/java/org/jboss/weld/logging/messages/BootstrapMessage.java
core/trunk/impl/src/main/resources/org/jboss/weld/messages/bootstrap_en.properties
Log:
WELD-307
Modified: cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/broken/passivatingScope/AddingPassivatingScopeTest.java
===================================================================
--- cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/broken/passivatingScope/AddingPassivatingScopeTest.java 2010-01-16 15:05:47 UTC (rev 5484)
+++ cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/broken/passivatingScope/AddingPassivatingScopeTest.java 2010-01-16 17:29:12 UTC (rev 5485)
@@ -40,8 +40,7 @@
public class AddingPassivatingScopeTest extends AbstractJSR299Test
{
- @Test(groups="jboss-as-broken")
- // WBRI-312
+ @Test
@SpecAssertion(section="11.5.1", id="ac")
public void testAddingScopeType()
{
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/BeforeBeanDiscoveryImpl.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/BeforeBeanDiscoveryImpl.java 2010-01-16 15:05:47 UTC (rev 5484)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/BeforeBeanDiscoveryImpl.java 2010-01-16 17:29:12 UTC (rev 5485)
@@ -25,12 +25,14 @@
import org.jboss.weld.bootstrap.BeanDeployment;
import org.jboss.weld.bootstrap.spi.BeanDeploymentArchive;
import org.jboss.weld.bootstrap.spi.Deployment;
+import org.jboss.weld.exceptions.DefinitionException;
import org.jboss.weld.introspector.ForwardingAnnotatedType;
import org.jboss.weld.literal.InterceptorBindingTypeLiteral;
import org.jboss.weld.literal.NormalScopeLiteral;
import org.jboss.weld.literal.QualifierLiteral;
import org.jboss.weld.literal.ScopeLiteral;
import org.jboss.weld.literal.StereotypeLiteral;
+import org.jboss.weld.logging.messages.BootstrapMessage;
import org.jboss.weld.manager.BeanManagerImpl;
public class BeforeBeanDiscoveryImpl extends AbstractBeanDiscoveryEvent implements BeforeBeanDiscovery
@@ -85,6 +87,10 @@
{
getTypeStore().add(scopeType, new NormalScopeLiteral(passivating));
}
+ else if (passivating)
+ {
+ throw new DefinitionException(BootstrapMessage.PASSIVATING_NON_NORMAL_SCOPE_ILLEGAL, scopeType);
+ }
else
{
getTypeStore().add(scopeType, ScopeLiteral.INSTANCE);
Modified: core/trunk/impl/src/main/java/org/jboss/weld/logging/messages/BootstrapMessage.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/logging/messages/BootstrapMessage.java 2010-01-16 15:05:47 UTC (rev 5484)
+++ core/trunk/impl/src/main/java/org/jboss/weld/logging/messages/BootstrapMessage.java 2010-01-16 17:29:12 UTC (rev 5485)
@@ -35,6 +35,7 @@
@MessageId("000114") DEPLOYMENT_REQUIRED,
@MessageId("000115") BEAN_STORE_MISSING,
@MessageId("000116") MANAGER_NOT_INITIALIZED,
- @MessageId("000117") UNSPECIFIED_REQUIRED_SERVICE;
+ @MessageId("000117") UNSPECIFIED_REQUIRED_SERVICE,
+ @MessageId("000118") PASSIVATING_NON_NORMAL_SCOPE_ILLEGAL;
}
Modified: core/trunk/impl/src/main/resources/org/jboss/weld/messages/bootstrap_en.properties
===================================================================
--- core/trunk/impl/src/main/resources/org/jboss/weld/messages/bootstrap_en.properties 2010-01-16 15:05:47 UTC (rev 5484)
+++ core/trunk/impl/src/main/resources/org/jboss/weld/messages/bootstrap_en.properties 2010-01-16 17:29:12 UTC (rev 5485)
@@ -15,3 +15,4 @@
BEAN_STORE_MISSING=No application context BeanStore set
MANAGER_NOT_INITIALIZED=Manager has not been initialized
UNSPECIFIED_REQUIRED_SERVICE=Required service {0} has not been specified
+PASSIVATING_NON_NORMAL_SCOPE_ILLEGAL=Only normal scopes can be passivating. Scope {0}
16 years, 3 months
Weld SVN: r5484 - in build/trunk: dist and 6 other directories.
by weld-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2010-01-16 10:05:47 -0500 (Sat, 16 Jan 2010)
New Revision: 5484
Added:
build/trunk/lib/
build/trunk/lib/maven-ant-tasks.jar
build/trunk/lib/maven/
build/trunk/lib/maven/LICENSE.txt
build/trunk/lib/maven/NOTICE.txt
build/trunk/lib/maven/README.txt
build/trunk/lib/maven/bin/
build/trunk/lib/maven/bin/m2
build/trunk/lib/maven/bin/m2.bat
build/trunk/lib/maven/bin/m2.conf
build/trunk/lib/maven/bin/mvn
build/trunk/lib/maven/bin/mvn.bat
build/trunk/lib/maven/bin/mvnDebug
build/trunk/lib/maven/bin/mvnDebug.bat
build/trunk/lib/maven/boot/
build/trunk/lib/maven/boot/classworlds-1.1.jar
build/trunk/lib/maven/conf/
build/trunk/lib/maven/conf/settings.xml
build/trunk/lib/maven/lib/
build/trunk/lib/maven/lib/maven-2.0.10-uber.jar
Modified:
build/trunk/dist/build.xml
build/trunk/dist/pom.xml
Log:
add libs
Modified: build/trunk/dist/build.xml
===================================================================
--- build/trunk/dist/build.xml 2010-01-16 14:08:27 UTC (rev 5483)
+++ build/trunk/dist/build.xml 2010-01-16 15:05:47 UTC (rev 5484)
@@ -106,14 +106,15 @@
</zip>
</target>
- <target name="deploy-dist" depends="dist">
- <maven target="deploy:deploy-file" basedir="${weld.dir}">
+ <target name="deploy-dist">
+ <fail unless="weld.version" message="You must specify the weld.version as a property" />
+ <maven target="deploy:deploy-file" basedir="${basedir}">
<arg line="-DpomFile=${basedir}/pom.xml" />
<arg line="-Dpackaging=zip" />
<arg line="-Dversion=${weld.version}" />
<arg line="-Dfile=${basedir}/weld-${weld.version}.zip" />
- <arg line="-Durl=dav:https://snapshots.jboss.org/maven2" />
- <arg line="-DrepositoryId=snapshots.jboss.org" />
+ <arg line="-Durl=http://oss.sonatype.org/content/repositories/jboss-snapshots/" />
+ <arg line="-DrepositoryId=oss.sonatype.org/jboss-snapshots" />
<arg line="-DuniqueVersion=false" />
</maven>
</target>
Modified: build/trunk/dist/pom.xml
===================================================================
--- build/trunk/dist/pom.xml 2010-01-16 14:08:27 UTC (rev 5483)
+++ build/trunk/dist/pom.xml 2010-01-16 15:05:47 UTC (rev 5484)
@@ -5,9 +5,9 @@
<parent>
<artifactId>weld-parent</artifactId>
<groupId>org.jboss.weld</groupId>
- <version>2</version>
+ <version>8</version>
</parent>
- <version>1.0.0-CR1</version>
+ <version>1.0.1-SNAPSHOT</version>
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.weld</groupId>
<artifactId>weld-distribution</artifactId>
Added: build/trunk/lib/maven/LICENSE.txt
===================================================================
--- build/trunk/lib/maven/LICENSE.txt (rev 0)
+++ build/trunk/lib/maven/LICENSE.txt 2010-01-16 15:05:47 UTC (rev 5484)
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ 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.
Added: build/trunk/lib/maven/NOTICE.txt
===================================================================
--- build/trunk/lib/maven/NOTICE.txt (rev 0)
+++ build/trunk/lib/maven/NOTICE.txt 2010-01-16 15:05:47 UTC (rev 5484)
@@ -0,0 +1,11 @@
+ =========================================================================
+ == NOTICE file corresponding to the section 4 d of ==
+ == the Apache License, Version 2.0, ==
+ == in this case for the Apache Maven distribution. ==
+ =========================================================================
+
+This product includes software developed by
+The Apache Software Foundation (http://www.apache.org/).
+
+This product includes software (Plexus and Classworlds) developed by
+The Codehaus Foundation (http://www.codehaus.org/).
Added: build/trunk/lib/maven/README.txt
===================================================================
--- build/trunk/lib/maven/README.txt (rev 0)
+++ build/trunk/lib/maven/README.txt 2010-01-16 15:05:47 UTC (rev 5484)
@@ -0,0 +1,78 @@
+
+ Apache Maven
+
+ What is it?
+ -----------
+
+ Maven is a software project management and comprehension tool. Based on
+ the concept of a Project Object Model (POM), Maven can manage a project's
+ build, reporting and documentation from a central piece of information.
+
+ Documentation
+ -------------
+
+ The documentation available as of the date of this release is included in
+ HTML format in the docs/ directory.
+ The most up-to-date documentation can be found at http://maven.apache.org/.
+
+ Release Notes
+ -------------
+
+ The full list of changes can be found at http://maven.apache.org/release-notes.html.
+
+ System Requirements
+ -------------------
+
+ JDK:
+ 1.4 or above (this is to execute Maven - it still allows you to build against 1.3
+ and prior JDK's).
+ Memory:
+ No minimum requirement.
+ Disk:
+ No minimum requirement. Approximately 100MB will be used for your local repository,
+ however this will vary depending on usage and can be removed and redownloaded at
+ any time.
+ Operating System:
+ No minimum requirement. On Windows, Windows NT and above or Cygwin is required for
+ the startup scripts. Tested on Windows XP, Fedora Core and Mac OS X.
+
+ Installing Maven
+ ----------------
+
+ 1) Unpack the archive where you would like to store the binaries, eg:
+
+ Unix-based Operating Systems (Linux, Solaris and Mac OS X)
+ tar zxvf apache-maven-2.0.x.tar.gz
+ Windows 2000/XP
+ unzip apache-maven-2.0.x.zip
+
+ 2) A directory called "apache-maven-2.0.x" will be created.
+
+ 3) Add the bin directory to your PATH, eg:
+
+ Unix-based Operating Systems (Linux, Solaris and Mac OS X)
+ export PATH=/usr/local/apache-maven-2.0.x/bin:$PATH
+ Windows 2000/XP
+ set PATH="c:\program files\apache-maven-2.0.x\bin";%PATH%
+
+ 4) Make sure JAVA_HOME is set to the location of your JDK
+
+ 5) Run "mvn --version" to verify that it is correctly installed.
+
+ For complete documentation, see http://maven.apache.org/download.html#Installation
+
+ Licensing
+ ---------
+
+ Please see the file called LICENSE.TXT
+
+ Maven URLS
+ ----------
+
+ Home Page: http://maven.apache.org/
+ Downloads: http://maven.apache.org/downloads.html
+ Mailing Lists: http://maven.apache.org/mail-lists.html
+ Source Code: http://svn.apache.org/repos/asf/maven/
+ Issue Tracking: http://jira.codehaus.org/browse/MNG
+ Wiki: http://docs.codehaus.org/display/MAVENUSER/
+ Available Plugins: http://maven.apache.org/plugins/index.html
Added: build/trunk/lib/maven/bin/m2
===================================================================
--- build/trunk/lib/maven/bin/m2 (rev 0)
+++ build/trunk/lib/maven/bin/m2 2010-01-16 15:05:47 UTC (rev 5484)
@@ -0,0 +1,26 @@
+#!/bin/sh
+# ----------------------------------------------------------------------------
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you 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.
+# ----------------------------------------------------------------------------
+
+echo ""
+echo THE m2 COMMMAND IS DEPRECATED - PLEASE RUN mvn INSTEAD
+echo ""
+
+. `dirname "$0"`/mvn
+exec "`dirname "$0"`/mvn" $QUOTED_ARGS
Property changes on: build/trunk/lib/maven/bin/m2
___________________________________________________________________
Name: svn:executable
+ *
Added: build/trunk/lib/maven/bin/m2.bat
===================================================================
--- build/trunk/lib/maven/bin/m2.bat (rev 0)
+++ build/trunk/lib/maven/bin/m2.bat 2010-01-16 15:05:47 UTC (rev 5484)
@@ -0,0 +1,26 @@
+@REM ----------------------------------------------------------------------------
+@REM Licensed to the Apache Software Foundation (ASF) under one
+@REM or more contributor license agreements. See the NOTICE file
+@REM distributed with this work for additional information
+@REM regarding copyright ownership. The ASF licenses this file
+@REM to you under the Apache License, Version 2.0 (the
+@REM "License"); you may not use this file except in compliance
+@REM with the License. You may obtain a copy of the License at
+@REM
+@REM http://www.apache.org/licenses/LICENSE-2.0
+@REM
+@REM Unless required by applicable law or agreed to in writing,
+@REM software distributed under the License is distributed on an
+@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+@REM KIND, either express or implied. See the License for the
+@REM specific language governing permissions and limitations
+@REM under the License.
+@REM ----------------------------------------------------------------------------
+
+@ECHO OFF
+echo.
+echo THE m2 COMMMAND IS DEPRECATED - PLEASE RUN mvn INSTEAD
+echo.
+
+"%~dp0\mvn" %*
+
Added: build/trunk/lib/maven/bin/m2.conf
===================================================================
--- build/trunk/lib/maven/bin/m2.conf (rev 0)
+++ build/trunk/lib/maven/bin/m2.conf 2010-01-16 15:05:47 UTC (rev 5484)
@@ -0,0 +1,6 @@
+main is org.apache.maven.cli.MavenCli from plexus.core
+
+set maven.home default ${user.home}/m2
+
+[plexus.core]
+load ${maven.home}/lib/*.jar
Added: build/trunk/lib/maven/bin/mvn
===================================================================
--- build/trunk/lib/maven/bin/mvn (rev 0)
+++ build/trunk/lib/maven/bin/mvn 2010-01-16 15:05:47 UTC (rev 5484)
@@ -0,0 +1,163 @@
+#!/bin/sh
+# ----------------------------------------------------------------------------
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you 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.
+# ----------------------------------------------------------------------------
+
+# ----------------------------------------------------------------------------
+# Maven2 Start Up Batch script
+#
+# Required ENV vars:
+# ------------------
+# JAVA_HOME - location of a JDK home dir
+#
+# Optional ENV vars
+# -----------------
+# M2_HOME - location of maven2's installed home dir
+# MAVEN_OPTS - parameters passed to the Java VM when running Maven
+# e.g. to debug Maven itself, use
+# set MAVEN_OPTS=-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
+# ----------------------------------------------------------------------------
+
+QUOTED_ARGS=""
+while [ "$1" != "" ] ; do
+
+ QUOTED_ARGS="$QUOTED_ARGS \"$1\""
+ shift
+
+done
+
+if [ -f /etc/mavenrc ] ; then
+ . /etc/mavenrc
+fi
+
+if [ -f "$HOME/.mavenrc" ] ; then
+ . "$HOME/.mavenrc"
+fi
+
+# OS specific support. $var _must_ be set to either true or false.
+cygwin=false;
+darwin=false;
+mingw=false
+case "`uname`" in
+ CYGWIN*) cygwin=true ;;
+ MINGW*) mingw=true;;
+ Darwin*) darwin=true
+ if [ -z "$JAVA_VERSION" ] ; then
+ JAVA_VERSION="CurrentJDK"
+ else
+ echo "Using Java version: $JAVA_VERSION"
+ fi
+ if [ -z "$JAVA_HOME" ] ; then
+ JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/${JAVA_VERSION}/Home
+ fi
+ ;;
+esac
+
+if [ -z "$JAVA_HOME" ] ; then
+ if [ -r /etc/gentoo-release ] ; then
+ JAVA_HOME=`java-config --jre-home`
+ fi
+fi
+
+if [ -z "$M2_HOME" ] ; then
+ ## resolve links - $0 may be a link to maven's home
+ PRG="$0"
+
+ # need this for relative symlinks
+ while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG="`dirname "$PRG"`/$link"
+ fi
+ done
+
+ saveddir=`pwd`
+
+ M2_HOME=`dirname "$PRG"`/..
+
+ # make it fully qualified
+ M2_HOME=`cd "$M2_HOME" && pwd`
+
+ cd "$saveddir"
+ # echo Using m2 at $M2_HOME
+fi
+
+# For Cygwin, ensure paths are in UNIX format before anything is touched
+if $cygwin ; then
+ [ -n "$M2_HOME" ] &&
+ M2_HOME=`cygpath --unix "$M2_HOME"`
+ [ -n "$JAVA_HOME" ] &&
+ JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
+ [ -n "$CLASSPATH" ] &&
+ CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
+fi
+
+# For Migwn, ensure paths are in UNIX format before anything is touched
+if $mingw ; then
+ [ -n "$M2_HOME" ] &&
+ M2_HOME="`(cd "$M2_HOME"; pwd)`"
+ [ -n "$JAVA_HOME" ] &&
+ JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`"
+ # TODO classpath?
+fi
+
+if [ -z "$JAVACMD" ] ; then
+ if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ else
+ JAVACMD="`which java`"
+ fi
+fi
+
+if [ ! -x "$JAVACMD" ] ; then
+ echo "Error: JAVA_HOME is not defined correctly."
+ echo " We cannot execute $JAVACMD"
+ exit 1
+fi
+
+if [ -z "$JAVA_HOME" ] ; then
+ echo "Warning: JAVA_HOME environment variable is not set."
+fi
+
+CLASSWORLDS_LAUNCHER=org.codehaus.classworlds.Launcher
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin; then
+ [ -n "$M2_HOME" ] &&
+ M2_HOME=`cygpath --path --windows "$M2_HOME"`
+ [ -n "$JAVA_HOME" ] &&
+ JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
+ [ -n "$HOME" ] &&
+ HOME=`cygpath --path --windows "$HOME"`
+fi
+
+exec "$JAVACMD" \
+ $MAVEN_OPTS \
+ -classpath "${M2_HOME}"/boot/classworlds-*.jar \
+ "-Dclassworlds.conf=${M2_HOME}/bin/m2.conf" \
+ "-Dmaven.home=${M2_HOME}" \
+ ${CLASSWORLDS_LAUNCHER} $QUOTED_ARGS
+
Property changes on: build/trunk/lib/maven/bin/mvn
___________________________________________________________________
Name: svn:executable
+ *
Added: build/trunk/lib/maven/bin/mvn.bat
===================================================================
--- build/trunk/lib/maven/bin/mvn.bat (rev 0)
+++ build/trunk/lib/maven/bin/mvn.bat 2010-01-16 15:05:47 UTC (rev 5484)
@@ -0,0 +1,188 @@
+@REM ----------------------------------------------------------------------------
+@REM Licensed to the Apache Software Foundation (ASF) under one
+@REM or more contributor license agreements. See the NOTICE file
+@REM distributed with this work for additional information
+@REM regarding copyright ownership. The ASF licenses this file
+@REM to you under the Apache License, Version 2.0 (the
+@REM "License"); you may not use this file except in compliance
+@REM with the License. You may obtain a copy of the License at
+@REM
+@REM http://www.apache.org/licenses/LICENSE-2.0
+@REM
+@REM Unless required by applicable law or agreed to in writing,
+@REM software distributed under the License is distributed on an
+@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+@REM KIND, either express or implied. See the License for the
+@REM specific language governing permissions and limitations
+@REM under the License.
+@REM ----------------------------------------------------------------------------
+
+@REM ----------------------------------------------------------------------------
+@REM Maven2 Start Up Batch script
+@REM
+@REM Required ENV vars:
+@REM JAVA_HOME - location of a JDK home dir
+@REM
+@REM Optional ENV vars
+@REM M2_HOME - location of maven2's installed home dir
+@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
+@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending
+@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
+@REM e.g. to debug Maven itself, use
+@REM set MAVEN_OPTS=-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
+@REM ----------------------------------------------------------------------------
+
+@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
+@echo off
+@REM enable echoing my setting MAVEN_BATCH_ECHO to 'on'
+@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO%
+
+@REM set %HOME% to equivalent of $HOME
+if "%HOME%" == "" (set HOME=%HOMEDRIVE%%HOMEPATH%)
+
+@REM Execute a user defined script before this one
+if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat"
+
+set ERROR_CODE=0
+
+@REM set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" @setlocal
+if "%OS%"=="WINNT" @setlocal
+
+@REM ==== START VALIDATION ====
+if not "%JAVA_HOME%" == "" goto OkJHome
+
+echo.
+echo ERROR: JAVA_HOME not found in your environment.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation
+echo.
+goto error
+
+:OkJHome
+if exist "%JAVA_HOME%\bin\java.exe" goto chkMHome
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory.
+echo JAVA_HOME = %JAVA_HOME%
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation
+echo.
+goto error
+
+:chkMHome
+if not "%M2_HOME%"=="" goto valMHome
+
+if "%OS%"=="Windows_NT" SET M2_HOME=%~dp0..
+if "%OS%"=="WINNT" SET M2_HOME=%~dp0..
+if not "%M2_HOME%"=="" goto valMHome
+
+echo.
+echo ERROR: M2_HOME not found in your environment.
+echo Please set the M2_HOME variable in your environment to match the
+echo location of the Maven installation
+echo.
+goto error
+
+:valMHome
+
+:stripMHome
+if not _%M2_HOME:~-1%==_\ goto checkMBat
+set M2_HOME=%M2_HOME:~0,-1%
+goto stripMHome
+
+:checkMBat
+if exist "%M2_HOME%\bin\mvn.bat" goto init
+
+echo.
+echo ERROR: M2_HOME is set to an invalid directory.
+echo M2_HOME = %M2_HOME%
+echo Please set the M2_HOME variable in your environment to match the
+echo location of the Maven installation
+echo.
+goto error
+@REM ==== END VALIDATION ====
+
+:init
+@REM Decide how to startup depending on the version of windows
+
+@REM -- Windows NT with Novell Login
+if "%OS%"=="WINNT" goto WinNTNovell
+
+@REM -- Win98ME
+if NOT "%OS%"=="Windows_NT" goto Win9xArg
+
+:WinNTNovell
+
+@REM -- 4NT shell
+if "%@eval[2+2]" == "4" goto 4NTArgs
+
+@REM -- Regular WinNT shell
+set MAVEN_CMD_LINE_ARGS=%*
+goto endInit
+
+@REM The 4NT Shell from jp software
+:4NTArgs
+set MAVEN_CMD_LINE_ARGS=%$
+goto endInit
+
+:Win9xArg
+@REM Slurp the command line arguments. This loop allows for an unlimited number
+@REM of agruments (up to the command line limit, anyway).
+set MAVEN_CMD_LINE_ARGS=
+:Win9xApp
+if %1a==a goto endInit
+set MAVEN_CMD_LINE_ARGS=%MAVEN_CMD_LINE_ARGS% %1
+shift
+goto Win9xApp
+
+@REM Reaching here means variables are defined and arguments have been captured
+:endInit
+SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
+
+@REM -- 4NT shell
+if "%@eval[2+2]" == "4" goto 4NTCWJars
+
+@REM -- Regular WinNT shell
+for %%i in ("%M2_HOME%"\boot\classworlds-*) do set CLASSWORLDS_JAR="%%i"
+goto runm2
+
+@REM The 4NT Shell from jp software
+:4NTCWJars
+for %%i in ("%M2_HOME%\boot\classworlds-*") do set CLASSWORLDS_JAR="%%i"
+goto runm2
+
+@REM Start MAVEN2
+:runm2
+%MAVEN_JAVA_EXE% %MAVEN_OPTS% -classpath %CLASSWORLDS_JAR% "-Dclassworlds.conf=%M2_HOME%\bin\m2.conf" "-Dmaven.home=%M2_HOME%" org.codehaus.classworlds.Launcher %MAVEN_CMD_LINE_ARGS%
+if ERRORLEVEL 1 goto error
+goto end
+
+:error
+if "%OS%"=="Windows_NT" @endlocal
+if "%OS%"=="WINNT" @endlocal
+set ERROR_CODE=1
+
+:end
+@REM set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" goto endNT
+if "%OS%"=="WINNT" goto endNT
+
+@REM For old DOS remove the set variables from ENV - we assume they were not set
+@REM before we started - at least we don't leave any baggage around
+set MAVEN_JAVA_EXE=
+set MAVEN_CMD_LINE_ARGS=
+goto postExec
+
+:endNT
+@endlocal & set ERROR_CODE=%ERROR_CODE%
+
+:postExec
+if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat"
+@REM pause the batch file if MAVEN_BATCH_PAUSE is set to 'on'
+if "%MAVEN_BATCH_PAUSE%" == "on" pause
+
+if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE%
+
+cmd /C exit /B %ERROR_CODE%
+
Added: build/trunk/lib/maven/bin/mvnDebug
===================================================================
--- build/trunk/lib/maven/bin/mvnDebug (rev 0)
+++ build/trunk/lib/maven/bin/mvnDebug 2010-01-16 15:05:47 UTC (rev 5484)
@@ -0,0 +1,168 @@
+#!/bin/sh
+# ----------------------------------------------------------------------------
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you 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.
+# ----------------------------------------------------------------------------
+
+# ----------------------------------------------------------------------------
+# Maven2 Start Up Batch script
+#
+# Required ENV vars:
+# ------------------
+# JAVA_HOME - location of a JDK home dir
+#
+# Optional ENV vars
+# -----------------
+# M2_HOME - location of maven2's installed home dir
+# MAVEN_OPTS - parameters passed to the Java VM when running Maven
+# e.g. to debug Maven itself, use
+# set MAVEN_OPTS=-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
+# ----------------------------------------------------------------------------
+
+INT_MAVEN_OPTS="$MAVEN_OPTS -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000"
+
+echo Preparing to Execute Maven in Debug Mode
+
+QUOTED_ARGS=""
+while [ "$1" != "" ] ; do
+
+ QUOTED_ARGS="$QUOTED_ARGS \"$1\""
+ shift
+
+done
+
+if [ -f /etc/mavenrc ] ; then
+ . /etc/mavenrc
+fi
+
+if [ -f "$HOME/.mavenrc" ] ; then
+ . "$HOME/.mavenrc"
+fi
+
+# OS specific support. $var _must_ be set to either true or false.
+cygwin=false;
+darwin=false;
+mingw=false
+case "`uname`" in
+ CYGWIN*) cygwin=true ;;
+ MINGW*) mingw=true;;
+ Darwin*) darwin=true
+ if [ -z "$JAVA_VERSION" ] ; then
+ JAVA_VERSION="CurrentJDK"
+ else
+ echo "Using Java version: $JAVA_VERSION"
+ fi
+ if [ -z "$JAVA_HOME" ] ; then
+ JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/${JAVA_VERSION}/Home
+ fi
+ ;;
+esac
+
+if [ -z "$JAVA_HOME" ] ; then
+ if [ -r /etc/gentoo-release ] ; then
+ JAVA_HOME=`java-config --jre-home`
+ fi
+fi
+
+if [ -z "$M2_HOME" ] ; then
+ ## resolve links - $0 may be a link to maven's home
+ PRG="$0"
+
+ # need this for relative symlinks
+ while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG="`dirname "$PRG"`/$link"
+ fi
+ done
+
+ saveddir=`pwd`
+
+ M2_HOME=`dirname "$PRG"`/..
+
+ # make it fully qualified
+ M2_HOME=`cd "$M2_HOME" && pwd`
+
+ cd "$saveddir"
+ # echo Using m2 at $M2_HOME
+fi
+
+# For Cygwin, ensure paths are in UNIX format before anything is touched
+if $cygwin ; then
+ [ -n "$M2_HOME" ] &&
+ M2_HOME=`cygpath --unix "$M2_HOME"`
+ [ -n "$JAVA_HOME" ] &&
+ JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
+ [ -n "$CLASSPATH" ] &&
+ CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
+fi
+
+# For Migwn, ensure paths are in UNIX format before anything is touched
+if $mingw ; then
+ [ -n "$M2_HOME" ] &&
+ M2_HOME="`(cd "$M2_HOME"; pwd)`"
+ [ -n "$JAVA_HOME" ] &&
+ JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`"
+ # TODO classpath?
+fi
+
+if [ -z "$JAVACMD" ] ; then
+ if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ else
+ JAVACMD=java
+ fi
+fi
+
+if [ ! -x "$JAVACMD" ] ; then
+ echo "Error: JAVA_HOME is not defined correctly."
+ echo " We cannot execute $JAVACMD"
+ exit 1
+fi
+
+if [ -z "$JAVA_HOME" ] ; then
+ echo "Warning: JAVA_HOME environment variable is not set."
+fi
+
+CLASSWORLDS_LAUNCHER=org.codehaus.classworlds.Launcher
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin; then
+ [ -n "$M2_HOME" ] &&
+ M2_HOME=`cygpath --path --windows "$M2_HOME"`
+ [ -n "$JAVA_HOME" ] &&
+ JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
+ [ -n "$HOME" ] &&
+ HOME=`cygpath --path --windows "$HOME"`
+fi
+
+exec "$JAVACMD" \
+ $INT_MAVEN_OPTS \
+ -classpath "${M2_HOME}"/boot/classworlds-*.jar \
+ "-Dclassworlds.conf=${M2_HOME}/bin/m2.conf" \
+ "-Dmaven.home=${M2_HOME}" \
+ ${CLASSWORLDS_LAUNCHER} $QUOTED_ARGS
+
+
Property changes on: build/trunk/lib/maven/bin/mvnDebug
___________________________________________________________________
Name: svn:executable
+ *
Added: build/trunk/lib/maven/bin/mvnDebug.bat
===================================================================
--- build/trunk/lib/maven/bin/mvnDebug.bat (rev 0)
+++ build/trunk/lib/maven/bin/mvnDebug.bat 2010-01-16 15:05:47 UTC (rev 5484)
@@ -0,0 +1,192 @@
+@REM ----------------------------------------------------------------------------
+@REM Licensed to the Apache Software Foundation (ASF) under one
+@REM or more contributor license agreements. See the NOTICE file
+@REM distributed with this work for additional information
+@REM regarding copyright ownership. The ASF licenses this file
+@REM to you under the Apache License, Version 2.0 (the
+@REM "License"); you may not use this file except in compliance
+@REM with the License. You may obtain a copy of the License at
+@REM
+@REM http://www.apache.org/licenses/LICENSE-2.0
+@REM
+@REM Unless required by applicable law or agreed to in writing,
+@REM software distributed under the License is distributed on an
+@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+@REM KIND, either express or implied. See the License for the
+@REM specific language governing permissions and limitations
+@REM under the License.
+@REM ----------------------------------------------------------------------------
+
+@REM ----------------------------------------------------------------------------
+@REM Maven2 Start Up Batch script
+@REM
+@REM Required ENV vars:
+@REM JAVA_HOME - location of a JDK home dir
+@REM
+@REM Optional ENV vars
+@REM M2_HOME - location of maven2's installed home dir
+@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
+@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending
+@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
+@REM e.g. to debug Maven itself, use
+@REM set MAVEN_OPTS=-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
+@REM ----------------------------------------------------------------------------
+
+set INT_MAVEN_OPTS=%MAVEN_OPTS% -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
+@echo Preparing to Execute Maven in Debug Mode
+
+@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
+@echo off
+@REM enable echoing my setting MAVEN_BATCH_ECHO to 'on'
+@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO%
+
+@REM set %HOME% to equivalent of $HOME
+if "%HOME%" == "" (set HOME=%HOMEDRIVE%%HOMEPATH%)
+
+@REM Execute a user defined script before this one
+if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat"
+
+set ERROR_CODE=0
+
+@REM set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" @setlocal
+if "%OS%"=="WINNT" @setlocal
+
+@REM ==== START VALIDATION ====
+if not "%JAVA_HOME%" == "" goto OkJHome
+
+echo.
+echo ERROR: JAVA_HOME not found in your environment.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation
+echo.
+goto error
+
+:OkJHome
+if exist "%JAVA_HOME%\bin\java.exe" goto chkMHome
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory.
+echo JAVA_HOME = %JAVA_HOME%
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation
+echo.
+goto error
+
+:chkMHome
+if not "%M2_HOME%"=="" goto valMHome
+
+if "%OS%"=="Windows_NT" SET M2_HOME=%~dp0..
+if "%OS%"=="WINNT" SET M2_HOME=%~dp0..
+if not "%M2_HOME%"=="" goto valMHome
+
+echo.
+echo ERROR: M2_HOME not found in your environment.
+echo Please set the M2_HOME variable in your environment to match the
+echo location of the Maven installation
+echo.
+goto error
+
+:valMHome
+
+:stripMHome
+if not _%M2_HOME:~-1%==_\ goto checkMBat
+set M2_HOME=%M2_HOME:~0,-1%
+goto stripMHome
+
+:checkMBat
+if exist "%M2_HOME%\bin\mvn.bat" goto init
+
+echo.
+echo ERROR: M2_HOME is set to an invalid directory.
+echo M2_HOME = %M2_HOME%
+echo Please set the M2_HOME variable in your environment to match the
+echo location of the Maven installation
+echo.
+goto error
+@REM ==== END VALIDATION ====
+
+:init
+@REM Decide how to startup depending on the version of windows
+
+@REM -- Windows NT with Novell Login
+if "%OS%"=="WINNT" goto WinNTNovell
+
+@REM -- Win98ME
+if NOT "%OS%"=="Windows_NT" goto Win9xArg
+
+:WinNTNovell
+
+@REM -- 4NT shell
+if "%@eval[2+2]" == "4" goto 4NTArgs
+
+@REM -- Regular WinNT shell
+set MAVEN_CMD_LINE_ARGS=%*
+goto endInit
+
+@REM The 4NT Shell from jp software
+:4NTArgs
+set MAVEN_CMD_LINE_ARGS=%$
+goto endInit
+
+:Win9xArg
+@REM Slurp the command line arguments. This loop allows for an unlimited number
+@REM of agruments (up to the command line limit, anyway).
+set MAVEN_CMD_LINE_ARGS=
+:Win9xApp
+if %1a==a goto endInit
+set MAVEN_CMD_LINE_ARGS=%MAVEN_CMD_LINE_ARGS% %1
+shift
+goto Win9xApp
+
+@REM Reaching here means variables are defined and arguments have been captured
+:endInit
+SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
+
+@REM -- 4NT shell
+if "%@eval[2+2]" == "4" goto 4NTCWJars
+
+@REM -- Regular WinNT shell
+for %%i in ("%M2_HOME%"\boot\classworlds-*) do set CLASSWORLDS_JAR="%%i"
+goto runm2
+
+@REM The 4NT Shell from jp software
+:4NTCWJars
+for %%i in ("%M2_HOME%\boot\classworlds-*") do set CLASSWORLDS_JAR="%%i"
+goto runm2
+
+@REM Start MAVEN2
+:runm2
+
+%MAVEN_JAVA_EXE% %INT_MAVEN_OPTS% -classpath %CLASSWORLDS_JAR% "-Dclassworlds.conf=%M2_HOME%\bin\m2.conf" "-Dmaven.home=%M2_HOME%" org.codehaus.classworlds.Launcher %MAVEN_CMD_LINE_ARGS%
+if ERRORLEVEL 1 goto error
+goto end
+
+:error
+if "%OS%"=="Windows_NT" @endlocal
+if "%OS%"=="WINNT" @endlocal
+set ERROR_CODE=1
+
+:end
+@REM set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" goto endNT
+if "%OS%"=="WINNT" goto endNT
+
+@REM For old DOS remove the set variables from ENV - we assume they were not set
+@REM before we started - at least we don't leave any baggage around
+set MAVEN_JAVA_EXE=
+set MAVEN_CMD_LINE_ARGS=
+goto postExec
+
+:endNT
+@endlocal & set ERROR_CODE=%ERROR_CODE%
+
+:postExec
+if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat"
+@REM pause the batch file if MAVEN_BATCH_PAUSE is set to 'on'
+if "%MAVEN_BATCH_PAUSE%" == "on" pause
+
+if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE%
+
+exit /B %ERROR_CODE%
+
Added: build/trunk/lib/maven/boot/classworlds-1.1.jar
===================================================================
(Binary files differ)
Property changes on: build/trunk/lib/maven/boot/classworlds-1.1.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: build/trunk/lib/maven/conf/settings.xml
===================================================================
--- build/trunk/lib/maven/conf/settings.xml (rev 0)
+++ build/trunk/lib/maven/conf/settings.xml 2010-01-16 15:05:47 UTC (rev 5484)
@@ -0,0 +1,243 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you 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.
+-->
+
+<!--
+ | This is the configuration file for Maven. It can be specified at two levels:
+ |
+ | 1. User Level. This settings.xml file provides configuration for a single user,
+ | and is normally provided in $HOME/.m2/settings.xml.
+ |
+ | NOTE: This location can be overridden with the system property:
+ |
+ | -Dorg.apache.maven.user-settings=/path/to/user/settings.xml
+ |
+ | 2. Global Level. This settings.xml file provides configuration for all maven
+ | users on a machine (assuming they're all using the same maven
+ | installation). It's normally provided in
+ | ${maven.home}/conf/settings.xml.
+ |
+ | NOTE: This location can be overridden with the system property:
+ |
+ | -Dorg.apache.maven.global-settings=/path/to/global/settings.xml
+ |
+ | The sections in this sample file are intended to give you a running start at
+ | getting the most out of your Maven installation. Where appropriate, the default
+ | values (values used when the setting is not specified) are provided.
+ |
+ |-->
+<settings xmlns="http://maven.apache.org/settings/1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
+ <!-- localRepository
+ | The path to the local repository maven will use to store artifacts.
+ |
+ | Default: ~/.m2/repository
+ <localRepository>/path/to/local/repo</localRepository>
+ -->
+
+ <!-- interactiveMode
+ | This will determine whether maven prompts you when it needs input. If set to false,
+ | maven will use a sensible default value, perhaps based on some other setting, for
+ | the parameter in question.
+ |
+ | Default: true
+ <interactiveMode>true</interactiveMode>
+ -->
+
+ <!-- offline
+ | Determines whether maven should attempt to connect to the network when executing a build.
+ | This will have an effect on artifact downloads, artifact deployment, and others.
+ |
+ | Default: false
+ <offline>false</offline>
+ -->
+
+ <!-- proxies
+ | This is a list of proxies which can be used on this machine to connect to the network.
+ | Unless otherwise specified (by system property or command-line switch), the first proxy
+ | specification in this list marked as active will be used.
+ |-->
+ <proxies>
+ <!-- proxy
+ | Specification for one proxy, to be used in connecting to the network.
+ |
+ <proxy>
+ <id>optional</id>
+ <active>true</active>
+ <protocol>http</protocol>
+ <username>proxyuser</username>
+ <password>proxypass</password>
+ <host>proxy.host.net</host>
+ <port>80</port>
+ <nonProxyHosts>local.net|some.host.com</nonProxyHosts>
+ </proxy>
+ -->
+ </proxies>
+
+ <!-- servers
+ | This is a list of authentication profiles, keyed by the server-id used within the system.
+ | Authentication profiles can be used whenever maven must make a connection to a remote server.
+ |-->
+ <servers>
+ <!-- server
+ | Specifies the authentication information to use when connecting to a particular server, identified by
+ | a unique name within the system (referred to by the 'id' attribute below).
+ |
+ | NOTE: You should either specify username/password OR privateKey/passphrase, since these pairings are
+ | used together.
+ |
+ <server>
+ <id>deploymentRepo</id>
+ <username>repouser</username>
+ <password>repopwd</password>
+ </server>
+ -->
+
+ <!-- Another sample, using keys to authenticate.
+ <server>
+ <id>siteServer</id>
+ <privateKey>/path/to/private/key</privateKey>
+ <passphrase>optional; leave empty if not used.</passphrase>
+ </server>
+ -->
+ </servers>
+
+ <!-- mirrors
+ | This is a list of mirrors to be used in downloading artifacts from remote repositories.
+ |
+ | It works like this: a POM may declare a repository to use in resolving certain artifacts.
+ | However, this repository may have problems with heavy traffic at times, so people have mirrored
+ | it to several places.
+ |
+ | That repository definition will have a unique id, so we can create a mirror reference for that
+ | repository, to be used as an alternate download site. The mirror site will be the preferred
+ | server for that repository.
+ |-->
+ <mirrors>
+ <!-- mirror
+ | Specifies a repository mirror site to use instead of a given repository. The repository that
+ | this mirror serves has an ID that matches the mirrorOf element of this mirror. IDs are used
+ | for inheritance and direct lookup purposes, and must be unique across the set of mirrors.
+ |
+ <mirror>
+ <id>mirrorId</id>
+ <mirrorOf>repositoryId</mirrorOf>
+ <name>Human Readable Name for this Mirror.</name>
+ <url>http://my.repository.com/repo/path</url>
+ </mirror>
+ -->
+ </mirrors>
+
+ <!-- profiles
+ | This is a list of profiles which can be activated in a variety of ways, and which can modify
+ | the build process. Profiles provided in the settings.xml are intended to provide local machine-
+ | specific paths and repository locations which allow the build to work in the local environment.
+ |
+ | For example, if you have an integration testing plugin - like cactus - that needs to know where
+ | your Tomcat instance is installed, you can provide a variable here such that the variable is
+ | dereferenced during the build process to configure the cactus plugin.
+ |
+ | As noted above, profiles can be activated in a variety of ways. One way - the activeProfiles
+ | section of this document (settings.xml) - will be discussed later. Another way essentially
+ | relies on the detection of a system property, either matching a particular value for the property,
+ | or merely testing its existence. Profiles can also be activated by JDK version prefix, where a
+ | value of '1.4' might activate a profile when the build is executed on a JDK version of '1.4.2_07'.
+ | Finally, the list of active profiles can be specified directly from the command line.
+ |
+ | NOTE: For profiles defined in the settings.xml, you are restricted to specifying only artifact
+ | repositories, plugin repositories, and free-form properties to be used as configuration
+ | variables for plugins in the POM.
+ |
+ |-->
+ <profiles>
+ <!-- profile
+ | Specifies a set of introductions to the build process, to be activated using one or more of the
+ | mechanisms described above. For inheritance purposes, and to activate profiles via <activatedProfiles/>
+ | or the command line, profiles have to have an ID that is unique.
+ |
+ | An encouraged best practice for profile identification is to use a consistent naming convention
+ | for profiles, such as 'env-dev', 'env-test', 'env-production', 'user-jdcasey', 'user-brett', etc.
+ | This will make it more intuitive to understand what the set of introduced profiles is attempting
+ | to accomplish, particularly when you only have a list of profile id's for debug.
+ |
+ | This profile example uses the JDK version to trigger activation, and provides a JDK-specific repo.
+ <profile>
+ <id>jdk-1.4</id>
+
+ <activation>
+ <jdk>1.4</jdk>
+ </activation>
+
+ <repositories>
+ <repository>
+ <id>jdk14</id>
+ <name>Repository for JDK 1.4 builds</name>
+ <url>http://www.myhost.com/maven/jdk14</url>
+ <layout>default</layout>
+ <snapshotPolicy>always</snapshotPolicy>
+ </repository>
+ </repositories>
+ </profile>
+ -->
+
+ <!--
+ | Here is another profile, activated by the system property 'target-env' with a value of 'dev',
+ | which provides a specific path to the Tomcat instance. To use this, your plugin configuration
+ | might hypothetically look like:
+ |
+ | ...
+ | <plugin>
+ | <groupId>org.myco.myplugins</groupId>
+ | <artifactId>myplugin</artifactId>
+ |
+ | <configuration>
+ | <tomcatLocation>${tomcatPath}</tomcatLocation>
+ | </configuration>
+ | </plugin>
+ | ...
+ |
+ | NOTE: If you just wanted to inject this configuration whenever someone set 'target-env' to
+ | anything, you could just leave off the <value/> inside the activation-property.
+ |
+ <profile>
+ <id>env-dev</id>
+
+ <activation>
+ <property>
+ <name>target-env</name>
+ <value>dev</value>
+ </property>
+ </activation>
+
+ <properties>
+ <tomcatPath>/path/to/tomcat/instance</tomcatPath>
+ </properties>
+ </profile>
+ -->
+ </profiles>
+
+ <!-- activeProfiles
+ | List of profiles that are active for all builds.
+ |
+ <activeProfiles>
+ <activeProfile>alwaysActiveProfile</activeProfile>
+ <activeProfile>anotherAlwaysActiveProfile</activeProfile>
+ </activeProfiles>
+ -->
+</settings>
Added: build/trunk/lib/maven/lib/maven-2.0.10-uber.jar
===================================================================
(Binary files differ)
Property changes on: build/trunk/lib/maven/lib/maven-2.0.10-uber.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: build/trunk/lib/maven-ant-tasks.jar
===================================================================
(Binary files differ)
Property changes on: build/trunk/lib/maven-ant-tasks.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
16 years, 3 months
Weld SVN: r5483 - build/trunk/dist.
by weld-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2010-01-16 09:08:27 -0500 (Sat, 16 Jan 2010)
New Revision: 5483
Modified:
build/trunk/dist/build.xml
Log:
WELD-328
Modified: build/trunk/dist/build.xml
===================================================================
--- build/trunk/dist/build.xml 2010-01-16 14:04:40 UTC (rev 5482)
+++ build/trunk/dist/build.xml 2010-01-16 14:08:27 UTC (rev 5483)
@@ -20,6 +20,11 @@
<target name="setup">
<fail unless="examples.dir" message="You must specify the examples directory with -Dexamples.dir=~/workspace/examples" />
<fail unless="weld.dir" message="You must specify the examples directory with -Dweld.dir=~/workspace/weld" />
+ <fail unless="weld.version" message="You must specify the weld.version as a property" />
+ <fail unless="weld.api.version" message="You must specify the weld.api.version as a property" />
+ <fail unless="weld.wicket.version" message="You must specify the weld.wicket.version as a property" />
+ <fail unless="weld.se.version" message="You must specify the weld.se.version as a property" />
+ <fail unless="weld.servlet.version" message="You must specify the weld.servlet.version as a property" />
<maven target="clean" basedir="${examples.dir}" />
<delete dir="${weld.dir}/jboss-as/target" />
<delete dir="${dist.dir}" failonerror="false" />
@@ -28,13 +33,6 @@
<target name="dist" description="Build the distribution" depends="setup, docs">
- <fail unless="weld.version" message="You must specify the weld.version as a property" />
- <fail unless="weld.api.version" message="You must specify the weld.api.version as a property" />
- <fail unless="weld.extensions.version" message="You must specify the weld.extensions.version as a property" />
- <fail unless="weld.dir" message="You must specify the examples directory with -Dweld.dir=~/workspace/weld" />
- <fail unless="examples.dir" message="You must specify the examples directory with -Dexamples.dir=~/workspace/examples" />
-
-
<copy todir="${dist.dir}">
<fileset dir="${weld.dir}">
<include name="jboss-as/**" />
@@ -56,12 +54,11 @@
<dependency groupId="javax.enterprise" artifactId="cdi-api" version="${weld.api.version}" />
<dependency groupId="org.jboss.weld" artifactId="weld-core" version="${weld.version}" />
<dependency groupId="org.jboss.weld" artifactId="weld-spi" version="${weld.api.version}" />
- <dependency groupId="org.jboss.weld" artifactId="weld-logger" version="${weld.extensions.version}" />
- <dependency groupId="org.jboss.weld" artifactId="weld-wicket" version="${weld.extensions.version}" />
- <dependency groupId="org.jboss.weld" artifactId="weld-se" version="${weld.extensions.version}" />
- <dependency groupId="org.jboss.weld.servlet" artifactId="weld-servlet" version="${weld.extensions.version}" />
- <dependency groupId="org.jboss.weld.servlet" artifactId="weld-servlet-int" version="${weld.extensions.version}" />
- <dependency groupId="org.jboss.weld.servlet" artifactId="weld-tomcat-support" version="${weld.extensions.version}" />
+ <dependency groupId="org.jboss.weld" artifactId="weld-wicket" version="${weld.wicket.version}" />
+ <dependency groupId="org.jboss.weld" artifactId="weld-se" version="${weld.se.version}" />
+ <dependency groupId="org.jboss.weld.servlet" artifactId="weld-servlet" version="${weld.servlet.version}" />
+ <dependency groupId="org.jboss.weld.servlet" artifactId="weld-servlet-int" version="${weld.servlet.version}" />
+ <dependency groupId="org.jboss.weld.servlet" artifactId="weld-tomcat-support" version="${weld.servlet.version}" />
<remoteRepository id="repository.jboss.org" url="http://repository.jboss.org/maven2" />
</artifact:dependencies>
16 years, 3 months
Weld SVN: r5482 - core/trunk/jboss-as.
by weld-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2010-01-16 09:04:40 -0500 (Sat, 16 Jan 2010)
New Revision: 5482
Modified:
core/trunk/jboss-as/build.properties
Log:
WELD-285
Modified: core/trunk/jboss-as/build.properties
===================================================================
--- core/trunk/jboss-as/build.properties 2010-01-15 19:38:17 UTC (rev 5481)
+++ core/trunk/jboss-as/build.properties 2010-01-16 14:04:40 UTC (rev 5482)
@@ -7,8 +7,3 @@
# maximum number of TCK tests to deploy before restarting JBoss AS
# max.deployments.restart = 25
-weld-deployer.version=6.0.0-SNAPSHOT
-weld.version=1.0.1-SNAPSHOT
-jboss-ejb3.version=1.0.0
-javassist.version=3.11.0.GA
-validation.version=1.0.CR3
16 years, 3 months
Weld SVN: r5481 - api/trunk/cdi/src/main/resources.
by weld-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2010-01-15 14:38:17 -0500 (Fri, 15 Jan 2010)
New Revision: 5481
Added:
api/trunk/cdi/src/main/resources/beans_1_0.xsd
Removed:
api/trunk/cdi/src/main/resources/beans.xsd
Log:
WELD-378
Deleted: api/trunk/cdi/src/main/resources/beans.xsd
===================================================================
--- api/trunk/cdi/src/main/resources/beans.xsd 2010-01-15 18:52:18 UTC (rev 5480)
+++ api/trunk/cdi/src/main/resources/beans.xsd 2010-01-15 19:38:17 UTC (rev 5481)
@@ -1,180 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
- <!--
- 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.
- -->
-
-<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="qualified" targetNamespace="http://java.sun.com/xml/ns/javaee"
- xmlns:javaee="http://java.sun.com/xml/ns/javaee" version="1.0">
-
- <xs:annotation>
- <xs:documentation>
- Contexts and Dependency Injection (CDI) defines
- a set of complementary services that help improve the structure
- of application code. beans.xml is used to enable CDI services
- for the current bean archive as well as to enable named
- interceptors, decorators and alternatives for the current bean
- archive.
- </xs:documentation>
- </xs:annotation>
-
- <xs:element name="beans">
- <xs:annotation>
- <xs:documentation>
- Bean classes of enabled beans must be
- deployed in bean archives. A library jar, EJB jar,
- application client jar or rar archive is a bean archive if
- it has a file named beans.xml in the META-INF directory. The
- WEB-INF/classes directory of a war is a bean archive if
- there is a file named beans.xml in the WEB-INF directory of
- the war. A directory in the JVM classpath is a bean archive
- if it has a file named beans.xml in the META-INF directory.
- </xs:documentation>
- </xs:annotation>
- <xs:complexType>
- <xs:all>
- <xs:element ref="javaee:interceptors" minOccurs="0" />
- <xs:element ref="javaee:decorators" minOccurs="0" />
- <xs:element ref="javaee:alternatives" minOccurs="0" />
- </xs:all>
- </xs:complexType>
- </xs:element>
-
- <xs:element name="interceptors">
- <xs:annotation>
- <xs:documentation>
- By default, a bean archive has no enabled
- interceptors bound via interceptor bindings. An interceptor
- must be explicitly enabled by listing its class under the
- <interceptors> element of the beans.xml file of the
- bean archive. The order of the interceptor declarations
- determines the interceptor ordering. Interceptors which
- occur earlier in the list are called first. If the same
- class is listed twice under the <interceptors>
- element, the container automatically detects the problem and
- treats it as a deployment problem.
- </xs:documentation>
- </xs:annotation>
- <xs:complexType>
- <xs:choice minOccurs="0" maxOccurs="unbounded">
- <xs:element name="class" type="xs:string">
- <xs:annotation>
- <xs:documentation>
- Each child <class> element
- must specify the name of an interceptor class. If
- there is no class with the specified name, or if
- the class with the specified name is not an
- interceptor class, the container automatically
- detects the problem and treats it as a deployment
- problem.
- </xs:documentation>
- </xs:annotation>
- </xs:element>
- </xs:choice>
- </xs:complexType>
- </xs:element>
-
- <xs:element name="decorators">
- <xs:annotation>
- <xs:documentation>
- By default, a bean archive has no enabled
- decorators. A decorator must be explicitly enabled by
- listing its bean class under the <decorators> element
- of the beans.xml file of the bean archive. The order of the
- decorator declarations determines the decorator ordering.
- Decorators which occur earlier in the list are called first.
- If the same class is listed twice under the
- <decorators> element, the container automatically
- detects the problem and treats it as a deployment problem.
- </xs:documentation>
- </xs:annotation>
- <xs:complexType>
- <xs:choice minOccurs="0" maxOccurs="unbounded">
- <xs:element name="class" type="xs:string">
- <xs:annotation>
- <xs:documentation>
- Each child <class> element
- must specify the name of a decorator class. If
- there is no class with the specified name, or if
- the class with the specified name is not a
- decorator class, the container automatically
- detects the problem and treats it as a deployment
- problem.
- </xs:documentation>
- </xs:annotation>
- </xs:element>
- </xs:choice>
- </xs:complexType>
- </xs:element>
-
- <xs:element name="alternatives">
- <xs:annotation>
- <xs:documentation>
- An alternative is a bean that must be
- explicitly declared in the beans.xml file if it should be
- available for lookup, injection or EL resolution. By
- default, a bean archive has no selected alternatives. An
- alternative must be explicitly declared using the
- <alternatives> element of the beans.xml file of the
- bean archive. The <alternatives> element contains a
- list of bean classes and stereotypes. An alternative is
- selected for the bean archive if either: the alternative is
- a managed bean or session bean and the bean class of the
- bean is listed, or the alternative is a producer method,
- field or resource, and the bean class that declares the
- method or field is listed, or any @Alternative stereotype of
- the alternative is listed.
- </xs:documentation>
- </xs:annotation>
- <xs:complexType>
- <xs:choice minOccurs="0" maxOccurs="unbounded">
- <xs:element name="class" type="xs:string">
- <xs:annotation>
- <xs:documentation>
- Each child <class> element
- must specify the name of an alternative bean class.
- If there is no class with the specified name, or if
- the class with the specified name is not an
- alternative bean class, the container automatically
- detects the problem and treats it as a deployment
- problem. If the same class is listed twice under
- the <alternatives> element, the container
- automatically detects the problem and treats it as
- a deployment problem.
- </xs:documentation>
- </xs:annotation>
- </xs:element>
-
- <xs:element name="stereotype" type="xs:string">
- <xs:annotation>
- <xs:documentation>
- Each child <stereotype>
- element must specify the name of an @Alternative
- stereotype annotation. If there is no annotation
- with the specified name, or the annotation is not
- an @Alternative stereotype, the container
- automatically detects the problem and treats it as
- a deployment problem. If the same stereotype is
- listed twice under the <alternatives>
- element, the container automatically detects the
- problem and treats it as a deployment problem.
- </xs:documentation>
- </xs:annotation>
- </xs:element>
- </xs:choice>
- </xs:complexType>
- </xs:element>
-
-</xs:schema>
Copied: api/trunk/cdi/src/main/resources/beans_1_0.xsd (from rev 5455, api/trunk/cdi/src/main/resources/beans.xsd)
===================================================================
--- api/trunk/cdi/src/main/resources/beans_1_0.xsd (rev 0)
+++ api/trunk/cdi/src/main/resources/beans_1_0.xsd 2010-01-15 19:38:17 UTC (rev 5481)
@@ -0,0 +1,180 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+ <!--
+ 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.
+ -->
+
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ elementFormDefault="qualified" targetNamespace="http://java.sun.com/xml/ns/javaee"
+ xmlns:javaee="http://java.sun.com/xml/ns/javaee" version="1.0">
+
+ <xs:annotation>
+ <xs:documentation>
+ Contexts and Dependency Injection (CDI) defines
+ a set of complementary services that help improve the structure
+ of application code. beans.xml is used to enable CDI services
+ for the current bean archive as well as to enable named
+ interceptors, decorators and alternatives for the current bean
+ archive.
+ </xs:documentation>
+ </xs:annotation>
+
+ <xs:element name="beans">
+ <xs:annotation>
+ <xs:documentation>
+ Bean classes of enabled beans must be
+ deployed in bean archives. A library jar, EJB jar,
+ application client jar or rar archive is a bean archive if
+ it has a file named beans.xml in the META-INF directory. The
+ WEB-INF/classes directory of a war is a bean archive if
+ there is a file named beans.xml in the WEB-INF directory of
+ the war. A directory in the JVM classpath is a bean archive
+ if it has a file named beans.xml in the META-INF directory.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:all>
+ <xs:element ref="javaee:interceptors" minOccurs="0" />
+ <xs:element ref="javaee:decorators" minOccurs="0" />
+ <xs:element ref="javaee:alternatives" minOccurs="0" />
+ </xs:all>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="interceptors">
+ <xs:annotation>
+ <xs:documentation>
+ By default, a bean archive has no enabled
+ interceptors bound via interceptor bindings. An interceptor
+ must be explicitly enabled by listing its class under the
+ <interceptors> element of the beans.xml file of the
+ bean archive. The order of the interceptor declarations
+ determines the interceptor ordering. Interceptors which
+ occur earlier in the list are called first. If the same
+ class is listed twice under the <interceptors>
+ element, the container automatically detects the problem and
+ treats it as a deployment problem.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element name="class" type="xs:string">
+ <xs:annotation>
+ <xs:documentation>
+ Each child <class> element
+ must specify the name of an interceptor class. If
+ there is no class with the specified name, or if
+ the class with the specified name is not an
+ interceptor class, the container automatically
+ detects the problem and treats it as a deployment
+ problem.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:choice>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="decorators">
+ <xs:annotation>
+ <xs:documentation>
+ By default, a bean archive has no enabled
+ decorators. A decorator must be explicitly enabled by
+ listing its bean class under the <decorators> element
+ of the beans.xml file of the bean archive. The order of the
+ decorator declarations determines the decorator ordering.
+ Decorators which occur earlier in the list are called first.
+ If the same class is listed twice under the
+ <decorators> element, the container automatically
+ detects the problem and treats it as a deployment problem.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element name="class" type="xs:string">
+ <xs:annotation>
+ <xs:documentation>
+ Each child <class> element
+ must specify the name of a decorator class. If
+ there is no class with the specified name, or if
+ the class with the specified name is not a
+ decorator class, the container automatically
+ detects the problem and treats it as a deployment
+ problem.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:choice>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="alternatives">
+ <xs:annotation>
+ <xs:documentation>
+ An alternative is a bean that must be
+ explicitly declared in the beans.xml file if it should be
+ available for lookup, injection or EL resolution. By
+ default, a bean archive has no selected alternatives. An
+ alternative must be explicitly declared using the
+ <alternatives> element of the beans.xml file of the
+ bean archive. The <alternatives> element contains a
+ list of bean classes and stereotypes. An alternative is
+ selected for the bean archive if either: the alternative is
+ a managed bean or session bean and the bean class of the
+ bean is listed, or the alternative is a producer method,
+ field or resource, and the bean class that declares the
+ method or field is listed, or any @Alternative stereotype of
+ the alternative is listed.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element name="class" type="xs:string">
+ <xs:annotation>
+ <xs:documentation>
+ Each child <class> element
+ must specify the name of an alternative bean class.
+ If there is no class with the specified name, or if
+ the class with the specified name is not an
+ alternative bean class, the container automatically
+ detects the problem and treats it as a deployment
+ problem. If the same class is listed twice under
+ the <alternatives> element, the container
+ automatically detects the problem and treats it as
+ a deployment problem.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+
+ <xs:element name="stereotype" type="xs:string">
+ <xs:annotation>
+ <xs:documentation>
+ Each child <stereotype>
+ element must specify the name of an @Alternative
+ stereotype annotation. If there is no annotation
+ with the specified name, or the annotation is not
+ an @Alternative stereotype, the container
+ automatically detects the problem and treats it as
+ a deployment problem. If the same stereotype is
+ listed twice under the <alternatives>
+ element, the container automatically detects the
+ problem and treats it as a deployment problem.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:choice>
+ </xs:complexType>
+ </xs:element>
+
+</xs:schema>
Property changes on: api/trunk/cdi/src/main/resources/beans_1_0.xsd
___________________________________________________________________
Name: svn:mime-type
+ text/plain
16 years, 3 months
Weld SVN: r5480 - in core/trunk: impl/src/main/java/org/jboss/weld/bootstrap/events and 7 other directories.
by weld-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2010-01-15 13:52:18 -0500 (Fri, 15 Jan 2010)
New Revision: 5480
Added:
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/ExternalAnnotatedType.java
core/trunk/impl/src/main/java/org/jboss/weld/introspector/ForwardingAnnotatedType.java
core/trunk/impl/src/main/java/org/jboss/weld/util/AnnotatedTypes.java
core/trunk/tests/src/test/java/org/jboss/weld/tests/extensions/annotatedType/
core/trunk/tests/src/test/java/org/jboss/weld/tests/extensions/annotatedType/AnnotatedTypeExtension.java
core/trunk/tests/src/test/java/org/jboss/weld/tests/extensions/annotatedType/AnnotatedTypeExtensionTest.java
core/trunk/tests/src/test/java/org/jboss/weld/tests/extensions/annotatedType/EcoFriendlyWashingMachine.java
core/trunk/tests/src/test/java/org/jboss/weld/tests/extensions/annotatedType/FastWashingMachine.java
core/trunk/tests/src/test/java/org/jboss/weld/tests/extensions/annotatedType/Laundry.java
core/trunk/tests/src/test/java/org/jboss/weld/tests/extensions/annotatedType/WashingMachine.java
core/trunk/tests/src/test/resources/org/jboss/weld/tests/extensions/annotatedType/
core/trunk/tests/src/test/resources/org/jboss/weld/tests/extensions/annotatedType/javax.enterprise.inject.spi.Extension
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/bean/ManagedBean.java
core/trunk/impl/src/main/java/org/jboss/weld/bean/NewManagedBean.java
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/BeforeBeanDiscoveryImpl.java
core/trunk/impl/src/main/java/org/jboss/weld/introspector/ForwardingAnnotated.java
core/trunk/impl/src/main/java/org/jboss/weld/introspector/ForwardingWeldAnnotated.java
core/trunk/impl/src/main/java/org/jboss/weld/introspector/ForwardingWeldClass.java
core/trunk/impl/src/main/java/org/jboss/weld/introspector/WeldClass.java
core/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/WeldClassImpl.java
Log:
WELD-335
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bean/ManagedBean.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bean/ManagedBean.java 2010-01-15 16:36:27 UTC (rev 5479)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bean/ManagedBean.java 2010-01-15 18:52:18 UTC (rev 5480)
@@ -61,6 +61,7 @@
import org.jboss.weld.manager.BeanManagerImpl;
import org.jboss.weld.metadata.cache.MetaAnnotationStore;
import org.jboss.weld.serialization.spi.helpers.SerializableContextual;
+import org.jboss.weld.util.AnnotatedTypes;
import org.jboss.weld.util.Beans;
import org.jboss.weld.util.reflection.Reflections;
import org.slf4j.cal10n.LocLogger;
@@ -101,15 +102,31 @@
*/
public static <T> ManagedBean<T> of(WeldClass<T> clazz, BeanManagerImpl beanManager)
{
- return new ManagedBean<T>(clazz, createId(ManagedBean.class.getSimpleName(), clazz), beanManager);
+ if (clazz.isDiscovered())
+ {
+ return new ManagedBean<T>(clazz, createSimpleId(ManagedBean.class.getSimpleName(), clazz), beanManager);
+ }
+ else
+ {
+ return new ManagedBean<T>(clazz, createId(ManagedBean.class.getSimpleName(), clazz), beanManager);
+ }
}
- protected static String createId(String beanType, WeldClass<?> clazz)
+ protected static String createSimpleId(String beanType, WeldClass<?> clazz)
{
return new StringBuilder().append(beanType).append(BEAN_ID_SEPARATOR).append(clazz.getBaseType()).toString();
}
/**
+ * create a more complete id for types that have been added through the SPI
+ * to prevent duplicate id's
+ */
+ protected static String createId(String beanType, WeldClass<?> clazz)
+ {
+ return new StringBuilder().append(beanType).append(BEAN_ID_SEPARATOR).append(AnnotatedTypes.createTypeId(clazz)).toString();
+ }
+
+ /**
* Constructor
*
* @param type The type of the bean
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bean/NewManagedBean.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bean/NewManagedBean.java 2010-01-15 16:36:27 UTC (rev 5479)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bean/NewManagedBean.java 2010-01-15 18:52:18 UTC (rev 5480)
@@ -43,7 +43,14 @@
*/
public static <T> NewManagedBean<T> of(WeldClass<T> clazz, BeanManagerImpl beanManager)
{
- return new NewManagedBean<T>(clazz, createId(NewManagedBean.class.getSimpleName(), clazz), beanManager);
+ if (clazz.isDiscovered())
+ {
+ return new NewManagedBean<T>(clazz, createSimpleId(NewManagedBean.class.getSimpleName(), clazz), beanManager);
+ }
+ else
+ {
+ return new NewManagedBean<T>(clazz, createId(NewManagedBean.class.getSimpleName(), clazz), beanManager);
+ }
}
private Set<Annotation> bindings;
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/BeforeBeanDiscoveryImpl.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/BeforeBeanDiscoveryImpl.java 2010-01-15 16:36:27 UTC (rev 5479)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/BeforeBeanDiscoveryImpl.java 2010-01-15 18:52:18 UTC (rev 5480)
@@ -25,16 +25,40 @@
import org.jboss.weld.bootstrap.BeanDeployment;
import org.jboss.weld.bootstrap.spi.BeanDeploymentArchive;
import org.jboss.weld.bootstrap.spi.Deployment;
-import org.jboss.weld.literal.QualifierLiteral;
+import org.jboss.weld.introspector.ForwardingAnnotatedType;
import org.jboss.weld.literal.InterceptorBindingTypeLiteral;
import org.jboss.weld.literal.NormalScopeLiteral;
+import org.jboss.weld.literal.QualifierLiteral;
import org.jboss.weld.literal.ScopeLiteral;
import org.jboss.weld.literal.StereotypeLiteral;
import org.jboss.weld.manager.BeanManagerImpl;
public class BeforeBeanDiscoveryImpl extends AbstractBeanDiscoveryEvent implements BeforeBeanDiscovery
{
+
+ private static class ExternalAnnotatedTypeWrapper<X> extends ForwardingAnnotatedType<X> implements ExternalAnnotatedType
+ {
+
+ public static <X> AnnotatedType<X> of(AnnotatedType<X> annotatedType)
+ {
+ return new ExternalAnnotatedTypeWrapper<X>(annotatedType);
+ }
+
+ private final AnnotatedType<X> delegate;
+ private ExternalAnnotatedTypeWrapper(AnnotatedType<X> delegate)
+ {
+ this.delegate = delegate;
+ }
+
+ @Override
+ protected AnnotatedType<X> delegate()
+ {
+ return delegate;
+ }
+
+ }
+
public static void fire(BeanManagerImpl beanManager, Deployment deployment, Map<BeanDeploymentArchive, BeanDeployment> beanDeployments)
{
new BeforeBeanDiscoveryImpl(beanManager, deployment, beanDeployments).fire(beanDeployments);
@@ -78,7 +102,7 @@
public void addAnnotatedType(AnnotatedType<?> type)
{
- getOrCreateBeanDeployment(type.getJavaClass()).getBeanDeployer().addClass(type);
+ getOrCreateBeanDeployment(type.getJavaClass()).getBeanDeployer().addClass(ExternalAnnotatedTypeWrapper.of(type));
}
}
Added: core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/ExternalAnnotatedType.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/ExternalAnnotatedType.java (rev 0)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/ExternalAnnotatedType.java 2010-01-15 18:52:18 UTC (rev 5480)
@@ -0,0 +1,6 @@
+package org.jboss.weld.bootstrap.events;
+
+public interface ExternalAnnotatedType
+{
+
+}
Property changes on: core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/ExternalAnnotatedType.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Modified: core/trunk/impl/src/main/java/org/jboss/weld/introspector/ForwardingAnnotated.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/introspector/ForwardingAnnotated.java 2010-01-15 16:36:27 UTC (rev 5479)
+++ core/trunk/impl/src/main/java/org/jboss/weld/introspector/ForwardingAnnotated.java 2010-01-15 18:52:18 UTC (rev 5480)
@@ -30,7 +30,7 @@
* @param <T> the base type
* @param <S> the annotated element type
*/
-public abstract class ForwardingAnnotated<T, S> implements Annotated
+public abstract class ForwardingAnnotated implements Annotated
{
protected abstract Annotated delegate();
Added: core/trunk/impl/src/main/java/org/jboss/weld/introspector/ForwardingAnnotatedType.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/introspector/ForwardingAnnotatedType.java (rev 0)
+++ core/trunk/impl/src/main/java/org/jboss/weld/introspector/ForwardingAnnotatedType.java 2010-01-15 18:52:18 UTC (rev 5480)
@@ -0,0 +1,42 @@
+package org.jboss.weld.introspector;
+
+import java.util.Set;
+
+import javax.enterprise.inject.spi.AnnotatedConstructor;
+import javax.enterprise.inject.spi.AnnotatedField;
+import javax.enterprise.inject.spi.AnnotatedMethod;
+import javax.enterprise.inject.spi.AnnotatedType;
+
+/**
+ * Forwarding implementation of AnnotatedType
+ *
+ * @author Stuart Douglas <stuart(a)baileyroberts.com.au>
+ *
+ */
+public abstract class ForwardingAnnotatedType<X> extends ForwardingAnnotated implements AnnotatedType<X>
+{
+
+ @Override
+ protected abstract AnnotatedType<X> delegate();
+
+ public Set<AnnotatedConstructor<X>> getConstructors()
+ {
+ return delegate().getConstructors();
+ }
+
+ public Set<AnnotatedField<? super X>> getFields()
+ {
+ return delegate().getFields();
+ }
+
+ public Class<X> getJavaClass()
+ {
+ return delegate().getJavaClass();
+ }
+
+ public Set<AnnotatedMethod<? super X>> getMethods()
+ {
+ return delegate().getMethods();
+ }
+
+}
Property changes on: core/trunk/impl/src/main/java/org/jboss/weld/introspector/ForwardingAnnotatedType.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Modified: core/trunk/impl/src/main/java/org/jboss/weld/introspector/ForwardingWeldAnnotated.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/introspector/ForwardingWeldAnnotated.java 2010-01-15 16:36:27 UTC (rev 5479)
+++ core/trunk/impl/src/main/java/org/jboss/weld/introspector/ForwardingWeldAnnotated.java 2010-01-15 18:52:18 UTC (rev 5480)
@@ -28,7 +28,7 @@
* @param <T>
* @param <S>
*/
-public abstract class ForwardingWeldAnnotated<T, S> extends ForwardingAnnotated<T, S> implements WeldAnnotated<T, S>
+public abstract class ForwardingWeldAnnotated<T, S> extends ForwardingAnnotated implements WeldAnnotated<T, S>
{
public Type[] getActualTypeArguments()
Modified: core/trunk/impl/src/main/java/org/jboss/weld/introspector/ForwardingWeldClass.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/introspector/ForwardingWeldClass.java 2010-01-15 16:36:27 UTC (rev 5479)
+++ core/trunk/impl/src/main/java/org/jboss/weld/introspector/ForwardingWeldClass.java 2010-01-15 18:52:18 UTC (rev 5480)
@@ -169,4 +169,8 @@
return delegate().getDeclaredMetaAnnotations(metaAnnotationType);
}
+ public boolean isDiscovered()
+ {
+ return delegate().isDiscovered();
+ }
}
Modified: core/trunk/impl/src/main/java/org/jboss/weld/introspector/WeldClass.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/introspector/WeldClass.java 2010-01-15 16:36:27 UTC (rev 5479)
+++ core/trunk/impl/src/main/java/org/jboss/weld/introspector/WeldClass.java 2010-01-15 18:52:18 UTC (rev 5480)
@@ -185,6 +185,8 @@
public boolean isAnonymousClass();
public boolean isSerializable();
+
+ public boolean isDiscovered();
public <S> S cast(Object object);
Modified: core/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/WeldClassImpl.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/WeldClassImpl.java 2010-01-15 16:36:27 UTC (rev 5479)
+++ core/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/WeldClassImpl.java 2010-01-15 18:52:18 UTC (rev 5480)
@@ -37,6 +37,7 @@
import javax.enterprise.inject.spi.AnnotatedMethod;
import javax.enterprise.inject.spi.AnnotatedType;
+import org.jboss.weld.bootstrap.events.ExternalAnnotatedType;
import org.jboss.weld.introspector.ConstructorSignature;
import org.jboss.weld.introspector.MethodSignature;
import org.jboss.weld.introspector.WeldClass;
@@ -108,6 +109,8 @@
// meta-annotation) of the item
private final SetMultimap<Class<? extends Annotation>, Annotation> declaredMetaAnnotationMap;
+ private final boolean discovered;
+
public static <T> WeldClass<T> of(Class<T> clazz, ClassTransformer classTransformer)
{
return new WeldClassImpl<T>(clazz, clazz, null, new HierarchyDiscovery(clazz).getTypeClosure(), buildAnnotationMap(clazz.getAnnotations()), buildAnnotationMap(clazz.getDeclaredAnnotations()), classTransformer);
@@ -127,6 +130,15 @@
{
super(annotationMap, declaredAnnotationMap, classTransformer, rawType, type, typeClosure);
+ if (annotatedType instanceof ExternalAnnotatedType)
+ {
+ discovered = false;
+ }
+ else
+ {
+ discovered = true;
+ }
+
if (rawType.getSuperclass() != null)
{
this.superclass = classTransformer.loadClass(rawType.getSuperclass());
@@ -630,4 +642,9 @@
return Collections.unmodifiableSet(declaredMetaAnnotationMap.get(metaAnnotationType));
}
+ public boolean isDiscovered()
+ {
+ return discovered;
+ }
+
}
\ No newline at end of file
Added: core/trunk/impl/src/main/java/org/jboss/weld/util/AnnotatedTypes.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/util/AnnotatedTypes.java (rev 0)
+++ core/trunk/impl/src/main/java/org/jboss/weld/util/AnnotatedTypes.java 2010-01-15 18:52:18 UTC (rev 5480)
@@ -0,0 +1,415 @@
+/*
+ * 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.util;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.lang.reflect.Type;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.List;
+import java.util.Set;
+
+import javax.enterprise.inject.spi.AnnotatedCallable;
+import javax.enterprise.inject.spi.AnnotatedConstructor;
+import javax.enterprise.inject.spi.AnnotatedField;
+import javax.enterprise.inject.spi.AnnotatedMethod;
+import javax.enterprise.inject.spi.AnnotatedParameter;
+import javax.enterprise.inject.spi.AnnotatedType;
+
+/**
+ * Class that can take an AnnotatedType and return a unique string
+ * representation of that type
+ *
+ * @author Stuart Douglas <stuart(a)baileyroberts.com.au>
+ */
+public class AnnotatedTypes
+{
+
+ /**
+ * Does the first stage of comparing AnnoatedCallables, however it cannot
+ * compare the method parameters
+ */
+ private static class AnnotatedCallableComparator<T> implements Comparator<AnnotatedCallable<? super T>>
+ {
+
+ public int compare(AnnotatedCallable<? super T> arg0, AnnotatedCallable<? super T> arg1)
+ {
+ // compare the names first
+ int result = (arg0.getJavaMember().getName().compareTo(arg1.getJavaMember().getName()));
+ if (result != 0)
+ {
+ return result;
+ }
+ result = arg0.getJavaMember().getDeclaringClass().getName().compareTo(arg1.getJavaMember().getDeclaringClass().getName());
+ if (result != 0)
+ {
+ return result;
+ }
+ result = arg0.getParameters().size() - arg1.getParameters().size();
+ return result;
+ }
+
+ }
+
+ private static class AnnotatedMethodComparator<T> implements Comparator<AnnotatedMethod<? super T>>
+ {
+
+ public static <T> Comparator<AnnotatedMethod<? super T>> instance()
+ {
+ return new AnnotatedMethodComparator<T>();
+ }
+
+ private AnnotatedCallableComparator<T> callableComparator = new AnnotatedCallableComparator<T>();
+
+ public int compare(AnnotatedMethod<? super T> arg0, AnnotatedMethod<? super T> arg1)
+ {
+ int result = callableComparator.compare(arg0, arg1);
+ if (result != 0)
+ {
+ return result;
+ }
+ for (int i = 0; i < arg0.getJavaMember().getParameterTypes().length; ++i)
+ {
+ Class<?> p0 = arg0.getJavaMember().getParameterTypes()[i];
+ Class<?> p1 = arg1.getJavaMember().getParameterTypes()[i];
+ result = p0.getName().compareTo(p1.getName());
+ if (result != 0)
+ {
+ return result;
+ }
+ }
+ return 0;
+ }
+
+ }
+
+ private static class AnnotatedConstructorComparator<T> implements Comparator<AnnotatedConstructor<? super T>>
+ {
+
+ public static <T> Comparator<AnnotatedConstructor<? super T>> instance()
+ {
+ return new AnnotatedConstructorComparator<T>();
+ }
+
+ private AnnotatedCallableComparator<T> callableComparator = new AnnotatedCallableComparator<T>();
+
+ public int compare(AnnotatedConstructor<? super T> arg0, AnnotatedConstructor<? super T> arg1)
+ {
+ int result = callableComparator.compare(arg0, arg1);
+ if (result != 0)
+ {
+ return result;
+ }
+ for (int i = 0; i < arg0.getJavaMember().getParameterTypes().length; ++i)
+ {
+ Class<?> p0 = arg0.getJavaMember().getParameterTypes()[i];
+ Class<?> p1 = arg1.getJavaMember().getParameterTypes()[i];
+ result = p0.getName().compareTo(p1.getName());
+ if (result != 0)
+ {
+ return result;
+ }
+ }
+ return 0;
+ }
+
+ }
+
+ private static class AnnotatedFieldComparator<T> implements Comparator<AnnotatedField<? super T>>
+ {
+
+ public static <T> Comparator<AnnotatedField<? super T>> instance()
+ {
+ return new AnnotatedFieldComparator<T>();
+ }
+
+ public int compare(AnnotatedField<? super T> arg0, AnnotatedField<? super T> arg1)
+ {
+ if (arg0.getJavaMember().getName().equals(arg1.getJavaMember().getName()))
+ {
+ return arg0.getJavaMember().getDeclaringClass().getName().compareTo(arg1.getJavaMember().getDeclaringClass().getName());
+ }
+ return arg0.getJavaMember().getName().compareTo(arg1.getJavaMember().getName());
+ }
+
+ }
+
+ private static class AnnotationComparator implements Comparator<Annotation>
+ {
+
+ public static final Comparator<Annotation> INSTANCE = new AnnotationComparator();
+
+ public int compare(Annotation arg0, Annotation arg1)
+ {
+ return arg0.annotationType().getName().compareTo(arg1.annotationType().getName());
+ }
+ }
+
+ private static class MethodComparator implements Comparator<Method>
+ {
+
+ public static final Comparator<Method> INSTANCE = new MethodComparator();
+
+ public int compare(Method arg0, Method arg1)
+ {
+ return arg0.getName().compareTo(arg1.getName());
+ }
+ }
+
+ private static final char SEPERATOR = ';';
+
+ /**
+ * Generates a unique signature for an annotated type. Members without
+ * annotations are omitted to reduce the length of the signature
+ *
+ * @param <X>
+ * @param annotatedType
+ * @return
+ */
+ public static <X> String createTypeId(AnnotatedType<X> annotatedType)
+ {
+ return createTypeId(annotatedType.getJavaClass(), annotatedType.getAnnotations(), annotatedType.getMethods(), annotatedType.getFields(), annotatedType.getConstructors());
+ }
+
+ /**
+ * Generates a unique signature for a concrete class
+ *
+ * @param <X>
+ * @param annotatedType
+ * @return
+ */
+ public static <X> String createTypeId(Class<X> clazz, Collection<Annotation> annotations, Collection<AnnotatedMethod<? super X>> methods, Collection<AnnotatedField<? super X>> fields, Collection<AnnotatedConstructor<X>> constructors)
+ {
+ StringBuilder builder = new StringBuilder();
+
+ builder.append(clazz.getName());
+ builder.append(createAnnotationCollectionId(annotations));
+ builder.append("{ ");
+
+ // now deal with the fields
+ List<AnnotatedField<? super X>> sortedFields = new ArrayList<AnnotatedField<? super X>>();
+ sortedFields.addAll(fields);
+ Collections.sort(sortedFields, AnnotatedFieldComparator.<X> instance());
+ for (AnnotatedField<? super X> field : sortedFields)
+ {
+ if (!field.getAnnotations().isEmpty())
+ {
+ builder.append(createFieldId(field));
+ builder.append(SEPERATOR);
+ }
+ }
+
+ // methods
+ List<AnnotatedMethod<? super X>> sortedMethods = new ArrayList<AnnotatedMethod<? super X>>();
+ sortedMethods.addAll(methods);
+ Collections.sort(sortedMethods, AnnotatedMethodComparator.<X> instance());
+ for (AnnotatedMethod<? super X> method : sortedMethods)
+ {
+ if (!method.getAnnotations().isEmpty() || hasMethodParameters(method))
+ {
+ builder.append(createCallableId(method));
+ builder.append(SEPERATOR);
+ }
+ }
+
+ // constructors
+ List<AnnotatedConstructor<? super X>> sortedConstructors = new ArrayList<AnnotatedConstructor<? super X>>();
+ sortedConstructors.addAll(constructors);
+ Collections.sort(sortedConstructors, AnnotatedConstructorComparator.<X> instance());
+ for (AnnotatedConstructor<? super X> constructor : sortedConstructors)
+ {
+ if (!constructor.getAnnotations().isEmpty() || hasMethodParameters(constructor))
+ {
+ builder.append(createCallableId(constructor));
+ builder.append(SEPERATOR);
+ }
+ }
+ builder.append("}");
+
+ return builder.toString();
+ }
+
+ private static <X> boolean hasMethodParameters(AnnotatedCallable<X> callable)
+ {
+ for (AnnotatedParameter<X> parameter : callable.getParameters())
+ {
+ if (parameter.getAnnotations().isEmpty())
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ private static String createAnnotationCollectionId(Collection<Annotation> annotations)
+ {
+ if (annotations.isEmpty())
+ {
+ return "";
+ }
+
+ StringBuilder builder = new StringBuilder();
+ builder.append('[');
+
+ List<Annotation> annotationList = new ArrayList<Annotation>(annotations.size());
+ annotationList.addAll(annotations);
+ Collections.sort(annotationList, AnnotationComparator.INSTANCE);
+
+ for (Annotation a : annotationList)
+ {
+ builder.append('@');
+ builder.append(a.annotationType().getName());
+ builder.append('(');
+ Method[] declaredMethods = a.annotationType().getDeclaredMethods();
+ List<Method> methods = new ArrayList<Method>(declaredMethods.length);
+ // TODO Shouldn't the declared methods be added here?
+ Collections.sort(methods, MethodComparator.INSTANCE);
+
+ for (int i = 0; i < methods.size(); ++i)
+ {
+ Method method = methods.get(i);
+ try
+ {
+ Object value = method.invoke(a);
+ builder.append(method.getName());
+ builder.append('=');
+ builder.append(value.toString());
+ }
+ catch (NullPointerException e)
+ {
+ throw new RuntimeException("NullPointerException accessing annotation member, annotation:" + a.annotationType().getName() + " member: " + method.getName(), e);
+ }
+ catch (IllegalArgumentException e)
+ {
+ throw new RuntimeException("IllegalArgumentException accessing annotation member, annotation:" + a.annotationType().getName() + " member: " + method.getName(), e);
+ }
+ catch (IllegalAccessException e)
+ {
+ throw new RuntimeException("IllegalAccessException accessing annotation member, annotation:" + a.annotationType().getName() + " member: " + method.getName(), e);
+ }
+ catch (InvocationTargetException e)
+ {
+ throw new RuntimeException("InvocationTargetException accessing annotation member, annotation:" + a.annotationType().getName() + " member: " + method.getName(), e);
+ }
+ if (i + 1 != methods.size())
+ {
+ builder.append(',');
+ }
+ }
+ builder.append(')');
+ }
+ builder.append(']');
+ return builder.toString();
+ }
+
+ public static <X> String createFieldId(AnnotatedField<X> field)
+ {
+ return createFieldId(field.getJavaMember(), field.getAnnotations());
+ }
+
+ public static <X> String createFieldId(Field field, Collection<Annotation> annotations)
+ {
+ StringBuilder builder = new StringBuilder();
+ builder.append(field.getDeclaringClass().getName());
+ builder.append('.');
+ builder.append(field.getName());
+ builder.append(createAnnotationCollectionId(annotations));
+ return builder.toString();
+ }
+
+ public static <X> String createCallableId(AnnotatedCallable<X> method)
+ {
+ StringBuilder builder = new StringBuilder();
+ builder.append(method.getJavaMember().getDeclaringClass().getName());
+ builder.append('.');
+ builder.append(method.getJavaMember().getName());
+ builder.append(createAnnotationCollectionId(method.getAnnotations()));
+ builder.append(createParameterListId(method.getParameters()));
+ return builder.toString();
+ }
+
+ public static <X> String createMethodId(Method method, Set<Annotation> annotations, List<AnnotatedParameter<X>> parameters)
+ {
+ StringBuilder builder = new StringBuilder();
+ builder.append(method.getDeclaringClass().getName());
+ builder.append('.');
+ builder.append(method.getName());
+ builder.append(createAnnotationCollectionId(annotations));
+ builder.append(createParameterListId(parameters));
+ return builder.toString();
+ }
+
+ public static <X> String createConstructorId(Constructor<X> constructor, Set<Annotation> annotations, List<AnnotatedParameter<X>> parameters)
+ {
+ StringBuilder builder = new StringBuilder();
+ builder.append(constructor.getDeclaringClass().getName());
+ builder.append('.');
+ builder.append(constructor.getName());
+ builder.append(createAnnotationCollectionId(annotations));
+ builder.append(createParameterListId(parameters));
+ return builder.toString();
+ }
+
+ public static <X> String createParameterListId(List<AnnotatedParameter<X>> parameters)
+ {
+ StringBuilder builder = new StringBuilder();
+ builder.append("(");
+ for (int i = 0; i < parameters.size(); ++i)
+ {
+ AnnotatedParameter<X> ap = parameters.get(i);
+ builder.append(createParameterId(ap));
+ if (i + 1 != parameters.size())
+ {
+ builder.append(',');
+ }
+ }
+ builder.append(")");
+ return builder.toString();
+ }
+
+ public static <X> String createParameterId(AnnotatedParameter<X> annotatedParameter)
+ {
+ return createParameterId(annotatedParameter.getBaseType(), annotatedParameter.getAnnotations());
+ }
+
+ public static <X> String createParameterId(Type type, Set<Annotation> annotations)
+ {
+ StringBuilder builder = new StringBuilder();
+ if (type instanceof Class<?>)
+ {
+ Class<?> c = (Class<?>) type;
+ builder.append(c.getName());
+ }
+ else
+ {
+ builder.append(type.toString());
+ }
+ builder.append(createAnnotationCollectionId(annotations));
+ return builder.toString();
+ }
+
+ private AnnotatedTypes()
+ {
+ }
+
+}
Property changes on: core/trunk/impl/src/main/java/org/jboss/weld/util/AnnotatedTypes.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Added: core/trunk/tests/src/test/java/org/jboss/weld/tests/extensions/annotatedType/AnnotatedTypeExtension.java
===================================================================
--- core/trunk/tests/src/test/java/org/jboss/weld/tests/extensions/annotatedType/AnnotatedTypeExtension.java (rev 0)
+++ core/trunk/tests/src/test/java/org/jboss/weld/tests/extensions/annotatedType/AnnotatedTypeExtension.java 2010-01-15 18:52:18 UTC (rev 5480)
@@ -0,0 +1,91 @@
+package org.jboss.weld.tests.extensions.annotatedType;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Type;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.enterprise.event.Observes;
+import javax.enterprise.inject.spi.AnnotatedConstructor;
+import javax.enterprise.inject.spi.AnnotatedField;
+import javax.enterprise.inject.spi.AnnotatedMethod;
+import javax.enterprise.inject.spi.AnnotatedType;
+import javax.enterprise.inject.spi.BeforeBeanDiscovery;
+import javax.enterprise.inject.spi.Extension;
+import javax.enterprise.util.AnnotationLiteral;
+
+public class AnnotatedTypeExtension implements Extension
+{
+
+ public static class EcoFriendlyWashingMachineLiteral extends AnnotationLiteral<EcoFriendlyWashingMachine> implements EcoFriendlyWashingMachine
+ {
+
+ public static final EcoFriendlyWashingMachine INSTANCE = new EcoFriendlyWashingMachineLiteral();
+
+ }
+
+ /**
+ * Adds an eco friendly wasing machine
+ * @param beforeBeanDiscovery
+ */
+ public void addWashingMachine(@Observes BeforeBeanDiscovery beforeBeanDiscovery)
+ {
+ beforeBeanDiscovery.addAnnotatedType(new AnnotatedType<WashingMachine>()
+ {
+
+ public Set<AnnotatedConstructor<WashingMachine>> getConstructors()
+ {
+ return Collections.emptySet();
+ }
+
+ public Set<AnnotatedField<? super WashingMachine>> getFields()
+ {
+ return Collections.emptySet();
+ }
+
+ public Class<WashingMachine> getJavaClass()
+ {
+ return WashingMachine.class;
+ }
+
+ public Set<AnnotatedMethod<? super WashingMachine>> getMethods()
+ {
+ return Collections.emptySet();
+ }
+
+ public <T extends Annotation> T getAnnotation(Class<T> annotationType)
+ {
+ if(annotationType == EcoFriendlyWashingMachine.class)
+ {
+ return annotationType.cast(EcoFriendlyWashingMachineLiteral.INSTANCE);
+ }
+ return null;
+ }
+
+ public Set<Annotation> getAnnotations()
+ {
+ return Collections.<Annotation>singleton(EcoFriendlyWashingMachineLiteral.INSTANCE);
+ }
+
+ public Type getBaseType()
+ {
+ return WashingMachine.class;
+ }
+
+ public Set<Type> getTypeClosure()
+ {
+ Set<Type> ret = new HashSet<Type>();
+ ret.add(Object.class);
+ ret.add(WashingMachine.class);
+ return ret;
+ }
+
+ public boolean isAnnotationPresent(Class<? extends Annotation> annotationType)
+ {
+ return annotationType == EcoFriendlyWashingMachine.class;
+ }
+
+ });
+ }
+}
Property changes on: core/trunk/tests/src/test/java/org/jboss/weld/tests/extensions/annotatedType/AnnotatedTypeExtension.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Added: core/trunk/tests/src/test/java/org/jboss/weld/tests/extensions/annotatedType/AnnotatedTypeExtensionTest.java
===================================================================
--- core/trunk/tests/src/test/java/org/jboss/weld/tests/extensions/annotatedType/AnnotatedTypeExtensionTest.java (rev 0)
+++ core/trunk/tests/src/test/java/org/jboss/weld/tests/extensions/annotatedType/AnnotatedTypeExtensionTest.java 2010-01-15 18:52:18 UTC (rev 5480)
@@ -0,0 +1,27 @@
+package org.jboss.weld.tests.extensions.annotatedType;
+
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.IntegrationTest;
+import org.jboss.testharness.impl.packaging.Packaging;
+import org.jboss.testharness.impl.packaging.PackagingType;
+import org.jboss.testharness.impl.packaging.jsr299.Extension;
+import org.jboss.weld.test.AbstractWeldTest;
+import org.testng.annotations.Test;
+
+@Artifact
+@IntegrationTest
+(a)Packaging(PackagingType.EAR)
+@Extension("javax.enterprise.inject.spi.Extension")
+public class AnnotatedTypeExtensionTest extends AbstractWeldTest
+{
+
+ @Test
+ public void testMultipleBeansOfSameType()
+ {
+ Laundry laundry = getReference(Laundry.class);
+ assert laundry.ecoFriendlyWashingMachine != null;
+ assert laundry.fastWashingMachine != null;
+ }
+
+
+}
Property changes on: core/trunk/tests/src/test/java/org/jboss/weld/tests/extensions/annotatedType/AnnotatedTypeExtensionTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Added: core/trunk/tests/src/test/java/org/jboss/weld/tests/extensions/annotatedType/EcoFriendlyWashingMachine.java
===================================================================
--- core/trunk/tests/src/test/java/org/jboss/weld/tests/extensions/annotatedType/EcoFriendlyWashingMachine.java (rev 0)
+++ core/trunk/tests/src/test/java/org/jboss/weld/tests/extensions/annotatedType/EcoFriendlyWashingMachine.java 2010-01-15 18:52:18 UTC (rev 5480)
@@ -0,0 +1,22 @@
+package org.jboss.weld.tests.extensions.annotatedType;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.inject.Qualifier;
+
+@Target( { TYPE, METHOD, PARAMETER, FIELD })
+@Retention(RUNTIME)
+@Documented
+@Qualifier
+public @interface EcoFriendlyWashingMachine
+{
+
+}
Property changes on: core/trunk/tests/src/test/java/org/jboss/weld/tests/extensions/annotatedType/EcoFriendlyWashingMachine.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Added: core/trunk/tests/src/test/java/org/jboss/weld/tests/extensions/annotatedType/FastWashingMachine.java
===================================================================
--- core/trunk/tests/src/test/java/org/jboss/weld/tests/extensions/annotatedType/FastWashingMachine.java (rev 0)
+++ core/trunk/tests/src/test/java/org/jboss/weld/tests/extensions/annotatedType/FastWashingMachine.java 2010-01-15 18:52:18 UTC (rev 5480)
@@ -0,0 +1,22 @@
+package org.jboss.weld.tests.extensions.annotatedType;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.inject.Qualifier;
+
+@Target( { TYPE, METHOD, PARAMETER, FIELD })
+@Retention(RUNTIME)
+@Documented
+@Qualifier
+public @interface FastWashingMachine
+{
+
+}
Property changes on: core/trunk/tests/src/test/java/org/jboss/weld/tests/extensions/annotatedType/FastWashingMachine.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Added: core/trunk/tests/src/test/java/org/jboss/weld/tests/extensions/annotatedType/Laundry.java
===================================================================
--- core/trunk/tests/src/test/java/org/jboss/weld/tests/extensions/annotatedType/Laundry.java (rev 0)
+++ core/trunk/tests/src/test/java/org/jboss/weld/tests/extensions/annotatedType/Laundry.java 2010-01-15 18:52:18 UTC (rev 5480)
@@ -0,0 +1,12 @@
+package org.jboss.weld.tests.extensions.annotatedType;
+
+import javax.inject.Inject;
+
+public class Laundry
+{
+ @Inject @FastWashingMachine
+ public WashingMachine fastWashingMachine;
+
+ @Inject @EcoFriendlyWashingMachine
+ public WashingMachine ecoFriendlyWashingMachine;
+}
Property changes on: core/trunk/tests/src/test/java/org/jboss/weld/tests/extensions/annotatedType/Laundry.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Added: core/trunk/tests/src/test/java/org/jboss/weld/tests/extensions/annotatedType/WashingMachine.java
===================================================================
--- core/trunk/tests/src/test/java/org/jboss/weld/tests/extensions/annotatedType/WashingMachine.java (rev 0)
+++ core/trunk/tests/src/test/java/org/jboss/weld/tests/extensions/annotatedType/WashingMachine.java 2010-01-15 18:52:18 UTC (rev 5480)
@@ -0,0 +1,7 @@
+package org.jboss.weld.tests.extensions.annotatedType;
+
+@FastWashingMachine
+public class WashingMachine
+{
+
+}
Property changes on: core/trunk/tests/src/test/java/org/jboss/weld/tests/extensions/annotatedType/WashingMachine.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Added: core/trunk/tests/src/test/resources/org/jboss/weld/tests/extensions/annotatedType/javax.enterprise.inject.spi.Extension
===================================================================
--- core/trunk/tests/src/test/resources/org/jboss/weld/tests/extensions/annotatedType/javax.enterprise.inject.spi.Extension (rev 0)
+++ core/trunk/tests/src/test/resources/org/jboss/weld/tests/extensions/annotatedType/javax.enterprise.inject.spi.Extension 2010-01-15 18:52:18 UTC (rev 5480)
@@ -0,0 +1 @@
+org.jboss.weld.tests.extensions.annotatedType.AnnotatedTypeExtension
16 years, 3 months