maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From joak...@apache.org
Subject svn commit: r439148 - in /maven/shared/trunk/maven-user: ./ maven-user-acegi/ maven-user-controller/ maven-user-model/ maven-user-model/src/test/java/org/apache/maven/user/model/impl/ maven-user-webapp/ maven-user-webapp/src/main/java/ maven-user-webap...
Date Fri, 01 Sep 2006 02:56:29 GMT
Author: joakime
Date: Thu Aug 31 19:56:28 2006
New Revision: 439148

URL: http://svn.apache.org/viewvc?rev=439148&view=rev
Log:
* Correction various svn properties.
* Correcting jpox/jdo handling for new namespace-driven location for the package.jdo
* Correcting scope of several dependencies to allow maven-user-webapp to function.
* Added MavenUserInitializationListener to create the table schemas needed by maven user.
* Added JdoFactory to maven-user-webapp's application.xml
* Lowered Logging threshold from INFO to DEBUG


Added:
    maven/shared/trunk/maven-user/maven-user-webapp/src/main/java/
    maven/shared/trunk/maven-user/maven-user-webapp/src/main/java/org/
    maven/shared/trunk/maven-user/maven-user-webapp/src/main/java/org/apache/
    maven/shared/trunk/maven-user/maven-user-webapp/src/main/java/org/apache/maven/
    maven/shared/trunk/maven-user/maven-user-webapp/src/main/java/org/apache/maven/user/
    maven/shared/trunk/maven-user/maven-user-webapp/src/main/java/org/apache/maven/user/webapp/
    maven/shared/trunk/maven-user/maven-user-webapp/src/main/java/org/apache/maven/user/webapp/MavenUserInitializationListener.java
  (with props)
Modified:
    maven/shared/trunk/maven-user/   (props changed)
    maven/shared/trunk/maven-user/maven-user-acegi/   (props changed)
    maven/shared/trunk/maven-user/maven-user-controller/   (props changed)
    maven/shared/trunk/maven-user/maven-user-model/   (props changed)
    maven/shared/trunk/maven-user/maven-user-model/pom.xml
    maven/shared/trunk/maven-user/maven-user-model/src/test/java/org/apache/maven/user/model/impl/DefaultUserManagerTest.java
    maven/shared/trunk/maven-user/maven-user-webapp/   (props changed)
    maven/shared/trunk/maven-user/maven-user-webapp/pom.xml
    maven/shared/trunk/maven-user/maven-user-webapp/src/main/resources/META-INF/plexus/application.xml
    maven/shared/trunk/maven-user/maven-user-webapp/src/main/webapp/WEB-INF/web.xml

Propchange: maven/shared/trunk/maven-user/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Thu Aug 31 19:56:28 2006
@@ -0,0 +1,7 @@
+target
+*~
+*.swp
+*.log
+*.patch
+*.diff
+cobertura.ser

Propchange: maven/shared/trunk/maven-user/maven-user-acegi/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Thu Aug 31 19:56:28 2006
@@ -1 +1,20 @@
 target
+*~
+.*.swp
+*.log
+*.patch
+*.diff
+.classpath
+.project
+.settings
+.wtpmodules
+.myeclipse
+.mymetadata
+.mystrutsdata
+.xdoclet
+*.ipr
+*.iws
+*.iml
+CVS
+cobertura.ser
+jcoverage.ser

Propchange: maven/shared/trunk/maven-user/maven-user-controller/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Thu Aug 31 19:56:28 2006
@@ -1 +1,20 @@
 target
+*~
+.*.swp
+*.log
+*.patch
+*.diff
+.classpath
+.project
+.settings
+.wtpmodules
+.myeclipse
+.mymetadata
+.mystrutsdata
+.xdoclet
+*.ipr
+*.iws
+*.iml
+CVS
+cobertura.ser
+jcoverage.ser

Propchange: maven/shared/trunk/maven-user/maven-user-model/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Thu Aug 31 19:56:28 2006
@@ -1 +1,20 @@
 target
