GERONIMO-3344 bit of cleanup and build a tests jar

git-svn-id: https://svn.apache.org/repos/asf/geronimo/components/txmanager/trunk@559268 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/geronimo-connector/pom.xml b/geronimo-connector/pom.xml
index 9b52593..02d6375 100644
--- a/geronimo-connector/pom.xml
+++ b/geronimo-connector/pom.xml
@@ -34,27 +34,8 @@
     <name>Geronimo :: Connector</name>
 
     <dependencies>
-<!--        
-        <dependency>
-            <groupId>org.apache.geronimo.modules</groupId>
-            <artifactId>geronimo-naming</artifactId>
-            <version>${version}</version>
-        </dependency>
 
         <dependency>
-            <groupId>org.apache.geronimo.modules</groupId>
-            <artifactId>geronimo-deployment</artifactId>
-            <version>${version}</version>
-        </dependency>
-
-        <dependency>
-            <groupId>org.apache.geronimo.modules</groupId>
-            <artifactId>geronimo-security</artifactId>
-            <version>${version}</version>
-        </dependency>
--->
-        <!-- g-system, g-management come from this via g-j2ee -->
-        <dependency>
             <groupId>org.apache.geronimo.components</groupId>
             <artifactId>geronimo-transaction</artifactId>
             <version>${version}</version>
@@ -65,37 +46,12 @@
             <artifactId>geronimo-j2ee-connector_1.5_spec</artifactId>
             <version>1.1.1</version>
         </dependency>
-<!--
-        <dependency>
-            <groupId>org.tranql</groupId>
-            <artifactId>tranql</artifactId>
-            <scope>test</scope>
-            <exclusions>
-                <exclusion>
-                    <groupId>commons-logging</groupId>
-                    <artifactId>commons-logging</artifactId>
-                </exclusion>
-            </exclusions>
-        </dependency>
--->
-        <!-- needed for passwordcredential realm-->
-<!--
-        <dependency>
-            <groupId>regexp</groupId>
-            <artifactId>regexp</artifactId>
-        </dependency>
--->
+
     </dependencies>
 
     <build>
         <pluginManagement>
             <plugins>
-                <plugin>
-                    <groupId>org.apache.geronimo.plugins</groupId>
-                    <artifactId>car-maven-plugin</artifactId>
-                    <version>${version}</version>
-                    <extensions>true</extensions>
-                </plugin>
 
                 <plugin>
                     <groupId>org.apache.maven.plugins</groupId>
@@ -108,142 +64,7 @@
                     <artifactId>maven-dependency-plugin</artifactId>
                     <version>2.0-alpha-4</version>
                 </plugin>
-
-                <plugin>
-                    <groupId>org.codehaus.mojo</groupId>
-                    <artifactId>groovy-maven-plugin</artifactId>
-                    <version>1.0-alpha-2</version>
-                </plugin>
-
-                <plugin>
-                    <groupId>org.codehaus.mojo</groupId>
-                    <artifactId>selenium-maven-plugin</artifactId>
-                    <version>1.0-beta-2-SNAPSHOT</version>
-                </plugin>
-
-                <plugin>
-                    <groupId>org.codehaus.mojo</groupId>
-                    <artifactId>xmlbeans-maven-plugin</artifactId>
-                    <version>2.3.1-20070720.222301-1</version>
-
-                    <executions>
-                        <execution>
-                            <goals>
-                                <goal>xmlbeans</goal>
-                            </goals>
-                        </execution>
-                    </executions>
-
-                    <configuration>
-                        <download>true</download>
-                        <quiet>false</quiet>
-                    </configuration>
-                </plugin>
-
-
-                <plugin>
-                    <groupId>org.codehaus.mojo.jspc</groupId>
-                    <artifactId>jspc-maven-plugin</artifactId>
-                    <version>2.0-SNAPSHOT</version>
-                    <executions>
-                        <execution>
-                            <goals>
-                                 <goal>compile</goal>
-                            </goals>
-                            <configuration>
-                                <warSourceDirectory>${pom.basedir}/src/main/webapp</warSourceDirectory>
-                            </configuration>
-                        </execution>
-                    </executions>
-                    
-                    <!-- Use the Tomcat 6 JSP compiler, but with our custom Jasper version -->
-                    <dependencies>
-                        <dependency>
-                            <groupId>org.codehaus.mojo.jspc</groupId>
-                            <artifactId>jspc-compiler-tomcat6</artifactId>
-                            <version>2.0-SNAPSHOT</version>
-                            <exclusions>
-                                <exclusion>
-                                    <groupId>org.apache.tomcat</groupId>
-                                    <artifactId>jasper</artifactId>
-                                </exclusion>
-                            </exclusions>
-                        </dependency>
-                        
-                        <dependency>
-                            <groupId>org.apache.tomcat</groupId>
-                            <artifactId>jasper</artifactId>
-                            <version>6.0.13-G543818</version>
-                        </dependency>
-                    </dependencies>
-                </plugin>
-
-                <plugin>
-                    <groupId>org.codehaus.mojo</groupId>
-                    <artifactId>sql-maven-plugin</artifactId>
-                    <version>1.0</version>
-                </plugin>
                 
