Replace guava 11 with 16 and extract Guava as a separate dependency.
Also, tidy up a teensy bit of test infrastructure, make sure OSGI test is excluded since it's designed for ant-only, and make maven tests fork, as they run out of permgen consistently. Lastly, make the build system enforce a 1.6 minimum, not a 1.5 minimum.
diff --git a/build.properties b/build.properties
index a76a5ab..d8bf543 100644
--- a/build.properties
+++ b/build.properties
@@ -32,4 +32,4 @@
com.google.inject.persist.jpa
test.class=com.google.inject.AllTests
module=com.google.inject
-imports=!net.sf.cglib.*,!org.objectweb.asm.*,!com.google.common.*
+imports=!net.sf.cglib.*,!org.objectweb.asm.*
diff --git a/build.xml b/build.xml
index 51d2cb1..d5bc437 100644
--- a/build.xml
+++ b/build.xml
@@ -31,34 +31,34 @@
<ant antfile="extensions/grapher/build.xml" target="distjars" inheritAll="false"/>
<copy toDir="${build.dir}/dist">
- <fileset dir="extensions/servlet/build" includes="*.jar" excludes="*-with-deps.jar"/>
+ <fileset dir="extensions/servlet/build" includes="*.jar"/>
</copy>
<copy toDir="${build.dir}/dist">
- <fileset dir="extensions/spring/build" includes="*.jar" excludes="*-with-deps.jar"/>
+ <fileset dir="extensions/spring/build" includes="*.jar"/>
</copy>
<copy toDir="${build.dir}/dist">
- <fileset dir="extensions/struts2/build" includes="*.jar" excludes="*-with-deps.jar"/>
+ <fileset dir="extensions/struts2/build" includes="*.jar"/>
</copy>
<copy toDir="${build.dir}/dist">
- <fileset dir="extensions/assistedinject/build" includes="*.jar" excludes="*-with-deps.jar"/>
+ <fileset dir="extensions/assistedinject/build" includes="*.jar"/>
</copy>
<copy toDir="${build.dir}/dist">
- <fileset dir="extensions/jmx/build" includes="*.jar" excludes="*-with-deps.jar"/>
+ <fileset dir="extensions/jmx/build" includes="*.jar"/>
</copy>
<copy toDir="${build.dir}/dist">
- <fileset dir="extensions/jndi/build" includes="*.jar" excludes="*-with-deps.jar"/>
+ <fileset dir="extensions/jndi/build" includes="*.jar"/>
</copy>
<copy toDir="${build.dir}/dist">
- <fileset dir="extensions/throwingproviders/build" includes="*.jar" excludes="*-with-deps.jar"/>
+ <fileset dir="extensions/throwingproviders/build" includes="*.jar"/>
</copy>
<copy toDir="${build.dir}/dist">
- <fileset dir="extensions/multibindings/build" includes="*.jar" excludes="*-with-deps.jar"/>
+ <fileset dir="extensions/multibindings/build" includes="*.jar"/>
</copy>
<copy toDir="${build.dir}/dist">
- <fileset dir="extensions/persist/build" includes="*.jar" excludes="*-with-deps.jar"/>
+ <fileset dir="extensions/persist/build" includes="*.jar"/>
</copy>
<copy toDir="${build.dir}/dist">
- <fileset dir="extensions/grapher/build" includes="*.jar" excludes="*-with-deps.jar"/>
+ <fileset dir="extensions/grapher/build" includes="*.jar"/>
</copy>
<copy toDir="${build.dir}/dist" file="COPYING"/>
@@ -93,7 +93,7 @@
</target>
<target name="test.dist.run"
- depends="jar, test.compile-with-deps"
+ depends="jar, test.withdeps"
description="Execute JUnit tests against distribution jar with the given jvmarg.">
<java fork="true"
classname="junit.textui.TestRunner"
@@ -102,11 +102,12 @@
<classpath>
<pathelement location="${build.dir}/guice-${version}-tests.jar"/>
<pathelement location="${build.dir}/dist/guice-${version}.jar"/>
+ <pathelement location="lib/javax.inject.jar"/>
<pathelement location="lib/aopalliance.jar"/>
+ <pathelement location="lib/guava-16.0.1.jar"/>
<pathelement location="lib/build/junit.jar"/>
<pathelement location="lib/build/servlet-api-2.5.jar"/>
<pathelement location="lib/build/easymock.jar"/>
- <pathelement location="lib/javax.inject.jar"/>
<pathelement location="lib/build/javax.inject-tck.jar"/>
<pathelement location="lib/build/bnd-0.0.384.jar"/>
<pathelement location="lib/build/felix-2.0.5.jar"/>
@@ -134,7 +135,7 @@
<javadoc packagenames="com.google.*"
docletpath="${jdiff.home}/jdiff.jar${path.separator}${jdiff.home}/xerces.jar"
maxmemory="512M"
- classpath="lib/javax.inject.jar${path.separator}lib/aopalliance.jar">
+ classpath="lib/javax.inject.jar${path.separator}lib/aopalliance.jar${path.separator}lib/guava-16.0.1.jar">
<fileset dir="${src.dir}" defaultexcludes="yes">
<include name="com/google/**"/>
<exclude name="com/google/inject/internal/**"/>
@@ -163,7 +164,7 @@
docletpath="${jdiff.home}/jdiff.jar${path.separator}${jdiff.home}/xerces.jar"
maxmemory="512M"
sourcefiles="${jdiff.home}/Null.java"
- classpath="lib/javax.inject.jar${path.separator}lib/aopalliance.jar">
+ classpath="lib/javax.inject.jar${path.separator}lib/aopalliance.jar${path.separator}lib/guava-16.0.1.jar">
<doclet name="jdiff.JDiff">
<param name="-oldapi" value="${old.api}"/>
<param name="-oldapidir" value="latest-api-diffs"/>
@@ -183,7 +184,7 @@
docletpath="lib/build/doclava.jar"
bootclasspath="${java.home}/lib/rt.jar"
maxmemory="512M"
- classpath="lib/javax.inject.jar${path.separator}lib/aopalliance.jar">
+ classpath="lib/javax.inject.jar${path.separator}lib/aopalliance.jar${path.separator}lib/guava-16.0.1.jar">
<fileset dir="${src.dir}" defaultexcludes="yes">
<include name="com/google/**"/>
<exclude name="com/google/inject/internal/**"/>
diff --git a/common.xml b/common.xml
index 1a7add9..0d091f8 100644
--- a/common.xml
+++ b/common.xml
@@ -14,7 +14,7 @@
<javac srcdir="${src.dir}"
debug="on"
destdir="${build.dir}/classes"
- source="1.5" target="1.5" includeantruntime="false">
+ source="1.6" target="1.6" includeantruntime="false">
<compilerarg value="-Xlint:all,-serial"/>
<classpath refid="compile.classpath"/>
</javac>
@@ -39,7 +39,7 @@
<property name="Bundle-DocURL" value="http://code.google.com/p/google-guice/"/>
<property name="Bundle-Copyright" value="Copyright (C) 2006 Google Inc."/>
<property name="Bundle-License" value="http://www.apache.org/licenses/LICENSE-2.0.txt"/>
- <property name="Bundle-RequiredExecutionEnvironment" value="J2SE-1.5,JavaSE-1.6"/>
+ <property name="Bundle-RequiredExecutionEnvironment" value="JavaSE-1.6"/>
<property name="Bundle-Vendor" value="Google, Inc."/>
<property name="Export-Package" value="!${module}.internal.*,${module}.*;version=${api.version}"/>
@@ -76,7 +76,7 @@
<javac srcdir="${test.dir}"
debug="on"
destdir="${build.dir}/test"
- source="1.5" target="1.5" includeantruntime="false">
+ source="1.6" target="1.6" includeantruntime="false">
<classpath path="${build.dir}/classes"/>
<classpath path="${build.dir}/test"/>
<classpath refid="compile.classpath"/>
@@ -119,7 +119,7 @@
depends="source.jar, jar"
description="Build jar files"/>
- <target name="test.compile-with-deps" depends="test.compile"
+ <target name="test.withdeps" depends="test.compile"
description="Build a jar of tests with internal.util refocused.">
<mkdir dir="${build.dir}/dist"/>
<dirname property="common.basedir" file="${ant.file.common}"/>
@@ -131,10 +131,6 @@
<rule pattern="net.sf.cglib.**.*" result="com.google.inject.internal.cglib.@1.$@2"/>
<rule pattern="org.objectweb.asm.*" result="com.google.inject.internal.asm.$@1"/>
<rule pattern="org.objectweb.asm.**.*" result="com.google.inject.internal.asm.@1.$@2"/>
- <rule pattern="com.google.common.*" result="com.google.inject.internal.guava.$@1"/>
- <rule pattern="com.google.common.**.*" result="com.google.inject.internal.guava.@1.$@2"/>
- <rule pattern="javax.annotation.*.class" result="com.google.inject.internal.jsr305.$@1"/>
- <rule pattern="javax.annotation.**.*.class" result="com.google.inject.internal.jsr305.@1.$@2"/>
<keep pattern="com.google.inject.**"/>
<keep pattern="com.googlecode.**"/>
</jarjar>
@@ -150,35 +146,10 @@
<fileset dir="${build.dir}/classes"/>
<zipfileset src="${common.basedir}/lib/build/cglib-3.1.jar"/>
<zipfileset src="${common.basedir}/lib/build/asm-4.2.jar"/>
- <zipfileset src="${common.basedir}/lib/build/guava-11.0.1.jar"/>
<rule pattern="net.sf.cglib.*" result="com.google.inject.internal.cglib.$@1"/>
<rule pattern="net.sf.cglib.**.*" result="com.google.inject.internal.cglib.@1.$@2"/>
<rule pattern="org.objectweb.asm.*" result="com.google.inject.internal.asm.$@1"/>
<rule pattern="org.objectweb.asm.**.*" result="com.google.inject.internal.asm.@1.$@2"/>
- <rule pattern="com.google.common.*" result="com.google.inject.internal.guava.$@1"/>
- <rule pattern="com.google.common.**.*" result="com.google.inject.internal.guava.@1.$@2"/>
- <keep pattern="com.google.inject.**"/>
- <!-- the servlet extension uses this but core doesn't,
- so we explicitly instruct the build to keep it. -->
- <keep pattern="com.google.common.base.Throwables"/>
- </jarjar>
- </target>
-
- <target name="jar.withrenameddeps" depends="compile"
- description="Build jar with dependencies embedded.">
- <mkdir dir="${build.dir}/dist"/>
- <dirname property="common.basedir" file="${ant.file.common}"/>
- <taskdef name="jarjar" classname="com.tonicsystems.jarjar.JarJarTask"
- classpath="${common.basedir}/lib/build/jarjar-1.1.jar"/>
- <jarjar jarfile="${build.dir}/${ant.project.name}-with-deps.jar">
- <zipfileset src="${common.basedir}/lib/build/cglib-3.1.jar"><include name="LICENSE"/><include name="NOTICE"/></zipfileset>
- <fileset dir="${build.dir}/classes"/>
- <rule pattern="net.sf.cglib.*" result="com.google.inject.internal.cglib.$@1"/>
- <rule pattern="net.sf.cglib.**.*" result="com.google.inject.internal.cglib.@1.$@2"/>
- <rule pattern="org.objectweb.asm.*" result="com.google.inject.internal.asm.$@1"/>
- <rule pattern="org.objectweb.asm.**.*" result="com.google.inject.internal.asm.@1.$@2"/>
- <rule pattern="com.google.common.*" result="com.google.inject.internal.guava.$@1"/>
- <rule pattern="com.google.common.**.*" result="com.google.inject.internal.guava.@1.$@2"/>
<keep pattern="com.google.inject.**"/>
</jarjar>
</target>
diff --git a/copy.sh b/copy.sh
deleted file mode 100755
index a3e2202..0000000
--- a/copy.sh
+++ /dev/null
@@ -1,54 +0,0 @@
-#!/bin/sh
-# Copies classes into Guice's internal package.
-
-client=/usr/local/google/clients/collect/google3
-
-srcdir=core/src/com/google/inject/internal
-testdir=core/test/com/google/inject/internal
-
-filter() {
- sed 's/com.google.common.base.internal/com.google.inject.internal/' | \
- sed 's/com.google.common.base/com.google.inject.internal/' | \
- sed 's/com.google.common.collect/com.google.inject.internal/'
-}
-
-copy() {
- inFile=$1;
- fileName=`basename $inFile`
- dest=$2
- destpath=$dest/$fileName
- filter < $client/${inFile} > $destpath
-}
-
-commonpath=java/com/google/common
-
-copy $commonpath/collect/ComputationException.java $srcdir
-copy $commonpath/collect/AsynchronousComputationException.java $srcdir
-copy $commonpath/collect/CustomConcurrentHashMap.java $srcdir
-copy $commonpath/collect/ExpirationTimer.java $srcdir
-copy $commonpath/collect/MapMaker.java $srcdir
-copy $commonpath/collect/NullOutputException.java $srcdir
-copy $commonpath/base/Function.java $srcdir
-copy $commonpath/base/Nullable.java $srcdir
-copy $commonpath/base/FinalizableReference.java $srcdir
-copy $commonpath/base/FinalizableReferenceQueue.java $srcdir
-copy $commonpath/base/internal/Finalizer.java $srcdir
-copy $commonpath/base/FinalizableWeakReference.java $srcdir
-copy $commonpath/base/FinalizableSoftReference.java $srcdir
-copy $commonpath/base/FinalizablePhantomReference.java $srcdir
-
-commontestspath=javatests/com/google/common
-
-copy $commontestspath/base/FinalizableReferenceQueueTest.java $testdir
-copy $commontestspath/collect/MapMakerTestSuite.java $testdir
-copy $commontestspath/collect/Jsr166HashMap.java $testdir
-copy $commontestspath/collect/Jsr166HashMapTest.java $testdir
-copy $commonpath/collect/ForwardingConcurrentMap.java $testdir
-copy $commonpath/collect/ForwardingMap.java $testdir
-copy $commonpath/collect/ForwardingCollection.java $testdir
-copy $commonpath/collect/ForwardingObject.java $testdir
-copy $commonpath/collect/ForwardingSet.java $testdir
-copy $commonpath/collect/ForwardingMap.java $testdir
-copy $commonpath/base/Preconditions.java $testdir
-
-chmod +w -R $srcdir $testdir
diff --git a/core/pom.xml b/core/pom.xml
index 97c8e60..3773300 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -13,11 +13,6 @@
<name>Google Guice - Core Library</name>
- <properties>
- <cglib.version>3.0</cglib.version>
- <asm.version>4.0</asm.version>
- </properties>
-
<dependencies>
<dependency>
<groupId>javax.inject</groupId>
@@ -32,17 +27,16 @@
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
- <version>11.0.1</version>
+ <version>16.0.1</version>
</dependency>
+ <!--
+ | CGLIB is embedded by default by the JarJar build profile
+ -->
<dependency>
<groupId>cglib</groupId>
<artifactId>cglib</artifactId>
- <version>${cglib.version}</version>
- </dependency>
- <dependency>
- <groupId>org.ow2.asm</groupId>
- <artifactId>asm-util</artifactId>
- <version>${asm.version}</version>
+ <version>3.1</version>
+ <optional>true</optional>
</dependency>
<dependency>
<groupId>javax.inject</groupId>
@@ -92,6 +86,8 @@
| Temporarily excluded tests
-->
<excludes>
+ <exclude>**/*$*</exclude>
+ <exclude>**/ErrorHandlingTest*</exclude>
<exclude>**/OSGiContainerTest*</exclude>
<exclude>**/ScopesTest*</exclude>
<exclude>**/TypeConversionTest*</exclude>
@@ -207,7 +203,7 @@
</profile>
<profile>
<!--
- | JarJar build profile: re-package ASM and CGLIB classes under the Guice namespace
+ | JarJar build profile: Embed CGLIB (and ASM) classes under a Guice namespace
-->
<id>guice.with.jarjar</id>
<activation>
@@ -216,35 +212,48 @@
<value>!false</value>
</property>
</activation>
- <dependencies>
- <!--
- | Mark as optional: embedded by JarJar
- -->
- <dependency>
- <groupId>cglib</groupId>
- <artifactId>cglib</artifactId>
- <version>${cglib.version}</version>
- <optional>true</optional>
- </dependency>
- <dependency>
- <groupId>org.ow2.asm</groupId>
- <artifactId>asm-util</artifactId>
- <version>${asm.version}</version>
- <optional>true</optional>
- </dependency>
- </dependencies>
<build>
<plugins>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>jarjar-maven-plugin</artifactId>
+ <version>1.8</version>
+ <executions>
+ <execution>
+ <id>jarjar</id>
+ <goals><goal>jarjar</goal></goals>
+ </execution>
+ </executions>
<configuration>
+ <overwrite>true</overwrite>
<includes>
<include>*:asm*</include>
<include>*:cglib</include>
- <include>*:guava</include>
- <include>*:jsr305</include>
</includes>
+ <rules>
+ <rule>
+ <pattern>net.sf.cglib.*</pattern>
+ <result>com.google.inject.internal.cglib.$@1</result>
+ </rule>
+ <rule>
+ <pattern>net.sf.cglib.**.*</pattern>
+ <result>com.google.inject.internal.cglib.@1.$@2</result>
+ </rule>
+ <rule>
+ <pattern>org.objectweb.asm.*</pattern>
+ <result>com.google.inject.internal.asm.$@1</result>
+ </rule>
+ <rule>
+ <pattern>org.objectweb.asm.**.*</pattern>
+ <result>com.google.inject.internal.asm.@1.$@2</result>
+ </rule>
+ <keep>
+ <pattern>com.google.inject.**</pattern>
+ </keep>
+ <keep>
+ <pattern>com.googlecode.**</pattern>
+ </keep>
+ </rules>
</configuration>
</plugin>
<plugin>
@@ -254,14 +263,17 @@
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
- <id>no_deps</id>
+ <id>classes</id>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<classesDirectory>${project.build.directory}/original-classes</classesDirectory>
- <classifier>no_deps</classifier>
+ <classifier>classes</classifier>
+ <archive>
+ <manifestFile combine.self="override" />
+ </archive>
</configuration>
</execution>
</executions>
@@ -269,6 +281,42 @@
</plugins>
</build>
</profile>
+ <profile>
+ <!--
+ | m2e profile - enable use of JarJar inside Eclipse
+ -->
+ <id>m2e</id>
+ <activation>
+ <property>
+ <name>m2e.version</name>
+ </property>
+ </activation>
+ <build>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.eclipse.m2e</groupId>
+ <artifactId>lifecycle-mapping</artifactId>
+ <version>1.0.0</version>
+ <configuration>
+ <lifecycleMappingMetadata>
+ <pluginExecutions>
+ <pluginExecution>
+ <pluginExecutionFilter>
+ <groupId>org.sonatype.plugins</groupId>
+ <artifactId>jarjar-maven-plugin</artifactId>
+ <versionRange>[1.4,)</versionRange>
+ <goals><goal>jarjar</goal></goals>
+ </pluginExecutionFilter>
+ <action><execute /></action>
+ </pluginExecution>
+ </pluginExecutions>
+ </lifecycleMappingMetadata>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+ </profile>
</profiles>
-
</project>
diff --git a/core/test/com/googlecode/guice/OSGiContainerTest.java b/core/test/com/googlecode/guice/OSGiContainerTest.java
index 77ab8fa..b91975f 100644
--- a/core/test/com/googlecode/guice/OSGiContainerTest.java
+++ b/core/test/com/googlecode/guice/OSGiContainerTest.java
@@ -58,6 +58,7 @@
static final String AOPALLIANCE_JAR = System.getProperty("aopalliance.jar", "lib/aopalliance.jar");
/*end[AOP]*/
static final String JAVAX_INJECT_JAR = System.getProperty("javax.inject.jar", "lib/javax.inject.jar");
+ static final String GUAVA_JAR = System.getProperty("guava.jar", "lib/guava-16.0.1.jar");
// dynamically build test bundles
@Override protected void setUp()
@@ -71,6 +72,7 @@
assertTrue(failMsg(), new File(AOPALLIANCE_JAR).isFile());
/*end[AOP]*/
assertTrue(failMsg(), new File(JAVAX_INJECT_JAR).isFile());
+ assertTrue(failMsg(), new File(GUAVA_JAR).isFile());
Properties instructions = new Properties();
@@ -86,6 +88,12 @@
buildBundle("javax.inject", instructions, JAVAX_INJECT_JAR);
instructions.clear();
+ // early versions of guava did not ship with OSGi metadata
+ instructions.setProperty("Export-Package", "com.google.common.*");
+ instructions.setProperty("Import-Package", "*;resolution:=optional");
+ buildBundle("guava", instructions, GUAVA_JAR);
+ instructions.clear();
+
// strict imports to make sure test bundle only has access to these packages
instructions.setProperty("Import-Package", "org.osgi.framework,"
/*if[AOP]*/
@@ -144,6 +152,7 @@
systemContext.installBundle("reference:file:" + BUILD_TEST_DIR + "/aopalliance.jar");
/*end[AOP]*/
systemContext.installBundle("reference:file:" + BUILD_TEST_DIR + "/javax.inject.jar");
+ systemContext.installBundle("reference:file:" + BUILD_TEST_DIR + "/guava.jar");
systemContext.installBundle("reference:file:" + GUICE_JAR);
systemContext.installBundle("reference:file:" + BUILD_TEST_DIR + "/osgitests.jar").start();
diff --git a/extensions/assistedinject/build.xml b/extensions/assistedinject/build.xml
index 16557de..c74a8f2 100644
--- a/extensions/assistedinject/build.xml
+++ b/extensions/assistedinject/build.xml
@@ -10,11 +10,10 @@
<pathelement path="../../build/classes"/>
</path>
- <target name="jar" depends="jar.withrenameddeps, manifest" description="Build jar.">
+ <target name="jar" depends="compile, manifest" description="Build jar.">
<jar destfile="${build.dir}/${ant.project.name}-${version}.jar"
manifest="${build.dir}/META-INF/MANIFEST.MF">
- <zipfileset src="${build.dir}/${ant.project.name}-with-deps.jar"
- excludes="com/google/inject/internal/**"/>
+ <fileset dir="${build.dir}/classes" />
</jar>
</target>
diff --git a/extensions/grapher/build.xml b/extensions/grapher/build.xml
index d36fdcd..77f2983 100644
--- a/extensions/grapher/build.xml
+++ b/extensions/grapher/build.xml
@@ -10,11 +10,10 @@
<pathelement path="../../build/classes"/>
</path>
- <target name="jar" depends="jar.withrenameddeps, manifest" description="Build jar.">
+ <target name="jar" depends="compile, manifest" description="Build jar.">
<jar destfile="${build.dir}/${ant.project.name}-${version}.jar"
manifest="${build.dir}/META-INF/MANIFEST.MF">
- <zipfileset src="${build.dir}/${ant.project.name}-with-deps.jar"
- excludes="com/google/inject/internal/**"/>
+ <fileset dir="${build.dir}/classes" />
</jar>
</target>
diff --git a/extensions/jmx/build.xml b/extensions/jmx/build.xml
index 1bdcb97..aeb7da7 100644
--- a/extensions/jmx/build.xml
+++ b/extensions/jmx/build.xml
@@ -10,11 +10,10 @@
<pathelement path="../../build/classes"/>
</path>
- <target name="jar" depends="jar.withrenameddeps, manifest" description="Build jar.">
+ <target name="jar" depends="compile, manifest" description="Build jar.">
<jar destfile="${build.dir}/${ant.project.name}-${version}.jar"
manifest="${build.dir}/META-INF/MANIFEST.MF">
- <zipfileset src="${build.dir}/${ant.project.name}-with-deps.jar"
- excludes="com/google/inject/internal/**"/>
+ <fileset dir="${build.dir}/classes" />
</jar>
</target>
diff --git a/extensions/jmx/pom.xml b/extensions/jmx/pom.xml
index 62c7d17..f3298e7 100644
--- a/extensions/jmx/pom.xml
+++ b/extensions/jmx/pom.xml
@@ -13,4 +13,14 @@
<name>Google Guice - Extensions - JMX</name>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <skip>true</skip> <!-- Test is not actually a unit test. -->
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
</project>
diff --git a/extensions/jndi/build.xml b/extensions/jndi/build.xml
index 14eaa8b..780fceb 100644
--- a/extensions/jndi/build.xml
+++ b/extensions/jndi/build.xml
@@ -10,11 +10,10 @@
<pathelement path="../../build/classes"/>
</path>
- <target name="jar" depends="jar.withrenameddeps, manifest" description="Build jar.">
+ <target name="jar" depends="compile, manifest" description="Build jar.">
<jar destfile="${build.dir}/${ant.project.name}-${version}.jar"
manifest="${build.dir}/META-INF/MANIFEST.MF">
- <zipfileset src="${build.dir}/${ant.project.name}-with-deps.jar"
- excludes="com/google/inject/internal/**"/>
+ <fileset dir="${build.dir}/classes" />
</jar>
</target>
diff --git a/extensions/multibindings/build.xml b/extensions/multibindings/build.xml
index 7a23462..f78a8e3 100644
--- a/extensions/multibindings/build.xml
+++ b/extensions/multibindings/build.xml
@@ -10,11 +10,10 @@
<pathelement path="../../build/classes"/>
</path>
- <target name="jar" depends="jar.withrenameddeps, manifest" description="Build jar.">
+ <target name="jar" depends="compile, manifest" description="Build jar.">
<jar destfile="${build.dir}/${ant.project.name}-${version}.jar"
manifest="${build.dir}/META-INF/MANIFEST.MF">
- <zipfileset src="${build.dir}/${ant.project.name}-with-deps.jar"
- excludes="com/google/inject/internal/**"/>
+ <fileset dir="${build.dir}/classes" />
</jar>
</target>
diff --git a/extensions/persist/build.xml b/extensions/persist/build.xml
index 9be40c8..3cc6a4f 100644
--- a/extensions/persist/build.xml
+++ b/extensions/persist/build.xml
@@ -11,11 +11,10 @@
<pathelement path="../../build/classes"/>
</path>
- <target name="jar" depends="jar.withrenameddeps, manifest" description="Build jar.">
+ <target name="jar" depends="compile, manifest" description="Build jar.">
<jar destfile="${build.dir}/${ant.project.name}-${version}.jar"
manifest="${build.dir}/META-INF/MANIFEST.MF">
- <zipfileset src="${build.dir}/${ant.project.name}-with-deps.jar"
- excludes="com/google/inject/internal/**"/>
+ <fileset dir="${build.dir}/classes" />
</jar>
</target>
diff --git a/extensions/persist/pom.xml b/extensions/persist/pom.xml
index 18b15a3..b3c4a34 100644
--- a/extensions/persist/pom.xml
+++ b/extensions/persist/pom.xml
@@ -44,17 +44,18 @@
<version>2.0.0</version>
<scope>test</scope>
</dependency>
+ <!-- These are present for IDEs which will not be pulling in the jarjar'ed value. -->
+ <dependency>
+ <groupId>cglib</groupId>
+ <artifactId>cglib</artifactId>
+ <version>3.0</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.ow2.asm</groupId>
+ <artifactId>asm-util</artifactId>
+ <version>4.0</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
-
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <forkMode>never</forkMode>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
</project>
diff --git a/extensions/persist/test/com/google/inject/persist/EdslTest.java b/extensions/persist/test/com/google/inject/persist/EdslTest.java
index 9fd502f..81e0b6b 100644
--- a/extensions/persist/test/com/google/inject/persist/EdslTest.java
+++ b/extensions/persist/test/com/google/inject/persist/EdslTest.java
@@ -4,7 +4,7 @@
import com.google.inject.Guice;
import com.google.inject.Stage;
import com.google.inject.persist.jpa.JpaPersistModule;
-
+import java.util.logging.Logger;
import junit.framework.TestCase;
/**
@@ -13,12 +13,14 @@
public class EdslTest extends TestCase {
public void testModuleConfigUsingJpa() throws Exception {
+ Logger.getLogger(getClass().getName()).info("Starting EDSL test.");
Guice.createInjector(Stage.PRODUCTION, new AbstractModule() {
@Override
protected void configure() {
install(new JpaPersistModule("myunit"));
binder().requireExplicitBindings();
- };
+ }
});
+ Logger.getLogger(getClass().getName()).info("Completed EDSL test.");
}
}
diff --git a/extensions/pom.xml b/extensions/pom.xml
index bd706c7..b758bcd 100644
--- a/extensions/pom.xml
+++ b/extensions/pom.xml
@@ -54,6 +54,16 @@
<classifier>tests</classifier>
<scope>test</scope>
</dependency>
+ <!--
+ | Some extension tests depend on cglib which is not embedded
+ | in an execution that doesn't include package.
+ -->
+ <dependency>
+ <groupId>cglib</groupId>
+ <artifactId>cglib</artifactId>
+ <version>3.1</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<build>
@@ -97,46 +107,4 @@
</plugin>
</plugins>
</build>
-
- <profiles>
- <profile>
- <!--
- | JarJar build profile: re-package ASM and CGLIB references under the Guice namespace
- -->
- <id>guice.with.jarjar</id>
- <activation>
- <property>
- <name>guice.with.jarjar</name>
- <value>!false</value>
- </property>
- </activation>
- <dependencies>
- <!--
- | Extensions compile first against the non-JarJar'd core - and are then JarJar'd themselves
- | (optional dependency so it doesn't leak to client projects that depend on Guice artifacts)
- -->
- <dependency>
- <groupId>com.google.inject</groupId>
- <artifactId>guice</artifactId>
- <version>${project.version}</version>
- <classifier>no_deps</classifier>
- <optional>true</optional>
- </dependency>
- </dependencies>
- <build>
- <plugins>
- <plugin>
- <groupId>org.sonatype.plugins</groupId>
- <artifactId>jarjar-maven-plugin</artifactId>
- <configuration>
- <excludes>
- <exclude>*:*</exclude>
- </excludes>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
-
</project>
diff --git a/extensions/servlet/build.xml b/extensions/servlet/build.xml
index d7a10e1..0ef5039 100644
--- a/extensions/servlet/build.xml
+++ b/extensions/servlet/build.xml
@@ -12,11 +12,10 @@
<pathelement path="../../build/classes"/>
</path>
- <target name="jar" depends="jar.withrenameddeps, manifest" description="Build jar.">
+ <target name="jar" depends="compile, manifest" description="Build jar.">
<jar destfile="${build.dir}/${ant.project.name}-${version}.jar"
manifest="${build.dir}/META-INF/MANIFEST.MF">
- <zipfileset src="${build.dir}/${ant.project.name}-with-deps.jar"
- excludes="com/google/inject/internal/**"/>
+ <fileset dir="${build.dir}/classes" />
</jar>
</target>
diff --git a/extensions/spring/build.xml b/extensions/spring/build.xml
index 16c8299..2d708a6 100644
--- a/extensions/spring/build.xml
+++ b/extensions/spring/build.xml
@@ -10,11 +10,10 @@
<pathelement path="../../build/classes"/>
</path>
- <target name="jar" depends="jar.withrenameddeps, manifest" description="Build jar.">
+ <target name="jar" depends="compile, manifest" description="Build jar.">
<jar destfile="${build.dir}/${ant.project.name}-${version}.jar"
manifest="${build.dir}/META-INF/MANIFEST.MF">
- <zipfileset src="${build.dir}/${ant.project.name}-with-deps.jar"
- excludes="com/google/inject/internal/**"/>
+ <fileset dir="${build.dir}/classes" />
</jar>
</target>
diff --git a/extensions/struts2/build.xml b/extensions/struts2/build.xml
index 820dfa2..e105372 100644
--- a/extensions/struts2/build.xml
+++ b/extensions/struts2/build.xml
@@ -11,11 +11,10 @@
<fileset dir="../servlet/build" includes="*.jar"/>
</path>
- <target name="jar" depends="jar.withrenameddeps, manifest" description="Build jar.">
+ <target name="jar" depends="compile, manifest" description="Build jar.">
<jar destfile="${build.dir}/${ant.project.name}-${version}.jar"
manifest="${build.dir}/META-INF/MANIFEST.MF">
- <zipfileset src="${build.dir}/${ant.project.name}-with-deps.jar"
- excludes="com/google/inject/internal/**"/>
+ <fileset dir="${build.dir}/classes" />
</jar>
</target>
diff --git a/extensions/throwingproviders/build.xml b/extensions/throwingproviders/build.xml
index 9d36431..d123cf6 100644
--- a/extensions/throwingproviders/build.xml
+++ b/extensions/throwingproviders/build.xml
@@ -10,11 +10,10 @@
<pathelement path="../../build/classes"/>
</path>
- <target name="jar" depends="jar.withrenameddeps, manifest" description="Build jar.">
+ <target name="jar" depends="compile, manifest" description="Build jar.">
<jar destfile="${build.dir}/${ant.project.name}-${version}.jar"
manifest="${build.dir}/META-INF/MANIFEST.MF">
- <zipfileset src="${build.dir}/${ant.project.name}-with-deps.jar"
- excludes="com/google/inject/internal/**"/>
+ <fileset dir="${build.dir}/classes" />
</jar>
</target>
diff --git a/extensions/throwingproviders/pom.xml b/extensions/throwingproviders/pom.xml
index cd866cc..63a8b78 100644
--- a/extensions/throwingproviders/pom.xml
+++ b/extensions/throwingproviders/pom.xml
@@ -13,4 +13,16 @@
<name>Google Guice - Extensions - ThrowingProviders</name>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <excludes>
+ <exclude>**/TestScope*</exclude>
+ </excludes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
</project>
diff --git a/guice.iml b/guice.iml
index 53b2d05..4ac043c 100644
--- a/guice.iml
+++ b/guice.iml
@@ -87,6 +87,15 @@
<SOURCES />
</library>
</orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/lib/guava-16.0.1.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
</component>
</module>
diff --git a/lib/build/guava-11.0.1.jar b/lib/build/guava-11.0.1.jar
deleted file mode 100644
index af4a383..0000000
--- a/lib/build/guava-11.0.1.jar
+++ /dev/null
Binary files differ
diff --git a/lib/guava-16.0.1.jar b/lib/guava-16.0.1.jar
new file mode 100644
index 0000000..2c8127d
--- /dev/null
+++ b/lib/guava-16.0.1.jar
Binary files differ
diff --git a/pom.xml b/pom.xml
index 0805839..dece81f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -111,14 +111,10 @@
</properties>
<dependencies>
- <!--
- | Run tests with TestNG
- -->
<dependency>
- <groupId>org.testng</groupId>
- <artifactId>testng</artifactId>
- <version>5.11</version>
- <classifier>jdk15</classifier>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.11</version>
<scope>test</scope>
</dependency>
</dependencies>
@@ -174,21 +170,25 @@
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
+ <configuration>
+ <source>1.6</source>
+ <target>1.6</target>
+ </configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>animal-sniffer-maven-plugin</artifactId>
- <version>1.6</version>
+ <version>1.10</version>
<configuration>
<signature>
<groupId>org.codehaus.mojo.signature</groupId>
- <artifactId>java15</artifactId>
+ <artifactId>java16</artifactId>
<version>1.0</version>
</signature>
</configuration>
<executions>
<execution>
- <id>check-java-1.5-compat</id>
+ <id>check-java-1.6-compat</id>
<phase>process-classes</phase>
<goals>
<goal>check</goal>
@@ -196,78 +196,6 @@
</execution>
</executions>
</plugin>
- <!--
- | Shared JarJar configuration
- -->
- <plugin>
- <groupId>org.sonatype.plugins</groupId>
- <artifactId>jarjar-maven-plugin</artifactId>
- <version>1.4</version>
- <configuration>
- <rules>
- <rule>
- <pattern>net.sf.cglib.*</pattern>
- <result>com.google.inject.internal.cglib.$@1</result>
- </rule>
- <rule>
- <pattern>net.sf.cglib.**.*</pattern>
- <result>com.google.inject.internal.cglib.@1.$@2</result>
- </rule>
- <rule>
- <pattern>org.objectweb.asm.*</pattern>
- <result>com.google.inject.internal.asm.$@1</result>
- </rule>
- <rule>
- <pattern>org.objectweb.asm.**.*</pattern>
- <result>com.google.inject.internal.asm.@1.$@2</result>
- </rule>
- <rule>
- <pattern>com.google.common.*</pattern>
- <result>com.google.inject.internal.guava.$@1</result>
- </rule>
- <rule>
- <pattern>com.google.common.**.*</pattern>
- <result>com.google.inject.internal.guava.@1.$@2</result>
- </rule>
- <keep>
- <pattern>com.google.inject.**</pattern>
- </keep>
- <keep>
- <pattern>com.googlecode.**</pattern>
- </keep>
- <keep>
- <!-- the servlet extension uses this but core doesn't,
- so we explicitly instruct the build to keep it. -->
- <pattern>com.google.common.base.Throwables</pattern>
- </keep>
- </rules>
- </configuration>
- <!--
- | JarJar all classes before running tests
- -->
- <executions>
- <execution>
- <id>jarjar-classes</id>
- <phase>process-test-classes</phase>
- <goals>
- <goal>jarjar</goal>
- </goals>
- <configuration>
- <input>{classes}</input>
- </configuration>
- </execution>
- <execution>
- <id>jarjar-test-classes</id>
- <phase>process-test-classes</phase>
- <goals>
- <goal>jarjar</goal>
- </goals>
- <configuration>
- <input>{test-classes}</input>
- </configuration>
- </execution>
- </executions>
- </plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.5</version>