+*~
+.*.swp
+*.log
+*.patch
+*.diff
+.classpath
+.project
+.settings
+.wtpmodules
+.myeclipse
+.mymetadata
+.mystrutsdata
+.xdoclet
+*.ipr
+*.iws
+*.iml
+CVS
+cobertura.ser
+jcoverage.ser

Modified: maven/shared/trunk/maven-user/maven-user-model/pom.xml
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-user/maven-user-model/pom.xml?rev=439148&r1=439147&r2=439148&view=diff
==============================================================================
--- maven/shared/trunk/maven-user/maven-user-model/pom.xml (original)
+++ maven/shared/trunk/maven-user/maven-user-model/pom.xml Thu Aug 31 19:56:28 2006
@@ -36,7 +36,7 @@
       <groupId>jpox</groupId>
       <artifactId>jpox</artifactId>
       <version>1.1.1</version>
-      <scope>runtime</scope>
+      <scope>compile</scope>
       <exclusions>
         <!-- targeting JDK 1.4 we don't need this -->
         <exclusion>
@@ -58,20 +58,29 @@
       <plugin>
         <groupId>org.codehaus.modello</groupId>
         <artifactId>modello-maven-plugin</artifactId>
-        <version>1.0-alpha-9</version>
+        <version>1.0-alpha-11-SNAPSHOT</version>
+        <configuration>
+          <version>1.0.0</version>
+          <packageWithVersion>false</packageWithVersion>
+          <model>src/main/mdo/user.xml</model>
+        </configuration>
         <executions>
           <execution>
+            <id>modello-java</id>
             <goals>
               <goal>java</goal>
+            </goals>
+          </execution>
+          <execution>
+            <id>jpox-jdo-mapping</id>
+            <goals>
               <goal>jpox-jdo-mapping</goal>
             </goals>
+            <configuration>
+              <outputDirectory>${basedir}/target/classes/org/apache/maven/user/model</outputDirectory>
+            </configuration>
           </execution>
         </executions>
-        <configuration>
-          <version>1.0.0</version>
-          <packageWithVersion>false</packageWithVersion>
-          <model>src/main/mdo/user.xml</model>
-        </configuration>
       </plugin>
       <plugin>
         <groupId>org.codehaus.mojo</groupId>
@@ -99,4 +108,17 @@
     </plugins>
   </build>
 
+  <pluginRepositories>
+    <pluginRepository>
+      <!-- Needed for maven-clean-plugin with fileset support -->
+      <id>snapshots.codehaus.org</id>
+      <url>http://snapshots.repository.codehaus.org</url>
+      <releases>
+        <enabled>false</enabled>
+      </releases>
+      <snapshots>
+        <enabled>true</enabled>
+      </snapshots>
+    </pluginRepository>
+  </pluginRepositories>
 </project>

Modified: maven/shared/trunk/maven-user/maven-user-model/src/test/java/org/apache/maven/user/model/impl/DefaultUserManagerTest.java
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-user/maven-user-model/src/test/java/org/apache/maven/user/model/impl/DefaultUserManagerTest.java?rev=439148&r1=439147&r2=439148&view=diff
==============================================================================
--- maven/shared/trunk/maven-user/maven-user-model/src/test/java/org/apache/maven/user/model/impl/DefaultUserManagerTest.java
(original)
+++ maven/shared/trunk/maven-user/maven-user-model/src/test/java/org/apache/maven/user/model/impl/DefaultUserManagerTest.java
Thu Aug 31 19:56:28 2006
@@ -92,7 +92,7 @@
             System.setProperty( (String) entry.getKey(), (String) entry.getValue() );
         }
 
-        SchemaTool.createSchemaTables( new URL[] { getClass().getResource( "/META-INF/package.jdo"
) }, null, false ); //$NON-NLS-1$
+        SchemaTool.createSchemaTables( new URL[] { getClass().getResource( "/org/apache/maven/user/model/package.jdo"
) }, null, false ); //$NON-NLS-1$
 
         PersistenceManagerFactory pmf = jdoFactory.getPersistenceManagerFactory();
 