-                <!--
-                FIXME: Should not configure war to assume jsp by default
-                -->
-
-                <plugin>
-                    <groupId>org.apache.maven.plugins</groupId>
-                    <artifactId>maven-war-plugin</artifactId>
-                    <version>2.0.2</version>
-                    <configuration>
-                        <warSourceDirectory>${pom.basedir}/src/main/webapp</warSourceDirectory>
-                        <webXml>${project.build.directory}/jspweb.xml</webXml>
-                        <archiveClasses>true</archiveClasses>
-                        <archive>
-                            <!-- Do not include META-INF/maven to avoid long file problems on windows -->
-                            <addMavenDescriptor>false</addMavenDescriptor>
-                        </archive>
-                        
-                        <!--
-                        HACK: Include legal files explicity, otherwise they will end up in the wrong path
-                              or in another jar file in the war.
-                        
-                        NOTE: targetPath is broken for webResources (as documented)
-                        -->
-                        <webResources>
-                            <resource>
-                                <directory>${project.build.outputDirectory}</directory>
-                                <includes>
-                                    <include>META-INF/LICENSE*</include>
-                                    <include>META-INF/NOTICE*</include>
-                                    <include>META-INF/DISCLAIMER*</include>
-                                </includes>
-                            </resource>
-                        </webResources>
-                    </configuration>
-                </plugin>
-
-                <plugin>
-                    <groupId>org.apache.maven.plugins</groupId>
-                    <artifactId>maven-ear-plugin</artifactId>
-                    <version>2.3</version>
-                    <configuration>
-                        <archive>
-                            <!-- Do not include META-INF/maven to avoid long file problems on windows -->
-                            <addMavenDescriptor>false</addMavenDescriptor>
-                        </archive>
-                    </configuration>
-                </plugin>
-
-                <plugin>
-                    <groupId>org.apache.maven.plugins</groupId>
-                    <artifactId>maven-rar-plugin</artifactId>
-                    <version>2.2</version>
-                    <configuration>
-                        <archive>
-                            <!-- Do not include META-INF/maven to avoid long file problems on windows -->
-                            <addMavenDescriptor>false</addMavenDescriptor>
-                        </archive>
-                    </configuration>
-                </plugin>
-
                 <plugin>
                     <groupId>org.apache.maven.plugins</groupId>
                     <artifactId>maven-jar-plugin</artifactId>
@@ -253,81 +74,13 @@
                             <addMavenDescriptor>false</addMavenDescriptor>
                         </archive>
                     </configuration>
