]> source.dussan.org Git - archiva.git/commitdiff
[MRM-1472] Maven configuration to enable mvn -P dev tomcat:run from the top of the...
authorWendy Smoak <wsmoak@apache.org>
Thu, 5 May 2011 14:42:00 +0000 (14:42 +0000)
committerWendy Smoak <wsmoak@apache.org>
Thu, 5 May 2011 14:42:00 +0000 (14:42 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1099827 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-web/archiva-applet/pom.xml
archiva-modules/archiva-web/archiva-webapp/pom.xml
archiva-modules/archiva-web/archiva-webapp/src/main/resources/META-INF/plexus/application.xml [deleted file]
archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/application.xml [new file with mode: 0644]
archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/web.xml
archiva-modules/archiva-web/archiva-webapp/src/test/tomcat/tomcat-context-archiva.xml [new file with mode: 0644]
pom.xml

index 5a317b861c4c5c3dc19eae88c630fa09264072a3..efcc4cfdd77ce070582fb9b4147fea4541a8347b 100644 (file)
       </plugin>
     </plugins>
   </build>
+  <profiles>
+    <profile>
+      <id>dev</id>
+      <build>
+        <plugins>
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-jar-plugin</artifactId>
+            <executions>
+              <execution>
+                <id>jar-generate-for-dev</id>
+                <phase>compile</phase>
+                <goals>
+                  <goal>jar</goal>
+                </goals>
+              </execution>
+            </executions>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
+  </profiles>
 </project>
index c85383419991ed9bcaaccda2d2f579d48c818a92..c6f4981228eab7414538b1e9ae87cbf0b5fdb45b 100644 (file)
           </warSourceExcludes>
         </configuration>
       </plugin>
+      <plugin>
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>tomcat-maven-plugin</artifactId>
+        <configuration>
+          <port>9091</port>
+          <path>/archiva</path>
+          <contextFile>${basedir}/src/test/tomcat/tomcat-context-archiva.xml</contextFile>
+          <systemProperties>
+            <plexus.home>${basedir}/appserver-base</plexus.home>
+            <appserver.base>${basedir}/appserver-base</appserver.base>
+            <appserver.home>${project.build.directory}/appserver-home</appserver.home>
+            <derby.system.home>${basedir}/appserver-base/logs</derby.system.home>
+          </systemProperties>
+        </configuration>
+        <dependencies>
+          <dependency>
+            <groupId>org.apache.derby</groupId>
+            <artifactId>derby</artifactId>
+            <version>10.1.3.1</version>
+          </dependency>
+          <dependency>
+            <groupId>javax.mail</groupId>
+            <artifactId>mail</artifactId>
+            <version>1.4</version>
+          </dependency>
+        </dependencies>
+      </plugin>
       <plugin>
         <groupId>org.mortbay.jetty</groupId>
         <artifactId>maven-jetty-plugin</artifactId>
         </plugins>
       </build>
     </profile>
+    <profile>
+      <!-- profile for tomcat plugin dev an log output in the console -->
+      <id>dev</id>
+      <build>
+        <plugins>
+          <plugin>
+            <artifactId>maven-antrun-plugin</artifactId>
+            <executions>
+              <execution>
+                <id>override-log4j-with-console-output</id>
+                <phase>process-resources</phase>
+                <goals>
+                  <goal>run</goal>
+                </goals>
+                <configuration>
+                  <tasks>
+
+                    <copy overwrite="true" file="${basedir}/src/test/resources/log4j.xml" todir="${basedir}/src/main/webapp/WEB-INF/classes" />
+
+                                                 <copy overwrite="true" file="${basedir}/src/test/resources/log4j.xml" todir="${project.build.directory}/classes" />
+                  </tasks>
+                </configuration>
+              </execution>
+            </executions>
+          </plugin>
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-dependency-plugin</artifactId>
+            <version>2.2</version>
+            <executions>
+              <execution>
+                <id>copy</id>
+                <phase>process-resources</phase>
+                <goals>
+                  <goal>copy</goal>
+                </goals>
+                <configuration>
+                  <skip>true</skip>
+                  <artifactItems>
+                    <artifactItem>
+                      <groupId>${project.groupId}</groupId>
+                      <artifactId>archiva-applet</artifactId>
+                      <version>${project.version}</version>
+                      <outputDirectory>src/main/webapp</outputDirectory>
+                      <destFileName>archiva-applet.jar</destFileName>
+                    </artifactItem>
+                  </artifactItems>
+                </configuration>
+              </execution>
+              <execution>
+                <id>unpack-redback-war</id>
+                <goals>
+                  <goal>unpack</goal>
+                </goals>
+                <phase>compile</phase>
+                <configuration>
+                  <artifactItems combine.self="override">
+                    <artifactItem>
+                      <groupId>org.codehaus.redback</groupId>
+                      <artifactId>redback-struts2-content</artifactId>
+                      <version>${redback.version}</version>
+                      <type>war</type>
+                      <overWrite>false</overWrite>
+                      <outputDirectory>${basedir}/src/main/webapp</outputDirectory>
+                      <excludes>**/web.xml,lib</excludes>
+                    </artifactItem>
+                  </artifactItems>
+                </configuration>
+              </execution>
+            </executions>
+          </plugin>
+
+          <!--plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-resources-plugin</artifactId>
+            <version>2.5</version>
+            <executions>
+              <execution>
+                <id>copy-redback-resources</id>
+                <phase>compile</phase>
+                <goals>
+                  <goal>copy-resources</goal>
+                </goals>
+                <configuration>
+                  <outputDirectory>${project.build.outputDirectory}</outputDirectory>
+                  <resources>
+                    <resource>
+                      <directory>${basedir}/src/main/webapp/WEB-INF/classes</directory>
+                      <filtering>false</filtering>
+                      <includes>
+                        <include>struts-security.xml</include>
+                      </includes>
+                    </resource>
+                  </resources>
+                </configuration>
+              </execution>
+            </executions>
+          </plugin-->
+        </plugins>
+      </build>
+      <dependencies>
+        <dependency>
+          <groupId>org.apache.archiva</groupId>
+          <artifactId>metadata-store-file</artifactId>
+          <version>${project.version}</version>
+        </dependency>
+        <dependency>
+          <groupId>org.codehaus.redback</groupId>
+          <artifactId>redback-struts2-integration</artifactId>
+          <version>${redback.version}</version>
+        </dependency>
+      </dependencies>
+    </profile>
   </profiles>
 </project>
diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/resources/META-INF/plexus/application.xml b/archiva-modules/archiva-web/archiva-webapp/src/main/resources/META-INF/plexus/application.xml
deleted file mode 100644 (file)
index f8203df..0000000
+++ /dev/null
@@ -1,358 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!--
-  ~ 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.
-  -->
-
-<plexus>
-  <components>
-    <component>
-      <role>org.codehaus.plexus.registry.Registry</role>
-      <implementation>org.codehaus.plexus.registry.commons.CommonsConfigurationRegistry</implementation>
-      <role-hint>commons-configuration</role-hint>
-      <configuration>
-        <properties>
-          <system/>
-          <jndi prefix="java:comp/env" config-optional="true"/>
-          <xml fileName="${user.home}/.m2/archiva.xml" config-optional="true"
-               config-name="org.apache.maven.archiva.user"
-               config-at="org.apache.maven.archiva"/>
-          <xml fileName="${user.home}/.m2/shared.xml" config-optional="true"
-               config-name="org.apache.maven.shared.app.user" config-at="org.apache.maven.shared.app"
-               config-forceCreate="true"/>
-          <properties fileName="${user.home}/.m2/security.properties" config-optional="true"
-                      config-at="org.codehaus.plexus.redback"/>
-          <properties fileName="${user.home}/.m2/archiva.properties" config-optional="true"
-                      config-at="org.codehaus.plexus.redback"/>
-          <xml fileName="${appserver.base}/conf/archiva.xml" config-optional="true"
-               config-name="org.apache.maven.archiva.base"
-               config-at="org.apache.maven.archiva"/>
-          <xml fileName="${appserver.base}/conf/shared.xml" config-optional="true"
-               config-name="org.apache.maven.shared.app.base" config-at="org.apache.maven.shared.app"/>
-          <xml fileName="${appserver.base}/conf/common.xml" config-optional="true"/>
-          <properties fileName="${appserver.base}/conf/security.properties" config-optional="true"
-                      config-at="org.codehaus.plexus.redback"/>
-          <xml fileName="${appserver.home}/conf/archiva.xml" config-optional="true"
-               config-at="org.apache.maven.archiva"/>
-          <xml fileName="${appserver.home}/conf/shared.xml" config-optional="true"
-               config-at="org.apache.maven.shared.app"/>
-          <xml fileName="${appserver.home}/conf/common.xml" config-optional="true"/>
-          <properties fileName="${appserver.home}/conf/security.properties" config-optional="true"
-                      config-at="org.codehaus.plexus.redback"/>
-          <properties fileName="org/apache/maven/archiva/security.properties" config-at="org.codehaus.plexus.redback"/>
-        </properties>
-      </configuration>
-    </component>
-
-    <component>
-      <role>org.codehaus.plexus.jdo.JdoFactory</role>
-      <role-hint>users</role-hint>
-      <implementation>org.codehaus.plexus.jdo.DataSourceConfigurableJdoFactory</implementation>
-      <configuration>
-
-        <connectionFactoryName>java:comp/env/jdbc/users</connectionFactoryName>
-        <shutdownConnectionFactoryName>java:comp/env/jdbc/usersShutdown</shutdownConnectionFactoryName>
-
-        <!-- JPOX and JDO configuration -->
-        <persistenceManagerFactoryClass>org.jpox.PersistenceManagerFactoryImpl</persistenceManagerFactoryClass>
-        <otherProperties>
-          <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>org.jpox.validateColumns</name>
-            <value>false</value>
-          </property>
-          <property>
-            <name>org.jpox.autoStartMechanism</name>
-            <value>None</value>
-          </property>
-          <property>
-            <name>org.jpox.transactionIsolation</name>
-            <value>READ_COMMITTED</value>
-          </property>
-          <property>
-            <name>org.jpox.poid.transactionIsolation</name>
-            <value>READ_COMMITTED</value>
-          </property>
-          <property>
-            <name>org.jpox.rdbms.dateTimezone</name>
-            <value>JDK_DEFAULT_TIMEZONE</value>
-          </property>
-          <!-- NEEDED FOR POSTGRES, But causes problems in other JDBC implementations.
-          <property>
-            <name>org.jpox.identifier.case</name>
-            <value>PreserveCase</value>
-          </property>
-            -->
-        </otherProperties>
-      </configuration>
-    </component>
-    
-    <!-- <component>
-      <role>org.apache.maven.archiva.webdav.util.MimeTypes</role>
-      <implementation>org.apache.maven.archiva.webdav.util.MimeTypes</implementation>
-      <description>MimeTypes</description>
-      <configuration>
-        <resource>archiva-mime-types.txt</resource>
-      </configuration>
-    </component> -->
-
-    <!--
-     | Logger manager
-     -->
-    <component>
-      <role>org.codehaus.plexus.logging.LoggerManager</role>
-      <implementation>org.codehaus.plexus.logging.slf4j.Slf4jLoggerManager</implementation>
-      <lifecycle-handler>basic</lifecycle-handler>
-    </component>
-
-    <component>
-      <role>org.codehaus.plexus.logging.Logger</role>
-      <implementation>org.apache.maven.archiva.common.utils.Slf4JPlexusLogger</implementation>
-      <role-hint>logger</role-hint>
-    </component>
-
-    <!-- 
-   PLXREDBACK-81 bad role hint, redefining here until redback alpha-2 is released.
-    -->
-    <component>
-      <role>org.codehaus.plexus.redback.system.check.EnvironmentCheck</role>
-      <role-hint>locked-admin-check</role-hint>
-      <implementation>org.codehaus.redback.integration.checks.security.LockedAdminEnvironmentCheck</implementation>
-      <description>LockedAdminEnvironmentCheck: checks if accounts marked as system administrator are locked
-        and unlocks them on startup.
-      </description>
-      <requirements>
-        <requirement>
-          <role>org.codehaus.plexus.redback.users.UserManager</role>
-          <role-hint>cached</role-hint>
-          <field-name>userManager</field-name>
-        </requirement>
-        <requirement>
-          <role>org.codehaus.plexus.redback.rbac.RBACManager</role>
-          <role-hint>cached</role-hint>
-          <field-name>rbacManager</field-name>
-        </requirement>
-      </requirements>
-    </component>
-
-    <!-- START SNIPPET: ldap -->
-    <!-- 
-       Ldap Authentication can be enabled by setting enabling these components and setting the following configuration options in your security.properties file
-
-       ============================================================
-       user.manager.impl=ldap
-       ldap.bind.authenticator.enabled=true
-       redback.default.admin=admin
-       security.policy.password.expiration.enabled=false
-
-       ldap.config.hostname=ldap.hostname
-       ldap.config.port=389
-       ldap.config.base.dn=o=com
-       ldap.config.context.factory=com.sun.jndi.ldap.LdapCtxFactory
-       ldap.config.bind.dn=uid=myusername,o=com
-       ldap.config.password=s3cr3t
-       #ldap.config.authentication.method=
-       ============================================================
-
-       * ldap.config.hostname - The hostname of the ldap server
-       * ldap.config.port - The port of the ldap server
-       * ldap.config.base.dn - The baseDn of the ldap system
-       * ldap.config.context.factory - context factory for ldap connections
-       * ldap.config.bind.dn - the core user used for authentication the ldap server, must be able to perform the necessary searches, etc.
-       * ldap.config.password - password for the bindDn for the root ldap connection
-
-       until this process is better documented, the following is the document for configuration ldap with redback
-      
-       http://redback.codehaus.org/integration/ldap.html
-    -->
-
-    <!--
-    
-    this component manages the connection to the ldap server
-     -->
-
-    <!-- component>
-      <role>org.codehaus.plexus.redback.common.ldap.connection.LdapConnectionFactory</role>
-      <role-hint>configurable</role-hint>
-      <implementation>org.codehaus.plexus.redback.common.ldap.connection.ConfigurableLdapConnectionFactory</implementation>
-      <requirements>
-        <requirement>
-          <role>org.codehaus.plexus.redback.configuration.UserConfiguration</role>
-        </requirement>
-      </requirements>
-    </component-->
-    
-    <!-- 
-    
-    this component manages the mapping of attributes in ldap to user information in redback. To configure the mapping, you can add the following properties in your security.properties
-
-       ============================================================
-       ldap.config.mapper.attribute.email=mail
-       ldap.config.mapper.attribute.fullname=givenName
-       ldap.config.mapper.attribute.password=userPassword
-       ldap.config.mapper.attribute.user.id=cn
-       ldap.config.mapper.attribute.user.base.dn=
-       ldap.config.mapper.attribute.user.object.class=inetOrgPerson
-       ldap.config.mapper.attribute.user.filter=(attributeName=value)
-       ============================================================
-
-
-     * email-attribute - The name of the attribute on a user that contains the email address
-     * full-name-attribute - The name of the attribute on a user that contains the users fullName
-     * password-attribute - The name of the attribute containing the users password, used for the authentiction using the user manager and not the ldap bind authenticator
-     * user-id-attribute - The name of the attribute containing the users userId, most commonly cn or sn.
-     * user-base-dn - The base dn that will be subtree searched for users.
-     * user-object-class - the objectClass used in the ldap server for indentifying users, most commonly inetOrgPerson.
-     -->
-    
-    <!-- component>
-      <role>org.codehaus.plexus.redback.common.ldap.UserMapper</role>
-      <role-hint>ldap</role-hint>
-      <implementation>org.codehaus.plexus.redback.common.ldap.LdapUserMapper</implementation>
-      <configuration>
-        <email-attribute>email</email-attribute>
-        <full-name-attribute>givenName</full-name-attribute>
-        <password-attribute>userPassword</password-attribute>
-        <user-id-attribute>cn</user-id-attribute>
-        <user-base-dn>o=com</user-base-dn>
-        <user-object-class>inetOrgPerson</user-object-class>
-      </configuration>
-      <requirements>
-        <requirement>
-          <role>org.codehaus.plexus.redback.configuration.UserConfiguration</role>
-        </requirement>
-      </requirements>
-    </component-->
-    
-    <!--
-     
-    If caching is desired to improve performance then make uncomment this and make sure the following configuration parameter is in the security.properties
-     
-    user.manager.impl=cached
-    -->
-     
-    <!-- component>
-      <role>org.codehaus.plexus.redback.users.UserManager</role>
-      <role-hint>cached</role-hint>
-      <implementation>org.codehaus.plexus.redback.users.cached.CachedUserManager</implementation>
-      <description>CachedUserManager</description>
-      <requirements>
-        <requirement>
-          <role>org.codehaus.plexus.redback.users.UserManager</role>
-          <role-hint>ldap</role-hint>
-          <field-name>userImpl</field-name>
-        </requirement>
-        <requirement>
-          <role>org.codehaus.plexus.cache.Cache</role>
-          <role-hint>users</role-hint>
-          <field-name>usersCache</field-name>
-        </requirement>
-      </requirements>
-    </component-->
-    
-    <!-- 
-    
-    if using the user manager authenticator to authenticate the user and not the ldap bind authenticator make sure
-    this definition has the correct password encoder
-    
-    Note: you should probably just use the ldap bind authenticator which is enabled by putting
-    
-    ldap.bind.authenticator.enabled=true
-    
-    in the security.properties
-    -->
-    
-    <!-- component>
-      <role>org.codehaus.plexus.redback.policy.UserSecurityPolicy</role>
-      <role-hint>default</role-hint>
-      <implementation>org.codehaus.plexus.redback.policy.DefaultUserSecurityPolicy</implementation>
-      <description>User Security Policy.</description>
-      <requirements>
-        <requirement>
-          <role>org.codehaus.plexus.redback.configuration.UserConfiguration</role>
-          <field-name>config</field-name>
-        </requirement>
-        <requirement>
-          <role>org.codehaus.plexus.redback.policy.PasswordEncoder</role>
-          <role-hint>sha1</role-hint>
-          <field-name>passwordEncoder</field-name>
-        </requirement>
-        <requirement>
-          <role>org.codehaus.plexus.redback.policy.UserValidationSettings</role>
-          <field-name>userValidationSettings</field-name>
-        </requirement>
-        <requirement>
-          <role>org.codehaus.plexus.redback.policy.CookieSettings</role>
-          <role-hint>rememberMe</role-hint>
-          <field-name>rememberMeCookieSettings</field-name>
-        </requirement>
-        <requirement>
-          <role>org.codehaus.plexus.redback.policy.CookieSettings</role>
-          <role-hint>signon</role-hint>
-          <field-name>signonCookieSettings</field-name>
-        </requirement>
-        <requirement>
-          <role>org.codehaus.plexus.redback.policy.PasswordRule</role>
-          <field-name>rules</field-name>
-        </requirement>
-      </requirements>
-    </component-->
-    <!-- END SNIPPET: ldap -->
-  </components>
-
-  <lifecycle-handler-manager implementation="org.codehaus.plexus.lifecycle.DefaultLifecycleHandlerManager">
-    <default-lifecycle-handler-id>plexus</default-lifecycle-handler-id>
-    <lifecycle-handlers>
-      <lifecycle-handler implementation="org.codehaus.plexus.personality.plexus.PlexusLifecycleHandler">
-        <id>plexus</id>
-        <name>Plexus Lifecycle Handler</name>
-        <begin-segment>
-          <phase implementation="org.codehaus.plexus.personality.plexus.lifecycle.phase.LogEnablePhase"/>
-          <phase implementation="org.codehaus.plexus.personality.plexus.lifecycle.phase.CompositionPhase"/>
-          <phase implementation="org.codehaus.plexus.personality.plexus.lifecycle.phase.ContextualizePhase"/>
-          <phase implementation="org.codehaus.plexus.personality.plexus.lifecycle.phase.AutoConfigurePhase"/>
-          <phase implementation="org.codehaus.plexus.registry.RegistryConfigurePhase"/>
-          <phase implementation="org.codehaus.plexus.personality.plexus.lifecycle.phase.ServiceablePhase"/>
-          <phase implementation="org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializePhase"/>
-          <phase implementation="org.codehaus.plexus.personality.plexus.lifecycle.phase.StartPhase"/>
-        </begin-segment>
-        <suspend-segment>
-          <phase implementation="org.codehaus.plexus.personality.plexus.lifecycle.phase.SuspendPhase"/>
-        </suspend-segment>
-        <resume-segment>
-          <phase implementation="org.codehaus.plexus.personality.plexus.lifecycle.phase.ResumePhase"/>
-        </resume-segment>
-        <end-segment>
-          <phase implementation="org.codehaus.plexus.personality.plexus.lifecycle.phase.StopPhase"/>
-          <phase implementation="org.codehaus.plexus.personality.plexus.lifecycle.phase.DisposePhase"/>
-          <phase implementation="org.codehaus.plexus.personality.plexus.lifecycle.phase.LogDisablePhase"/>
-        </end-segment>
-      </lifecycle-handler>
-    </lifecycle-handlers>
-  </lifecycle-handler-manager>
-</plexus>
diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/application.xml b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/application.xml
new file mode 100644 (file)
index 0000000..f8203df
--- /dev/null
@@ -0,0 +1,358 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+  ~ 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.
+  -->
+
+<plexus>
+  <components>
+    <component>
+      <role>org.codehaus.plexus.registry.Registry</role>
+      <implementation>org.codehaus.plexus.registry.commons.CommonsConfigurationRegistry</implementation>
+      <role-hint>commons-configuration</role-hint>
+      <configuration>
+        <properties>
+          <system/>
+          <jndi prefix="java:comp/env" config-optional="true"/>
+          <xml fileName="${user.home}/.m2/archiva.xml" config-optional="true"
+               config-name="org.apache.maven.archiva.user"
+               config-at="org.apache.maven.archiva"/>
+          <xml fileName="${user.home}/.m2/shared.xml" config-optional="true"
+               config-name="org.apache.maven.shared.app.user" config-at="org.apache.maven.shared.app"
+               config-forceCreate="true"/>
+          <properties fileName="${user.home}/.m2/security.properties" config-optional="true"
+                      config-at="org.codehaus.plexus.redback"/>
+          <properties fileName="${user.home}/.m2/archiva.properties" config-optional="true"
+                      config-at="org.codehaus.plexus.redback"/>
+          <xml fileName="${appserver.base}/conf/archiva.xml" config-optional="true"
+               config-name="org.apache.maven.archiva.base"
+               config-at="org.apache.maven.archiva"/>
+          <xml fileName="${appserver.base}/conf/shared.xml" config-optional="true"
+               config-name="org.apache.maven.shared.app.base" config-at="org.apache.maven.shared.app"/>
+          <xml fileName="${appserver.base}/conf/common.xml" config-optional="true"/>
+          <properties fileName="${appserver.base}/conf/security.properties" config-optional="true"
+                      config-at="org.codehaus.plexus.redback"/>
+          <xml fileName="${appserver.home}/conf/archiva.xml" config-optional="true"
+               config-at="org.apache.maven.archiva"/>
+          <xml fileName="${appserver.home}/conf/shared.xml" config-optional="true"
+               config-at="org.apache.maven.shared.app"/>
+          <xml fileName="${appserver.home}/conf/common.xml" config-optional="true"/>
+          <properties fileName="${appserver.home}/conf/security.properties" config-optional="true"
+                      config-at="org.codehaus.plexus.redback"/>
+          <properties fileName="org/apache/maven/archiva/security.properties" config-at="org.codehaus.plexus.redback"/>
+        </properties>
+      </configuration>
+    </component>
+
+    <component>
+      <role>org.codehaus.plexus.jdo.JdoFactory</role>
+      <role-hint>users</role-hint>
+      <implementation>org.codehaus.plexus.jdo.DataSourceConfigurableJdoFactory</implementation>
+      <configuration>
+
+        <connectionFactoryName>java:comp/env/jdbc/users</connectionFactoryName>
+        <shutdownConnectionFactoryName>java:comp/env/jdbc/usersShutdown</shutdownConnectionFactoryName>
+
+        <!-- JPOX and JDO configuration -->
+        <persistenceManagerFactoryClass>org.jpox.PersistenceManagerFactoryImpl</persistenceManagerFactoryClass>
+        <otherProperties>
+          <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>org.jpox.validateColumns</name>
+            <value>false</value>
+          </property>
+          <property>
+            <name>org.jpox.autoStartMechanism</name>
+            <value>None</value>
+          </property>
+          <property>
+            <name>org.jpox.transactionIsolation</name>
+            <value>READ_COMMITTED</value>
+          </property>
+          <property>
+            <name>org.jpox.poid.transactionIsolation</name>
+            <value>READ_COMMITTED</value>
+          </property>
+          <property>
+            <name>org.jpox.rdbms.dateTimezone</name>
+            <value>JDK_DEFAULT_TIMEZONE</value>
+          </property>
+          <!-- NEEDED FOR POSTGRES, But causes problems in other JDBC implementations.
+          <property>
+            <name>org.jpox.identifier.case</name>
+            <value>PreserveCase</value>
+          </property>
+            -->
+        </otherProperties>
+      </configuration>
+    </component>
+    
+    <!-- <component>
+      <role>org.apache.maven.archiva.webdav.util.MimeTypes</role>
+      <implementation>org.apache.maven.archiva.webdav.util.MimeTypes</implementation>
+      <description>MimeTypes</description>
+      <configuration>
+        <resource>archiva-mime-types.txt</resource>
+      </configuration>
+    </component> -->
+
+    <!--
+     | Logger manager
+     -->
+    <component>
+      <role>org.codehaus.plexus.logging.LoggerManager</role>
+      <implementation>org.codehaus.plexus.logging.slf4j.Slf4jLoggerManager</implementation>
+      <lifecycle-handler>basic</lifecycle-handler>
+    </component>
+
+    <component>
+      <role>org.codehaus.plexus.logging.Logger</role>
+      <implementation>org.apache.maven.archiva.common.utils.Slf4JPlexusLogger</implementation>
+      <role-hint>logger</role-hint>
+    </component>
+
+    <!-- 
+   PLXREDBACK-81 bad role hint, redefining here until redback alpha-2 is released.
+    -->
+    <component>
+      <role>org.codehaus.plexus.redback.system.check.EnvironmentCheck</role>
+      <role-hint>locked-admin-check</role-hint>
+      <implementation>org.codehaus.redback.integration.checks.security.LockedAdminEnvironmentCheck</implementation>
+      <description>LockedAdminEnvironmentCheck: checks if accounts marked as system administrator are locked
+        and unlocks them on startup.
+      </description>
+      <requirements>
+        <requirement>
+          <role>org.codehaus.plexus.redback.users.UserManager</role>
+          <role-hint>cached</role-hint>
+          <field-name>userManager</field-name>
+        </requirement>
+        <requirement>
+          <role>org.codehaus.plexus.redback.rbac.RBACManager</role>
+          <role-hint>cached</role-hint>
+          <field-name>rbacManager</field-name>
+        </requirement>
+      </requirements>
+    </component>
+
+    <!-- START SNIPPET: ldap -->
+    <!-- 
+       Ldap Authentication can be enabled by setting enabling these components and setting the following configuration options in your security.properties file
+
+       ============================================================
+       user.manager.impl=ldap
+       ldap.bind.authenticator.enabled=true
+       redback.default.admin=admin
+       security.policy.password.expiration.enabled=false
+
+       ldap.config.hostname=ldap.hostname
+       ldap.config.port=389
+       ldap.config.base.dn=o=com
+       ldap.config.context.factory=com.sun.jndi.ldap.LdapCtxFactory
+       ldap.config.bind.dn=uid=myusername,o=com
+       ldap.config.password=s3cr3t
+       #ldap.config.authentication.method=
+       ============================================================
+
+       * ldap.config.hostname - The hostname of the ldap server
+       * ldap.config.port - The port of the ldap server
+       * ldap.config.base.dn - The baseDn of the ldap system
+       * ldap.config.context.factory - context factory for ldap connections
+       * ldap.config.bind.dn - the core user used for authentication the ldap server, must be able to perform the necessary searches, etc.
+       * ldap.config.password - password for the bindDn for the root ldap connection
+
+       until this process is better documented, the following is the document for configuration ldap with redback
+      
+       http://redback.codehaus.org/integration/ldap.html
+    -->
+
+    <!--
+    
+    this component manages the connection to the ldap server
+     -->
+
+    <!-- component>
+      <role>org.codehaus.plexus.redback.common.ldap.connection.LdapConnectionFactory</role>
+      <role-hint>configurable</role-hint>
+      <implementation>org.codehaus.plexus.redback.common.ldap.connection.ConfigurableLdapConnectionFactory</implementation>
+      <requirements>
+        <requirement>
+          <role>org.codehaus.plexus.redback.configuration.UserConfiguration</role>
+        </requirement>
+      </requirements>
+    </component-->
+    
+    <!-- 
+    
+    this component manages the mapping of attributes in ldap to user information in redback. To configure the mapping, you can add the following properties in your security.properties
+
+       ============================================================
+       ldap.config.mapper.attribute.email=mail
+       ldap.config.mapper.attribute.fullname=givenName
+       ldap.config.mapper.attribute.password=userPassword
+       ldap.config.mapper.attribute.user.id=cn
+       ldap.config.mapper.attribute.user.base.dn=
+       ldap.config.mapper.attribute.user.object.class=inetOrgPerson
+       ldap.config.mapper.attribute.user.filter=(attributeName=value)
+       ============================================================
+
+
+     * email-attribute - The name of the attribute on a user that contains the email address
+     * full-name-attribute - The name of the attribute on a user that contains the users fullName
+     * password-attribute - The name of the attribute containing the users password, used for the authentiction using the user manager and not the ldap bind authenticator
+     * user-id-attribute - The name of the attribute containing the users userId, most commonly cn or sn.
+     * user-base-dn - The base dn that will be subtree searched for users.
+     * user-object-class - the objectClass used in the ldap server for indentifying users, most commonly inetOrgPerson.
+     -->
+    
+    <!-- component>
+      <role>org.codehaus.plexus.redback.common.ldap.UserMapper</role>
+      <role-hint>ldap</role-hint>
+      <implementation>org.codehaus.plexus.redback.common.ldap.LdapUserMapper</implementation>
+      <configuration>
+        <email-attribute>email</email-attribute>
+        <full-name-attribute>givenName</full-name-attribute>
+        <password-attribute>userPassword</password-attribute>
+        <user-id-attribute>cn</user-id-attribute>
+        <user-base-dn>o=com</user-base-dn>
+        <user-object-class>inetOrgPerson</user-object-class>
+      </configuration>
+      <requirements>
+        <requirement>
+          <role>org.codehaus.plexus.redback.configuration.UserConfiguration</role>
+        </requirement>
+      </requirements>
+    </component-->
+    
+    <!--
+     
+    If caching is desired to improve performance then make uncomment this and make sure the following configuration parameter is in the security.properties
+     
+    user.manager.impl=cached
+    -->
+     
+    <!-- component>
+      <role>org.codehaus.plexus.redback.users.UserManager</role>
+      <role-hint>cached</role-hint>
+      <implementation>org.codehaus.plexus.redback.users.cached.CachedUserManager</implementation>
+      <description>CachedUserManager</description>
+      <requirements>
+        <requirement>
+          <role>org.codehaus.plexus.redback.users.UserManager</role>
+          <role-hint>ldap</role-hint>
+          <field-name>userImpl</field-name>
+        </requirement>
+        <requirement>
+          <role>org.codehaus.plexus.cache.Cache</role>
+          <role-hint>users</role-hint>
+          <field-name>usersCache</field-name>
+        </requirement>
+      </requirements>
+    </component-->
+    
+    <!-- 
+    
+    if using the user manager authenticator to authenticate the user and not the ldap bind authenticator make sure
+    this definition has the correct password encoder
+    
+    Note: you should probably just use the ldap bind authenticator which is enabled by putting
+    
+    ldap.bind.authenticator.enabled=true
+    
+    in the security.properties
+    -->
+    
+    <!-- component>
+      <role>org.codehaus.plexus.redback.policy.UserSecurityPolicy</role>
+      <role-hint>default</role-hint>
+      <implementation>org.codehaus.plexus.redback.policy.DefaultUserSecurityPolicy</implementation>
+      <description>User Security Policy.</description>
+      <requirements>
+        <requirement>
+          <role>org.codehaus.plexus.redback.configuration.UserConfiguration</role>
+          <field-name>config</field-name>
+        </requirement>
+        <requirement>
+          <role>org.codehaus.plexus.redback.policy.PasswordEncoder</role>
+          <role-hint>sha1</role-hint>
+          <field-name>passwordEncoder</field-name>
+        </requirement>
+        <requirement>
+          <role>org.codehaus.plexus.redback.policy.UserValidationSettings</role>
+          <field-name>userValidationSettings</field-name>
+        </requirement>
+        <requirement>
+          <role>org.codehaus.plexus.redback.policy.CookieSettings</role>
+          <role-hint>rememberMe</role-hint>
+          <field-name>rememberMeCookieSettings</field-name>
+        </requirement>
+        <requirement>
+          <role>org.codehaus.plexus.redback.policy.CookieSettings</role>
+          <role-hint>signon</role-hint>
+          <field-name>signonCookieSettings</field-name>
+        </requirement>
+        <requirement>
+          <role>org.codehaus.plexus.redback.policy.PasswordRule</role>
+          <field-name>rules</field-name>
+        </requirement>
+      </requirements>
+    </component-->
+    <!-- END SNIPPET: ldap -->
+  </components>
+
+  <lifecycle-handler-manager implementation="org.codehaus.plexus.lifecycle.DefaultLifecycleHandlerManager">
+    <default-lifecycle-handler-id>plexus</default-lifecycle-handler-id>
+    <lifecycle-handlers>
+      <lifecycle-handler implementation="org.codehaus.plexus.personality.plexus.PlexusLifecycleHandler">
+        <id>plexus</id>
+        <name>Plexus Lifecycle Handler</name>
+        <begin-segment>
+          <phase implementation="org.codehaus.plexus.personality.plexus.lifecycle.phase.LogEnablePhase"/>
+          <phase implementation="org.codehaus.plexus.personality.plexus.lifecycle.phase.CompositionPhase"/>
+          <phase implementation="org.codehaus.plexus.personality.plexus.lifecycle.phase.ContextualizePhase"/>
+          <phase implementation="org.codehaus.plexus.personality.plexus.lifecycle.phase.AutoConfigurePhase"/>
+          <phase implementation="org.codehaus.plexus.registry.RegistryConfigurePhase"/>
+          <phase implementation="org.codehaus.plexus.personality.plexus.lifecycle.phase.ServiceablePhase"/>
+          <phase implementation="org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializePhase"/>
+          <phase implementation="org.codehaus.plexus.personality.plexus.lifecycle.phase.StartPhase"/>
+        </begin-segment>
+        <suspend-segment>
+          <phase implementation="org.codehaus.plexus.personality.plexus.lifecycle.phase.SuspendPhase"/>
+        </suspend-segment>
+        <resume-segment>
+          <phase implementation="org.codehaus.plexus.personality.plexus.lifecycle.phase.ResumePhase"/>
+        </resume-segment>
+        <end-segment>
+          <phase implementation="org.codehaus.plexus.personality.plexus.lifecycle.phase.StopPhase"/>
+          <phase implementation="org.codehaus.plexus.personality.plexus.lifecycle.phase.DisposePhase"/>
+          <phase implementation="org.codehaus.plexus.personality.plexus.lifecycle.phase.LogDisablePhase"/>
+        </end-segment>
+      </lifecycle-handler>
+    </lifecycle-handlers>
+  </lifecycle-handler-manager>
+</plexus>
index 0affdbc55748affd8994e8fd5814dccba64940b6..74d3413f51043477744a965f9fae1864034f2891 100644 (file)
@@ -99,7 +99,7 @@
                <param-value>
                        classpath*:META-INF/plexus/components.xml
                        classpath*:META-INF/spring-context.xml
-                       /WEB-INF/classes/META-INF/plexus/application.xml
+                       /WEB-INF/application.xml
                        /WEB-INF/applicationContext.xml
                </param-value>
        </context-param>
diff --git a/archiva-modules/archiva-web/archiva-webapp/src/test/tomcat/tomcat-context-archiva.xml b/archiva-modules/archiva-web/archiva-webapp/src/test/tomcat/tomcat-context-archiva.xml
new file mode 100644 (file)
index 0000000..b5275fa
--- /dev/null
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ 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.
+  -->
+  <Context path="/continuum">
+    <Resource name="jdbc/users" auth="Container" type="javax.sql.DataSource"
+              username="sa"
+              password=""
+              driverClassName="org.apache.derby.jdbc.EmbeddedDriver"
+              url="jdbc:derby:${catalina.base}/target/database/users;create=true"
+    />
+    <Resource name="jdbc/continuum" auth="Container" type="javax.sql.DataSource"
+              username="sa"
+              password=""
+              driverClassName="org.apache.derby.jdbc.EmbeddedDriver"
+              url="jdbc:derby:${catalina.base}/target/database/continuum;create=true"
+    />
+    <Resource name="mail/Session" auth="Container"
+            type="javax.mail.Session"
+            mail.smtp.host="localhost"/>
+                
+</Context>
diff --git a/pom.xml b/pom.xml
index 3a3bcf79d574378b0ef1008df2ccfdb2a11e4b3f..c151bc6883390de38f57e06042c502c9e6cb8e3b 100644 (file)
--- a/pom.xml
+++ b/pom.xml
         <plugin>
           <groupId>org.apache.maven.plugins</groupId>
           <artifactId>maven-compiler-plugin</artifactId>
-          <version>2.0.2</version>
+          <version>2.3.2</version>
           <configuration>
             <source>1.5</source>
             <target>1.5</target>
           </configuration>
         </plugin>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-clean-plugin</artifactId>
+          <version>2.4.1</version>
+        </plugin>
         <plugin>
           <groupId>org.apache.maven.plugins</groupId>
           <artifactId>maven-remote-resources-plugin</artifactId>
         <plugin>
           <groupId>org.apache.maven.plugins</groupId>
           <artifactId>maven-surefire-plugin</artifactId>
-          <version>2.8</version>
+          <version>2.8.1</version>
           <configuration>
             <redirectTestOutputToFile>true</redirectTestOutputToFile>
           </configuration>
           <artifactId>maven-site-plugin</artifactId>
           <version>2.1</version>
         </plugin>
+        <plugin>
+          <groupId>org.codehaus.mojo</groupId>
+          <artifactId>tomcat-maven-plugin</artifactId>
+          <version>1.1</version>
+        </plugin>
       </plugins>
     </pluginManagement>
   </build>
     <binder.version>0.9</binder.version>
     <spring.version>2.5.6</spring.version>
     <jackrabbit.version>2.2.5</jackrabbit.version>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
   </properties>
   <profiles>
     <profile>