Propchange: maven/shared/trunk/maven-user/maven-user-webapp/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Thu Aug 31 19:56:28 2006
@@ -1 +1,20 @@
 target
+*~
+.*.swp
+*.log
+*.patch
+*.diff
+.classpath
+.project
+.settings
+.wtpmodules
+.myeclipse
+.mymetadata
+.mystrutsdata
+.xdoclet
+*.ipr
+*.iws
+*.iml
+CVS
+cobertura.ser
+jcoverage.ser

Modified: maven/shared/trunk/maven-user/maven-user-webapp/pom.xml
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-user/maven-user-webapp/pom.xml?rev=439148&r1=439147&r2=439148&view=diff
==============================================================================
--- maven/shared/trunk/maven-user/maven-user-webapp/pom.xml (original)
+++ maven/shared/trunk/maven-user/maven-user-webapp/pom.xml Thu Aug 31 19:56:28 2006
@@ -47,6 +47,12 @@
       <version>1.1.2</version>
     </dependency>
     <dependency>
+      <groupId>javax.servlet</groupId>
+      <artifactId>servlet-api</artifactId>
+      <version>2.4</version>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
       <groupId>opensymphony</groupId>
       <artifactId>sitemesh</artifactId>
       <version>2.2.1</version>
@@ -56,13 +62,53 @@
       <artifactId>extremecomponents</artifactId>
       <version>1.0.1</version>
     </dependency>
+    <dependency>
+      <groupId>hsqldb</groupId>
+      <artifactId>hsqldb</artifactId>
+      <version>1.7.3.3</version>
+    </dependency>
   </dependencies>
 
   <build>
     <plugins>
       <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-clean-plugin</artifactId>