-                </plugin>
-
-                <plugin>
-                    <groupId>org.apache.geronimo.plugins</groupId>
-                    <artifactId>geronimo-maven-plugin</artifactId>
-                    <version>${version}</version>
-
-                    <configuration>
-                        <assemblies>
-                            <assembly>
-                                <id>jetty</id>
-                                <groupId>org.apache.geronimo.assemblies</groupId>
-                                <artifactId>geronimo-jetty6-jee5</artifactId>
-                                <version>${version}</version>
-                                <classifier>bin</classifier>
-                                <type>zip</type>
-                            </assembly>
-
-                            <assembly>
-                                <id>jetty-minimal</id>
-                                <groupId>org.apache.geronimo.assemblies</groupId>
-                                <artifactId>geronimo-jetty6-minimal</artifactId>
-                                <version>${version}</version>
-                                <classifier>bin</classifier>
-                                <type>zip</type>
-                            </assembly>
-
-                            <assembly>
-                                <id>tomcat</id>
-                                <groupId>org.apache.geronimo.assemblies</groupId>
-                                <artifactId>geronimo-tomcat6-jee5</artifactId>
-                                <version>${version}</version>
-                                <classifier>bin</classifier>
-                                <type>zip</type>
-                            </assembly>
-
-                            <assembly>
-                                <id>tomcat-minimal</id>
-                                <groupId>org.apache.geronimo.assemblies</groupId>
-                                <artifactId>geronimo-tomcat6-minimal</artifactId>
-                                <version>${version}</version>
-                                <classifier>bin</classifier>
-                                <type>zip</type>
-                            </assembly>
-                            
-                            <assembly>
-                                <id>framework</id>
-                                <groupId>org.apache.geronimo.assemblies</groupId>
-                                <artifactId>geronimo-framework</artifactId>
-                                <version>${version}</version>
-                                <classifier>bin</classifier>
-                                <type>zip</type>
-                            </assembly>
-                        </assemblies>
-
-                        <defaultAssemblyId>jetty</defaultAssemblyId>
-
-                        <optionSets>
-                            <optionSet>
-                                <id>morememory</id>
-                                <options>
-                                    <option>-Xmx512m</option>
-                                    <option>-XX:MaxPermSize=128m</option>
-                                </options>
-                            </optionSet>
-
-                            <optionSet>
-                                <id>debug</id>
-                                <options>
-                                    <option>-Xdebug</option>
-                                    <option>-Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n</option>
-                                </options>
-                            </optionSet>
-                        </optionSets>
-                    </configuration>
+                    <executions>
+                      <execution>
+                        <goals>
+                          <goal>test-jar</goal>
+                        </goals>
+                      </execution>
+                    </executions>
                 </plugin>
             </plugins>
         </pluginManagement>
@@ -387,7 +140,8 @@
                         </goals>
                         <configuration>
                             <!-- Fail the build if no legal files were found -->
-                            <strict>true</strict>
+                            <!--<strict>true</strict>-->
+                            <strict>false</strict>
                         </configuration>
                     </execution>
                 </executions>
@@ -416,7 +170,7 @@
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-release-plugin</artifactId>
                 <configuration>
-                    <tagBase>https://svn.apache.org/repos/asf/geronimo/server/tags</tagBase>
+                    <tagBase>https://svn.apache.org/repos/asf/geronimo/components/txmanager/tags</tagBase>
                 </configuration>
             </plugin>
         </plugins>
diff --git a/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/GenericConnectionManager.java b/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/GenericConnectionManager.java
index e884238..c1fb279 100644
--- a/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/GenericConnectionManager.java
+++ b/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/GenericConnectionManager.java
@@ -41,15 +41,24 @@
         super();
     }
 