+        <version>2.1.1-20060724.192148-1</version>
+        <!-- This configuration is added to cleanup from war:inplace -->
+        <configuration>
+          <filesets>
+            <fileset>
+              <directory>${basedir}/src/main/webapp</directory>
+              <includes>
+                <include>META-INF</include>
+                <include>WEB-INF/classes</include>
+                <include>WEB-INF/tld</include>
+                <include>WEB-INF/lib</include>
+              </includes>
+              <excludes>
+                <excludes>user/*</excludes>
+                <excludes>WEB-INF/*.tld</excludes>
+                <excludes>WEB-INF/*.xml</excludes>
+              </excludes>
+            </fileset>
+          </filesets>
+        </configuration>
+      </plugin>
+      <plugin>
         <groupId>org.codehaus.mojo</groupId>
         <artifactId>jspc-maven-plugin</artifactId>
+        <configuration>
+          <warSourceDirectory>${project.build.directory}/${project.build.finalName}/</warSourceDirectory>
+          <injectString><![CDATA[<!-- [jspc-maven-plugin:post-compiled-jsps-as-servlets]
-->]]></injectString>
+          <!-- 
+            Uncomment outputWebXml if you want the generated web.xml to
+            be placed in the working directory that the war:war mojo uses.
+            -->
+          <!-- 
+          <outputWebXml>${project.build.directory}/${project.build.finalName}/WEB-INF/web.xml</outputWebXml>

+          -->
+        </configuration>
         <executions>
           <execution>
             <phase>package</phase>
@@ -72,7 +118,34 @@
           </execution>
         </executions>
       </plugin>
+      <plugin>
+        <groupId>org.mortbay.jetty</groupId>
+        <artifactId>maven-jetty-plugin</artifactId>
+        <configuration>
+          <scanIntervalSeconds>10</scanIntervalSeconds>
+          <contextPath>/</contextPath>
+          <connectors>
+            <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
+              <port>9090</port>
+              <maxIdleTime>60000</maxIdleTime>
+            </connector>
+          </connectors>
+        </configuration>
+      </plugin>
     </plugins>
   </build>
 
+  <pluginRepositories>
+    <pluginRepository>
+      <!-- Needed for maven-clean-plugin with fileset support -->
+      <id>snapshots.apache.org</id>
+      <url>http://people.apache.org/maven-snapshot-repository</url>
+      <releases>
+        <enabled>false</enabled>
+      </releases>
+      <snapshots>
+        <enabled>true</enabled>
+      </snapshots>
+    </pluginRepository>
+  </pluginRepositories>
 </project>

Added: maven/shared/trunk/maven-user/maven-user-webapp/src/main/java/org/apache/maven/user/webapp/MavenUserInitializationListener.java
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-user/maven-user-webapp/src/main/java/org/apache/maven/user/webapp/MavenUserInitializationListener.java?rev=439148&view=auto
==============================================================================
--- maven/shared/trunk/maven-user/maven-user-webapp/src/main/java/org/apache/maven/user/webapp/MavenUserInitializationListener.java
(added)
+++ maven/shared/trunk/maven-user/maven-user-webapp/src/main/java/org/apache/maven/user/webapp/MavenUserInitializationListener.java
Thu Aug 31 19:56:28 2006
@@ -0,0 +1,94 @@
+package org.apache.maven.user.webapp;
+
+/*
+ * Copyright 2001-2006 The Apache Software Foundation.
+ *
+ * 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.
+ */
+
+import com.opensymphony.webwork.plexus.PlexusLifecycleListener;
+
+import org.codehaus.plexus.PlexusContainer;
+import org.codehaus.plexus.jdo.JdoFactory;
+import org.codehaus.plexus.util.IOUtil;
+import org.jpox.SchemaTool;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.net.URL;
+import java.util.Properties;
+
+import javax.jdo.PersistenceManagerFactory;
+import javax.servlet.ServletContext;
+import javax.servlet.ServletContextEvent;
+import javax.servlet.ServletContextListener;
+
+/**
+ * MavenUserInitializationListener 
+ *
+ * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
+ * @version $Id$
+ */
+public class MavenUserInitializationListener
+    implements ServletContextListener
+{
+
+    public void contextDestroyed( ServletContextEvent sce )
+    {
+        // Ignore
+    }
+
+    public void contextInitialized( ServletContextEvent sce )
+    {
+
+        try
+        {
+            ServletContext ctx = sce.getServletContext();
+            PlexusContainer plexus = (PlexusContainer) ctx.getAttribute( PlexusLifecycleListener.KEY
);
+
+            JdoFactory jdoFactory = (JdoFactory) plexus.lookup( JdoFactory.ROLE );
+            PersistenceManagerFactory pmf = jdoFactory.getPersistenceManagerFactory();
+
+            // Create JDO Properties needed by SchemaTool
+            Properties jdoProps = new Properties();
+
+            jdoProps.setProperty( "javax.jdo.option.ConnectionDriverName", pmf.getConnectionDriverName()
);
+            jdoProps.setProperty( "javax.jdo.option.ConnectionURL", pmf.getConnectionURL()
);
+            jdoProps.setProperty( "javax.jdo.option.ConnectionUserName", pmf.getConnectionUserName()
);
+            jdoProps.setProperty( "javax.jdo.option.ConnectionPassword", "" );
+            jdoProps.setProperty( "javax.jdo.PersistenceManagerFactoryClass", "org.jpox.PersistenceManagerFactoryImpl"
);
+
+            // Create jdo only properties temp file.
+            File userTmp = new File( System.getProperty( "user.home" ), "tmp" );
+            if ( !userTmp.exists() )
+            {
+                userTmp.mkdirs();
+            }
+
+            File propsFile = File.createTempFile( "jdo-", ".properties", userTmp );
+            FileOutputStream fos = new FileOutputStream( propsFile );
+            jdoProps.store( fos, "Created by maven-user-webapp" );
+            IOUtil.close( fos );
+
+            SchemaTool.createSchemaTables( new URL[] { getClass()
+                .getResource( "/org/apache/maven/user/model/package.jdo" ) }, propsFile,
true );
+
+            propsFile.delete();
+        }
+        catch ( Exception e )
+        {
+            throw new RuntimeException( "Unable to initialize maven-user.", e );
+        }
+    }
+
+}