+    /**
+     *
+     * @param transactionSupport configuration of transaction support
+     * @param pooling configuration of pooling
+     * @param subjectSource If not null, use container managed security, getting the Subject from the SubjectSource
+     * @param connectionTracker tracks connections between calls as needed
+     * @param transactionManager transaction manager
+     * @param name name
+     * @param classLoader classloader this component is running in.
+     */
     public GenericConnectionManager(TransactionSupport transactionSupport,
                                     PoolingSupport pooling,
-                                    boolean containerManagedSecurity,
                                     SubjectSource subjectSource,
                                     ConnectionTracker connectionTracker,
                                     RecoverableTransactionManager transactionManager,
-                                    String objectName,
+                                    String name,
                                     ClassLoader classLoader) {
-        super(new InterceptorsImpl(transactionSupport, pooling, containerManagedSecurity, subjectSource, objectName, connectionTracker, transactionManager, classLoader), transactionManager);
+        super(new InterceptorsImpl(transactionSupport, pooling, subjectSource, name, connectionTracker, transactionManager, classLoader), transactionManager);
     }
 
     private static class InterceptorsImpl implements AbstractConnectionManager.Interceptors {
@@ -73,13 +82,13 @@
          */
         public InterceptorsImpl(TransactionSupport transactionSupport,
                                 PoolingSupport pooling,
-                                boolean containerManagedSecurity,
-                                SubjectSource subjectSource, String objectName,
+                                SubjectSource subjectSource,
+                                String name,
                                 ConnectionTracker connectionTracker,
                                 TransactionManager transactionManager,
                                 ClassLoader classLoader) {
             //check for consistency between attributes
-            if (!containerManagedSecurity && pooling instanceof PartitionedPool && ((PartitionedPool) pooling).isPartitionBySubject()) {
+            if (subjectSource == null && pooling instanceof PartitionedPool && ((PartitionedPool) pooling).isPartitionBySubject()) {
                 throw new IllegalStateException("To use Subject in pooling, you need a SecurityDomain");
             }
 
@@ -87,16 +96,16 @@
             MCFConnectionInterceptor tail = new MCFConnectionInterceptor();
             ConnectionInterceptor stack = tail;
 
-            stack = transactionSupport.addXAResourceInsertionInterceptor(stack, objectName);
+            stack = transactionSupport.addXAResourceInsertionInterceptor(stack, name);
             stack = pooling.addPoolingInterceptors(stack);
             if (log.isTraceEnabled()) {
-                log.trace("Connection Manager " + objectName + " installed pool " + stack);
+                log.trace("Connection Manager " + name + " installed pool " + stack);
             }
 
             this.poolingSupport = pooling;
             stack = transactionSupport.addTransactionInterceptors(stack, transactionManager);
 
-            if (containerManagedSecurity) {
+            if (subjectSource != null) {
                 stack = new SubjectInterceptor(stack, subjectSource);
             }
 
@@ -111,7 +120,7 @@
             stack = new TCCLInterceptor(stack, classLoader);
             if (connectionTracker != null) {
                 stack = new ConnectionTrackingInterceptor(stack,
-                        objectName,
+                        name,
                         connectionTracker);
             }
             tail.setStack(stack);
diff --git a/geronimo-connector/src/test/java/org/apache/geronimo/connector/outbound/ConnectionManagerTestUtils.java b/geronimo-connector/src/test/java/org/apache/geronimo/connector/outbound/ConnectionManagerTestUtils.java
index 8442bae..0de142e 100644
--- a/geronimo-connector/src/test/java/org/apache/geronimo/connector/outbound/ConnectionManagerTestUtils.java
+++ b/geronimo-connector/src/test/java/org/apache/geronimo/connector/outbound/ConnectionManagerTestUtils.java
@@ -110,7 +110,6 @@
         connectionManagerDeployment = new GenericConnectionManager(
                 transactionSupport,
                 poolingSupport,
-                containerManagedSecurity,
                 subjectSource, connectionTrackingCoordinator,
                 this.transactionManager,
                 name,
diff --git a/geronimo-transaction/pom.xml b/geronimo-transaction/pom.xml
index 007709c..97e8565 100644
--- a/geronimo-transaction/pom.xml
+++ b/geronimo-transaction/pom.xml
@@ -18,7 +18,8 @@
 
 <!-- $Rev$ $Date$ -->
 
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
 
     <modelVersion>4.0.0</modelVersion>
 
@@ -32,30 +33,15 @@
     <artifactId>geronimo-transaction</artifactId>
     <version>2.0-SNAPSHOT</version>
     <name>Geronimo :: Transaction</name>
-    
+
     <dependencies>
 
-            <dependency>
-                <groupId>commons-logging</groupId>
-                <artifactId>commons-logging</artifactId>
-                <version>1.0.4</version>
-            </dependency>
-
-
-
-<!-- 
-       <dependency>
-            <groupId>org.apache.geronimo.modules</groupId>
-            <artifactId>geronimo-core</artifactId>
-            <version>${version}</version>
-        </dependency>
-
         <dependency>
-            <groupId>org.apache.geronimo.modules</groupId>
-            <artifactId>geronimo-j2ee</artifactId>
-            <version>${version}</version>
+            <groupId>commons-logging</groupId>
+            <artifactId>commons-logging</artifactId>
+            <version>1.0.4</version>
         </dependency>
--->
+
         <dependency>
             <groupId>org.apache.geronimo.specs</groupId>
             <artifactId>geronimo-jta_1.1_spec</artifactId>
@@ -73,7 +59,8 @@
             <artifactId>howl</artifactId>
             <version>1.0.1-1</version>
         </dependency>
+
     </dependencies>
-    
+
 </project>