Propchange: maven/shared/trunk/maven-user/maven-user-webapp/src/main/java/org/apache/maven/user/webapp/MavenUserInitializationListener.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/shared/trunk/maven-user/maven-user-webapp/src/main/java/org/apache/maven/user/webapp/MavenUserInitializationListener.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Modified: maven/shared/trunk/maven-user/maven-user-webapp/src/main/resources/META-INF/plexus/application.xml
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-user/maven-user-webapp/src/main/resources/META-INF/plexus/application.xml?rev=439148&r1=439147&r2=439148&view=diff
==============================================================================
--- maven/shared/trunk/maven-user/maven-user-webapp/src/main/resources/META-INF/plexus/application.xml
(original)
+++ maven/shared/trunk/maven-user/maven-user-webapp/src/main/resources/META-INF/plexus/application.xml
Thu Aug 31 19:56:28 2006
@@ -24,7 +24,7 @@
       <implementation>org.codehaus.plexus.logging.log4j.Log4JLoggerManager</implementation>
       <lifecycle-handler>basic</lifecycle-handler>
       <configuration>
-        <threshold>INFO</threshold>
+        <threshold>DEBUG</threshold>
         <default-appender>console</default-appender>
         <appenders>
           <appender>
@@ -40,6 +40,53 @@
             <level>DEBUG</level>
           </level>
         </levels>
+      </configuration>
+    </component>
+    
+    <component>
+      <role>org.codehaus.plexus.jdo.JdoFactory</role>
+      <implementation>org.codehaus.plexus.jdo.DefaultJdoFactory</implementation>
+      <configuration>
+        <properties>
+          <property>
+          	<name>javax.jdo.PersistenceManagerFactoryClass</name>
+          	<value>org.jpox.PersistenceManagerFactoryImpl</value>
+          </property>
+          <property>
+          	<name>javax.jdo.option.ConnectionDriverName</name>
+          	<value>org.hsqldb.jdbcDriver</value>
+          </property>
+          <property>
+          	<name>javax.jdo.option.ConnectionURL</name>
+          	<value>jdbc:hsqldb:mem://localhost:/test</value>
+          </property>
+          <property>
+          	<name>javax.jdo.option.ConnectionUserName</name>
+          	<value>sa</value>
+          </property>
+<!--
+          <property>
+          	<name>javax.jdo.option.ConnectionPassword</name>
+          	<value></value>
+          </property>
+-->
+          <property>
+          	<name>org.jpox.autoCreateSchema</name>
+          	<value>true</value>
+          </property>
+          <property>
+          	<name>org.jpox.validateTables</name>
+          	<value>false</value>
+          </property>
+          <property>
+          	<name>org.jpox.validateConstraints</name>
+          	<value>false</value>
+          </property>
+          <property>
+            <name>initialiSize</name>
+            <value>10</value>
+          </property>
+        </properties>
       </configuration>
     </component>
   </components>

Modified: maven/shared/trunk/maven-user/maven-user-webapp/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-user/maven-user-webapp/src/main/webapp/WEB-INF/web.xml?rev=439148&r1=439147&r2=439148&view=diff
==============================================================================
--- maven/shared/trunk/maven-user/maven-user-webapp/src/main/webapp/WEB-INF/web.xml (original)
+++ maven/shared/trunk/maven-user/maven-user-webapp/src/main/webapp/WEB-INF/web.xml Thu Aug
31 19:56:28 2006
@@ -41,7 +41,11 @@
   <listener>
     <listener-class>org.codehaus.plexus.xwork.PlexusLifecycleListener</listener-class>
   </listener>
-
+  
+  <listener>
+    <listener-class>org.apache.maven.user.webapp.MavenUserInitializationListener</listener-class>
+  </listener>
+  
   <!-- [jspc-maven-plugin:post-compiled-jsps-as-servlets] -->
 
 </web-app>



Mime
View raw message