diff options
Diffstat (limited to 'archiva-modules/archiva-web')
16 files changed, 2231 insertions, 12 deletions
diff --git a/archiva-modules/archiva-web/archiva-webapp-js/pom.xml b/archiva-modules/archiva-web/archiva-webapp-js/pom.xml index 01efe76fc..7a0e557d5 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/pom.xml +++ b/archiva-modules/archiva-web/archiva-webapp-js/pom.xml @@ -14,11 +14,12 @@ ~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
-<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>
<parent>
<groupId>org.apache.archiva</groupId>
- <artifactId>archiva-modules</artifactId>
+ <artifactId>archiva-web</artifactId>
<version>1.4-M2-SNAPSHOT</version>
</parent>
<artifactId>archiva-webapp-js</artifactId>
@@ -27,4 +28,572 @@ <name>Archiva Web :: Javascript Application</name>
+ <properties>
+ <tomcatContextXml>${basedir}/src/test/tomcat/tomcat-context.xml</tomcatContextXml>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.archiva</groupId>
+ <artifactId>generic-metadata-support</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.archiva</groupId>
+ <artifactId>npanday-support</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.archiva</groupId>
+ <artifactId>repository-statistics</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.archiva</groupId>
+ <artifactId>problem-reports</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.archiva</groupId>
+ <artifactId>audit</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.archiva</groupId>
+ <artifactId>archiva-scheduler-repository</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.archiva</groupId>
+ <artifactId>archiva-indexer</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.archiva</groupId>
+ <artifactId>archiva-repository-admin-api</artifactId>
+ </dependency>
+
+
+ <dependency>
+ <groupId>org.apache.archiva</groupId>
+ <artifactId>archiva-repository-admin-default</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.archiva</groupId>
+ <artifactId>metadata-repository-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.archiva</groupId>
+ <artifactId>metadata-store-jcr</artifactId>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.jackrabbit</groupId>
+ <artifactId>jackrabbit-core</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.velocity</groupId>
+ <artifactId>velocity</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.velocity</groupId>
+ <artifactId>velocity-tools</artifactId>
+ <version>1.3</version>
+ <scope>runtime</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>velocity</groupId>
+ <artifactId>velocity-dep</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>velocity</groupId>
+ <artifactId>velocity</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>struts</groupId>
+ <artifactId>struts</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.archiva</groupId>
+ <!-- FIXME: temporary coupling to plugin, should be runtime -->
+ <artifactId>maven2-repository</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-slf4j-logging</artifactId>
+ <scope>runtime</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-component-api</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-utils</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven.indexer</groupId>
+ <artifactId>indexer-core</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-container-default</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>classworlds</groupId>
+ <artifactId>classworlds</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>velocity</groupId>
+ <artifactId>velocity-dep</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-plugin-registry</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-settings</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>com.google.code.atinject</groupId>
+ <artifactId>atinject</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.archiva</groupId>
+ <artifactId>archiva-proxy</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.archiva</groupId>
+ <artifactId>archiva-repository-layer</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.archiva</groupId>
+ <artifactId>archiva-xml-tools</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>xerces</groupId>
+ <artifactId>xercesImpl</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.archiva</groupId>
+ <artifactId>archiva-security</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.archiva</groupId>
+ <artifactId>archiva-core-consumers</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.archiva</groupId>
+ <artifactId>archiva-configuration</artifactId>
+ <!-- TODO uncomment when repository admin will be finished
+ <scope>runtime</scope>
+ -->
+ </dependency>
+ <dependency>
+ <groupId>org.apache.archiva</groupId>
+ <artifactId>archiva-metadata-consumer</artifactId>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.archiva</groupId>
+ <artifactId>archiva-lucene-consumers</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.archiva</groupId>
+ <artifactId>stage-repository-merge</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.archiva</groupId>
+ <artifactId>archiva-signature-consumers</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.archiva</groupId>
+ <artifactId>archiva-applet</artifactId>
+ <!-- TODO: actually, just exclude from WAR plugin -->
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.archiva</groupId>
+ <artifactId>archiva-rss</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.archiva</groupId>
+ <artifactId>archiva-xmlrpc-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.archiva</groupId>
+ <artifactId>archiva-xmlrpc-services</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.archiva</groupId>
+ <artifactId>archiva-xmlrpc-security</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.codehaus.redback</groupId>
+ <artifactId>redback-xmlrpc-services</artifactId>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.redback</groupId>
+ <artifactId>redback-xmlrpc-security</artifactId>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+
+ <groupId>org.apache.archiva</groupId>
+ <artifactId>archiva-rest-services</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-server</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-continuation</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-http</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-io</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-util</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-security</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-servlet_3.0_spec</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-javamail_1.4_spec</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-servlet_2.5_spec</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.archiva</groupId>
+ <artifactId>archiva-rest-api</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-server</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-continuation</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-http</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-io</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-util</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-security</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-servlet_3.0_spec</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-javamail_1.4_spec</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-servlet_2.5_spec</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.archiva</groupId>
+ <artifactId>archiva-webdav</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>jpox</groupId>
+ <artifactId>jpox</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>javax.transaction</groupId>
+ <artifactId>jta</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>jpox</groupId>
+ <artifactId>jpox-ehcache</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>ehcache</groupId>
+ <artifactId>ehcache</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>org.codehaus.redback</groupId>
+ <artifactId>redback-rest-services</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.redback</groupId>
+ <artifactId>redback-common-integrations</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>stax</groupId>
+ <artifactId>stax-api</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.redback</groupId>
+ <artifactId>redback-integrations-security</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>jcl-over-slf4j</artifactId>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-bundle-jaxrs</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-server</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-servlet_2.5_spec</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-javamail_1.4_spec</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-web</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+
+ <resources>
+ <resource>
+ <directory>src/main/resources</directory>
+ </resource>
+ <resource>
+ <directory>src/main/filtered-resources</directory>
+ <filtering>true</filtering>
+ </resource>
+ </resources>
+
+ <plugins>
+
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>tomcat-maven-plugin</artifactId>
+ <configuration>
+ <port>9091</port>
+ <path>/archiva</path>
+ <contextFile>${tomcatContextXml}</contextFile>
+ <systemProperties>
+ <plexus.home>${project.build.directory}/appserver-base</plexus.home>
+ <appserver.base>${project.build.directory}/appserver-base</appserver.base>
+ <appserver.home>${project.build.directory}/appserver-home</appserver.home>
+ <derby.system.home>${project.build.directory}/appserver-base/logs</derby.system.home>
+ <redback.admin.creation.file>${basedir}/target/auto-admin-creation.properties</redback.admin.creation.file>
+ <java.io.tmpdir>${project.build.directory}</java.io.tmpdir>
+ </systemProperties>
+ </configuration>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.derby</groupId>
+ <artifactId>derby</artifactId>
+ <version>${derbyVersion}</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.mail</groupId>
+ <artifactId>mail</artifactId>
+ <version>${javaxMailVersion}</version>
+ </dependency>
+ </dependencies>
+ </plugin>
+ </plugins>
+ </build>
+
+ <profiles>
+ <profile>
+ <!-- profile for 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/tomcat/log4j.xml"
+ todir="${basedir}/src/main/webapp/WEB-INF/classes"/>
+ <copy overwrite="true" file="${basedir}/src/test/tomcat/auto-admin-creation.properties"
+ todir="${basedir}/target/"/>
+ </tasks>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
+ <!-- olamy profile to test tomcat plugin dev -->
+ <id>tdev</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.tomcat.maven</groupId>
+ <artifactId>tomcat6-maven-plugin</artifactId>
+ <configuration>
+ <port>9090</port>
+ <path>/</path>
+ <contextFile>${tomcatContextXml}</contextFile>
+ <systemProperties>
+ <plexus.home>${project.build.directory}/appserver-base</plexus.home>
+ <appserver.base>${project.build.directory}/appserver-base</appserver.base>
+ <appserver.home>${project.build.directory}/appserver-home</appserver.home>
+ <derby.system.home>${project.build.directory}/appserver-base/logs</derby.system.home>
+ <redback.admin.creation.file>${basedir}/target/auto-admin-creation.properties
+ </redback.admin.creation.file>
+ <java.io.tmpdir>${project.build.directory}</java.io.tmpdir>
+ </systemProperties>
+ </configuration>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.derby</groupId>
+ <artifactId>derby</artifactId>
+ <version>${derbyVersion}</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.mail</groupId>
+ <artifactId>mail</artifactId>
+ <version>1.4</version>
+ </dependency>
+ </dependencies>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.tomcat.maven</groupId>
+ <artifactId>tomcat7-maven-plugin</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <configuration>
+ <port>9090</port>
+ <path>/</path>
+ <contextFile>${tomcatContextXml}</contextFile>
+ <systemProperties>
+ <plexus.home>${project.build.directory}/appserver-base</plexus.home>
+ <appserver.base>${project.build.directory}/appserver-base</appserver.base>
+ <appserver.home>${project.build.directory}/appserver-home</appserver.home>
+ <derby.system.home>${project.build.directory}/appserver-base/logs</derby.system.home>
+ <redback.admin.creation.file>${basedir}/target/auto-admin-creation.properties
+ </redback.admin.creation.file>
+ <java.io.tmpdir>${project.build.directory}</java.io.tmpdir>
+ </systemProperties>
+ </configuration>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.derby</groupId>
+ <artifactId>derby</artifactId>
+ <version>${derbyVersion}</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.mail</groupId>
+ <artifactId>mail</artifactId>
+ <version>1.4</version>
+ </dependency>
+ </dependencies>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+
</project>
diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/filtered-resources/application.properties b/archiva-modules/archiva-web/archiva-webapp-js/src/main/filtered-resources/application.properties new file mode 100644 index 000000000..12806aa73 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/filtered-resources/application.properties @@ -0,0 +1,22 @@ +# +# 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. +# +user.agent=Apache Archiva/${project.version} +archiva.version=${project.version} +archiva.buildNumber=${buildNumber} +archiva.timestamp=${timestamp} diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/java/org/apache/archiva/web/spring/RepositoryListenerFactoryBean.java b/archiva-modules/archiva-web/archiva-webapp-js/src/main/java/org/apache/archiva/web/spring/RepositoryListenerFactoryBean.java new file mode 100644 index 000000000..582290284 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/java/org/apache/archiva/web/spring/RepositoryListenerFactoryBean.java @@ -0,0 +1,64 @@ +package org.apache.archiva.web.spring; + +/* + * 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. + */ + +import org.apache.archiva.repository.events.RepositoryListener; +import org.springframework.beans.BeansException; +import org.springframework.beans.factory.FactoryBean; +import org.springframework.context.ApplicationContext; +import org.springframework.context.ApplicationContextAware; + +import java.util.List; + +/** + * @todo though we will eventually remove this altogether, an interim cleanup would be to genericise this + * and replace the calls in RepositoryContentConsumers with calls to the same thing + */ +public class RepositoryListenerFactoryBean + implements FactoryBean, ApplicationContextAware +{ + + private ApplicationContext applicationContext; + + public void setApplicationContext( ApplicationContext applicationContext ) + throws BeansException + { + this.applicationContext = applicationContext; + } + + public Object getObject() + throws Exception + { + return applicationContext.getBeansOfType( RepositoryListener.class ).values(); + } + + @SuppressWarnings("unchecked") + public Class<List> getObjectType() + { + return List.class; + } + + public boolean isSingleton() + { + return true; + } + + +} diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/java/org/apache/archiva/web/startup/ArchivaStartup.java b/archiva-modules/archiva-web/archiva-webapp-js/src/main/java/org/apache/archiva/web/startup/ArchivaStartup.java new file mode 100644 index 000000000..46aca0bb7 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/java/org/apache/archiva/web/startup/ArchivaStartup.java @@ -0,0 +1,208 @@ +package org.apache.archiva.web.startup; + +/* + * 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. + */ + +import org.apache.archiva.common.ArchivaException; +import org.apache.archiva.common.plexusbridge.PlexusSisuBridge; +import org.apache.archiva.common.plexusbridge.PlexusSisuBridgeException; +import org.apache.archiva.scheduler.repository.RepositoryArchivaTaskScheduler; +import org.apache.maven.index.NexusIndexer; +import org.apache.maven.index.context.IndexingContext; +import org.codehaus.plexus.taskqueue.Task; +import org.codehaus.plexus.taskqueue.execution.ThreadedTaskQueueExecutor; +import org.codehaus.redback.components.scheduler.DefaultScheduler; +import org.quartz.SchedulerException; +import org.springframework.web.context.WebApplicationContext; +import org.springframework.web.context.support.WebApplicationContextUtils; + +import javax.servlet.ServletContextEvent; +import javax.servlet.ServletContextListener; +import java.lang.reflect.Field; +import java.util.Properties; +import java.util.concurrent.ExecutorService; + +/** + * ArchivaStartup - the startup of all archiva features in a deterministic order. + * + * @version $Id$ + */ +public class ArchivaStartup + implements ServletContextListener +{ + private ThreadedTaskQueueExecutor tqeDbScanning; + + private ThreadedTaskQueueExecutor tqeRepoScanning; + + private ThreadedTaskQueueExecutor tqeIndexing; + + private RepositoryArchivaTaskScheduler repositoryTaskScheduler; + + private PlexusSisuBridge plexusSisuBridge; + + private NexusIndexer nexusIndexer; + + public void contextInitialized( ServletContextEvent contextEvent ) + { + WebApplicationContext wac = + WebApplicationContextUtils.getRequiredWebApplicationContext( contextEvent.getServletContext() ); + + SecuritySynchronization securitySync = wac.getBean( SecuritySynchronization.class ); + + repositoryTaskScheduler = + wac.getBean( "archivaTaskScheduler#repository", RepositoryArchivaTaskScheduler.class ); + + Properties archivaRuntimeProperties = wac.getBean( "archivaRuntimeProperties", Properties.class ); + + tqeRepoScanning = wac.getBean( "taskQueueExecutor#repository-scanning", ThreadedTaskQueueExecutor.class ); + + tqeIndexing = wac.getBean( "taskQueueExecutor#indexing", ThreadedTaskQueueExecutor.class ); + + plexusSisuBridge = wac.getBean( PlexusSisuBridge.class ); + + try + { + nexusIndexer = plexusSisuBridge.lookup( NexusIndexer.class ); + } + catch ( PlexusSisuBridgeException e ) + { + throw new RuntimeException( "Unable to get NexusIndexer: " + e.getMessage(), e ); + } + try + { + securitySync.startup(); + repositoryTaskScheduler.startup(); + Banner.display( (String) archivaRuntimeProperties.get( "archiva.version" ) ); + } + catch ( ArchivaException e ) + { + throw new RuntimeException( "Unable to properly startup archiva: " + e.getMessage(), e ); + } + } + + public void contextDestroyed( ServletContextEvent contextEvent ) + { + WebApplicationContext applicationContext = + WebApplicationContextUtils.getRequiredWebApplicationContext( contextEvent.getServletContext() ); + + // TODO check this stop + + /* + if ( applicationContext != null && applicationContext instanceof ClassPathXmlApplicationContext ) + { + ( (ClassPathXmlApplicationContext) applicationContext ).close(); + } */ + + if ( applicationContext != null ) //&& applicationContext instanceof PlexusWebApplicationContext ) + { + // stop task queue executors + stopTaskQueueExecutor( tqeDbScanning ); + stopTaskQueueExecutor( tqeRepoScanning ); + stopTaskQueueExecutor( tqeIndexing ); + + // stop the DefaultArchivaTaskScheduler and its scheduler + if ( repositoryTaskScheduler != null ) + { + try + { + repositoryTaskScheduler.stop(); + } + catch ( SchedulerException e ) + { + e.printStackTrace(); + } + + try + { + // shutdown the scheduler, otherwise Quartz scheduler and Threads still exists + Field schedulerField = repositoryTaskScheduler.getClass().getDeclaredField( "scheduler" ); + schedulerField.setAccessible( true ); + + DefaultScheduler scheduler = (DefaultScheduler) schedulerField.get( repositoryTaskScheduler ); + scheduler.stop(); + } + catch ( Exception e ) + { + e.printStackTrace(); + } + } + + // close the application context + //applicationContext.close(); + // TODO fix close call + //applicationContext. + } + + // closing correctly indexer to close correctly lock and file + for ( IndexingContext indexingContext : nexusIndexer.getIndexingContexts().values() ) + { + try + { + indexingContext.close( false ); + } + catch ( Exception e ) + { + contextEvent.getServletContext().log( "skip error closing indexingContext " + e.getMessage() ); + } + } + + } + + private void stopTaskQueueExecutor( ThreadedTaskQueueExecutor taskQueueExecutor ) + { + if ( taskQueueExecutor != null ) + { + Task currentTask = taskQueueExecutor.getCurrentTask(); + if ( currentTask != null ) + { + taskQueueExecutor.cancelTask( currentTask ); + } + + try + { + taskQueueExecutor.stop(); + ExecutorService service = getExecutorServiceForTTQE( taskQueueExecutor ); + if ( service != null ) + { + service.shutdown(); + } + } + catch ( Exception e ) + { + e.printStackTrace(); + } + } + } + + private ExecutorService getExecutorServiceForTTQE( ThreadedTaskQueueExecutor ttqe ) + { + ExecutorService service = null; + try + { + Field executorServiceField = ttqe.getClass().getDeclaredField( "executorService" ); + executorServiceField.setAccessible( true ); + service = (ExecutorService) executorServiceField.get( ttqe ); + } + catch ( Exception e ) + { + e.printStackTrace(); + } + return service; + } +} diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/java/org/apache/archiva/web/startup/Banner.java b/archiva-modules/archiva-web/archiva-webapp-js/src/main/java/org/apache/archiva/web/startup/Banner.java new file mode 100644 index 000000000..e9272c808 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/java/org/apache/archiva/web/startup/Banner.java @@ -0,0 +1,229 @@ +package org.apache.archiva.web.startup; + +/* + * 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. + */ + +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import org.apache.commons.lang.StringUtils; +import org.slf4j.LoggerFactory; + +/** + * Banner + * + * @version $Id$ + */ +public class Banner +{ + private static final String eol = System.getProperty("line.separator"); + + public static String encode( String raw ) + { + // Canonicalize line ends to make them easier to process + raw = raw.replace("\r\n", "\n").replace("\r", "\n"); + + StringBuilder encoded = new StringBuilder(); + int rawlen = raw.length(); + + for ( int i = 0; i < rawlen; i++ ) + { + char c = raw.charAt( i ); + if ( c == '\\' ) + { + encoded.append( "$." ); + } + else if ( c == '$' ) + { + encoded.append( "$$" ); + } + else if ( c == '\n' ) + { + encoded.append( "$n" ); + } + else if ( Character.isDigit( c ) ) + { + encoded.append( c ); + } + else if ( Character.isLetter( c ) ) + { + encoded.append( rot13( c ) ); + } + else if ( i < raw.length() - 1 ) + { + char nc; + boolean done = false; + int count = 0; + for ( int n = i; !done; n++ ) + { + if ( n >= rawlen ) + { + break; + } + + nc = raw.charAt( n ); + + if ( nc != c ) + { + done = true; + } + else + { + count++; + } + } + if ( count < 3 ) + { + encoded.append( c ); + } + else + { + encoded.append( "$" ).append( String.valueOf( count ) ).append( c ); + i += count - 1; + } + } + else + { + encoded.append( c ); + } + } + + return encoded.toString(); + } + + public static String decode( String encoded ) + { + StringBuilder decoded = new StringBuilder(); + int enlen = encoded.length(); + for ( int i = 0; i < enlen; i++ ) + { + char c = encoded.charAt( i ); + if ( c == '$' ) + { + char nc = encoded.charAt( i + 1 ); + if ( nc == '$' ) + { + decoded.append( '$' ); + i++; + } + else if ( nc == '.' ) + { + decoded.append( '\\' ); + i++; + } + else if ( nc == 'n' ) + { + decoded.append( eol ); + i++; + } + else if ( Character.isDigit( nc ) ) + { + int count = 0; + int nn = i + 1; + while ( Character.isDigit( nc ) ) + { + count = ( count * 10 ); + count += ( nc - '0' ); + nc = encoded.charAt( ++nn ); + } + for ( int d = 0; d < count; d++ ) + { + decoded.append( nc ); + } + i = nn; + } + } + else if ( Character.isLetter( c ) ) + { + decoded.append( rot13( c ) ); + } + else + { + decoded.append( c ); + } + } + + return decoded.toString(); + } + + private static char rot13( char c ) + { + if ( ( c >= 'a' ) && ( c <= 'z' ) ) + { + char dc = c += 13; + if ( dc > 'z' ) + { + dc -= 26; + } + return dc; + } + else if ( ( c >= 'A' ) && ( c <= 'Z' ) ) + { + char dc = c += 13; + if ( dc > 'Z' ) + { + dc -= 26; + } + return dc; + } + else + { + return c; + } + } + + public static String injectVersion( String text, String version ) + { + Pattern pat = Pattern.compile( "#{2,}" ); + Matcher mat = pat.matcher( text ); + StringBuilder ret = new StringBuilder(); + int off = 0; + + while ( mat.find( off ) ) + { + ret.append( text.substring( off, mat.start() ) ); + String repl = mat.group(); + ret.append( StringUtils.center( version, repl.length() ) ); + off = mat.end(); + } + + ret.append( text.substring( off ) ); + + return ret.toString(); + } + + public static String getBanner( String version ) + { + String encodedBanner = "$26 $34_$n$15 /$._$7 /$34 $.$n$14 /`/@),$4 | Ba" + + " orunys bs nyy bs gur nycnpnf |$n$14 | (~' __| gbvyvat njnl ba " + + "gur Ncnpur Nepuvin |$n$6 _,--.$3_/ |$4 $.$5 cebwrpg grnz, V jbhyq y" + + "vxr gb$3 |$n$4 ,' ,$5 ($3 |$5 $.$5 jrypbzr lbh gb Nepuvin$6 |$" + + "n$4 | ($6 $. /$6 | $32# |$n$5 $. )$._/ ,_/$7 |$36 |$n$5 / /$3 " + + "( |/$9 | uggc://nepuvin.ncnpur.bet/ |$n$4 ( |$4 ( |$10 | hf" + + "ref@nepuvin.ncnpur.bet$7 |$n$5 $.|$5 $.|$11 $.$34_/$n$n"; + + return injectVersion( decode( encodedBanner ), version ); + } + + public static void display( String version ) + { + String banner = getBanner( version ); + LoggerFactory.getLogger( Banner.class ).info( StringUtils.repeat( "_", 25 ) + eol + banner ); + } +} diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/java/org/apache/archiva/web/startup/SecuritySynchronization.java b/archiva-modules/archiva-web/archiva-webapp-js/src/main/java/org/apache/archiva/web/startup/SecuritySynchronization.java new file mode 100644 index 000000000..a49ea5a2a --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/java/org/apache/archiva/web/startup/SecuritySynchronization.java @@ -0,0 +1,245 @@ +package org.apache.archiva.web.startup; + +/* + * 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. + */ + +import org.apache.archiva.security.common.ArchivaRoleConstants; +import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.lang.StringUtils; +import org.apache.archiva.common.ArchivaException; +import org.apache.archiva.configuration.ArchivaConfiguration; +import org.apache.archiva.configuration.ConfigurationNames; +import org.apache.archiva.configuration.ManagedRepositoryConfiguration; +import org.codehaus.plexus.redback.rbac.RBACManager; +import org.codehaus.plexus.redback.rbac.RbacManagerException; +import org.codehaus.plexus.redback.rbac.UserAssignment; +import org.codehaus.plexus.redback.role.RoleManager; +import org.codehaus.plexus.redback.role.RoleManagerException; +import org.codehaus.plexus.redback.system.check.EnvironmentCheck; +import org.codehaus.plexus.redback.users.UserManager; +import org.codehaus.plexus.registry.Registry; +import org.codehaus.plexus.registry.RegistryListener; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.context.ApplicationContext; +import org.springframework.stereotype.Service; + +import javax.annotation.PostConstruct; +import javax.inject.Inject; +import javax.inject.Named; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; + +/** + * ConfigurationSynchronization + * + * @version $Id$ + */ +@Service +public class SecuritySynchronization + implements RegistryListener +{ + private Logger log = LoggerFactory.getLogger( SecuritySynchronization.class ); + + @Inject + private RoleManager roleManager; + + @Inject + @Named( value = "rBACManager#cached" ) + private RBACManager rbacManager; + + private Map<String, EnvironmentCheck> checkers; + + @Inject + private ArchivaConfiguration archivaConfiguration; + + @Inject + private ApplicationContext applicationContext; + + @PostConstruct + public void initialize() + { + checkers = getBeansOfType( EnvironmentCheck.class ); + } + + protected <T> Map<String, T> getBeansOfType( Class<T> clazz ) + { + //TODO do some caching here !!! + // olamy : with plexus we get only roleHint + // as per convention we named spring bean role#hint remove role# if exists + Map<String, T> springBeans = applicationContext.getBeansOfType( clazz ); + + Map<String, T> beans = new HashMap<String, T>( springBeans.size() ); + + for ( Entry<String, T> entry : springBeans.entrySet() ) + { + String key = StringUtils.substringAfterLast( entry.getKey(), "#" ); + beans.put( key, entry.getValue() ); + } + return beans; + } + + public void afterConfigurationChange( Registry registry, String propertyName, Object propertyValue ) + { + if ( ConfigurationNames.isManagedRepositories( propertyName ) ) + { + synchConfiguration( archivaConfiguration.getConfiguration().getManagedRepositories() ); + } + } + + public void beforeConfigurationChange( Registry registry, String propertyName, Object propertyValue ) + { + /* do nothing */ + } + + private void synchConfiguration( List<ManagedRepositoryConfiguration> repos ) + { + // NOTE: Remote Repositories do not have roles or security placed around them. + + for ( ManagedRepositoryConfiguration repoConfig : repos ) + { + // manage roles for repositories + try + { + if ( !roleManager.templatedRoleExists( ArchivaRoleConstants.TEMPLATE_REPOSITORY_OBSERVER, + repoConfig.getId() ) ) + { + roleManager.createTemplatedRole( ArchivaRoleConstants.TEMPLATE_REPOSITORY_OBSERVER, + repoConfig.getId() ); + } + else + { + roleManager.verifyTemplatedRole( ArchivaRoleConstants.TEMPLATE_REPOSITORY_OBSERVER, + repoConfig.getId() ); + } + + if ( !roleManager.templatedRoleExists( ArchivaRoleConstants.TEMPLATE_REPOSITORY_MANAGER, + repoConfig.getId() ) ) + { + roleManager.createTemplatedRole( ArchivaRoleConstants.TEMPLATE_REPOSITORY_MANAGER, + repoConfig.getId() ); + } + else + { + roleManager.verifyTemplatedRole( ArchivaRoleConstants.TEMPLATE_REPOSITORY_MANAGER, + repoConfig.getId() ); + } + } + catch ( RoleManagerException e ) + { + // Log error. + log.error( "Unable to create roles for configured repositories: " + e.getMessage(), e ); + } + } + } + + public void startup() + throws ArchivaException + { + executeEnvironmentChecks(); + + synchConfiguration( archivaConfiguration.getConfiguration().getManagedRepositories() ); + archivaConfiguration.addChangeListener( this ); + + if ( archivaConfiguration.isDefaulted() ) + { + assignRepositoryObserverToGuestUser( archivaConfiguration.getConfiguration().getManagedRepositories() ); + } + } + + private void executeEnvironmentChecks() + throws ArchivaException + { + if ( ( checkers == null ) || CollectionUtils.isEmpty( checkers.values() ) ) + { + throw new ArchivaException( + "Unable to initialize the Redback Security Environment, " + "no Environment Check components found." ); + } + + List<String> violations = new ArrayList<String>(); + + for ( Entry<String, EnvironmentCheck> entry : checkers.entrySet() ) + { + EnvironmentCheck check = entry.getValue(); + List<String> v = new ArrayList<String>(); + check.validateEnvironment( v ); + log.info( "Environment Check: " + entry.getKey() + " -> " + v.size() + " violation(s)" ); + for ( String s : v ) + { + violations.add( "[" + entry.getKey() + "] " + s ); + } + } + + if ( CollectionUtils.isNotEmpty( violations ) ) + { + StringBuilder msg = new StringBuilder(); + msg.append( "EnvironmentCheck Failure.\n" ); + msg.append( "======================================================================\n" ); + msg.append( " ENVIRONMENT FAILURE !! \n" ); + msg.append( "\n" ); + + for ( String violation : violations ) + { + msg.append( violation ).append( "\n" ); + } + + msg.append( "\n" ); + msg.append( "======================================================================" ); + log.error( msg.toString() ); + + throw new ArchivaException( "Unable to initialize Redback Security Environment, [" + violations.size() + + "] violation(s) encountered, See log for details." ); + } + } + + private void assignRepositoryObserverToGuestUser( List<ManagedRepositoryConfiguration> repos ) + { + for ( ManagedRepositoryConfiguration repoConfig : repos ) + { + String repoId = repoConfig.getId(); + + String principal = UserManager.GUEST_USERNAME; + + try + { + UserAssignment ua; + + if ( rbacManager.userAssignmentExists( principal ) ) + { + ua = rbacManager.getUserAssignment( principal ); + } + else + { + ua = rbacManager.createUserAssignment( principal ); + } + + ua.addRoleName( ArchivaRoleConstants.toRepositoryObserverRoleName( repoId ) ); + rbacManager.saveUserAssignment( ua ); + } + catch ( RbacManagerException e ) + { + log.warn( "Unable to add role [" + ArchivaRoleConstants.toRepositoryObserverRoleName( repoId ) + "] to " + + principal + " user.", e ); + } + } + } +} diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/resources/META-INF/spring-context.xml b/archiva-modules/archiva-web/archiva-webapp-js/src/main/resources/META-INF/spring-context.xml new file mode 100755 index 000000000..fb14d761a --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/resources/META-INF/spring-context.xml @@ -0,0 +1,48 @@ +<?xml version="1.0"?> + +<!-- + ~ 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. + --> +<beans xmlns="http://www.springframework.org/schema/beans" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:context="http://www.springframework.org/schema/context" + xmlns:util="http://www.springframework.org/schema/util" + xsi:schemaLocation="http://www.springframework.org/schema/beans + http://www.springframework.org/schema/beans/spring-beans-3.0.xsd + http://www.springframework.org/schema/context + http://www.springframework.org/schema/context/spring-context-3.0.xsd + http://www.springframework.org/schema/util + http://www.springframework.org/schema/util/spring-util-3.0.xsd" + default-lazy-init="true"> + + <context:annotation-config/> + <context:component-scan base-package="org.apache.archiva.web"/> + + <util:properties id="archivaRuntimeProperties" location="classpath:application.properties" /> + + <bean id="jcr-repository" class="org.apache.jackrabbit.core.RepositoryImpl" destroy-method="shutdown" lazy-init="true"> + <constructor-arg ref="jcr-config"/> + </bean> + + <bean id="jcr-config" class="org.apache.archiva.metadata.repository.jcr.ArchivaJcrRepositoryConfig" factory-method="create"> + <constructor-arg value="${appserver.base}/conf/repository.xml"/> + <constructor-arg value="${appserver.base}/data/jcr"/> + </bean> + + +</beans>
\ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/resources/org/apache/archiva/security.properties b/archiva-modules/archiva-web/archiva-webapp-js/src/main/resources/org/apache/archiva/security.properties new file mode 100644 index 000000000..2074ef020 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/resources/org/apache/archiva/security.properties @@ -0,0 +1,27 @@ +# +# 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. +# + +# -------------------------------------------------------------------- +# Email Settings + +# The subject line for the email message. +email.validation.subject=Welcome to Archiva + +# Feedback page +email.feedback.path=http://archiva.apache.org/mail-lists.html diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/resources/org/apache/archiva/security_en.properties b/archiva-modules/archiva-web/archiva-webapp-js/src/main/resources/org/apache/archiva/security_en.properties new file mode 100644 index 000000000..661b0cba7 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/resources/org/apache/archiva/security_en.properties @@ -0,0 +1,20 @@ +# +# 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. +# + + diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/WEB-INF/applicationContext.xml b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/WEB-INF/applicationContext.xml new file mode 100644 index 000000000..3c04c0140 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/WEB-INF/applicationContext.xml @@ -0,0 +1,419 @@ +<?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. + --> +<beans xmlns="http://www.springframework.org/schema/beans" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:context="http://www.springframework.org/schema/context" + xmlns:task="http://www.springframework.org/schema/task" + xmlns:util="http://www.springframework.org/schema/util" + xsi:schemaLocation="http://www.springframework.org/schema/beans + http://www.springframework.org/schema/beans/spring-beans-3.0.xsd + http://www.springframework.org/schema/context + http://www.springframework.org/schema/context/spring-context-3.0.xsd + http://www.springframework.org/schema/task + http://www.springframework.org/schema/task/spring-task-3.0.xsd + http://www.springframework.org/schema/util + http://www.springframework.org/schema/util/spring-util-3.0.xsd"> + + <context:property-placeholder location="classpath:application.properties"/> + + <bean id="loggerManager" class="org.codehaus.plexus.logging.slf4j.Slf4jLoggerManager" + init-method="initialize"/> + + <!-- only here to cleanup temp indexes for groups increase number if use for something else --> + <task:executor id="springExecutor" pool-size="2"/> + <task:scheduler id="springScheduler" pool-size="2"/> + <task:annotation-driven executor="springExecutor" scheduler="springScheduler"/> + + <alias name="repositoryStatisticsManager#default" alias="repositoryStatisticsManager"/> + <!-- TODO olamy need to find a more dynamic way if using jcr impl --> + <alias name="repositorySessionFactory#jcr" alias="repositorySessionFactory"/> + + + <bean name="xmlRpcUserRepositories" class="org.apache.archiva.web.xmlrpc.security.XmlRpcUserRepositories"> + <constructor-arg ref="userRepositories"/> + <constructor-arg ref="xmlRpcAuthenticator"/> + </bean> + + <!-- Web Service : Ping Service --> + <bean name="pingService" lazy-init="true" scope="singleton" + class="org.apache.archiva.web.xmlrpc.services.PingServiceImpl"/> + + + <!-- Web Services : Search Service --> + <bean name="searchService" lazy-init="true" scope="singleton" + class="org.apache.archiva.web.xmlrpc.services.SearchServiceImpl"> + <constructor-arg ref="xmlRpcUserRepositories"/> + <constructor-arg ref="repositorySessionFactory"/> + <constructor-arg ref="nexusSearch"/> + </bean> + + + + <!-- Web Services : Administration Service --> + <bean name="administrationService" lazy-init="true" scope="singleton" + class="org.apache.archiva.web.xmlrpc.services.AdministrationServiceImpl"> + <constructor-arg ref="archivaAdministration#default"/> + <constructor-arg ref="repositoryContentConsumers"/> + <constructor-arg ref="repositoryContentFactory#default"/> + <constructor-arg ref="repositorySessionFactory"/> + <constructor-arg ref="archivaTaskScheduler#repository"/> + <constructor-arg> + <bean class="org.apache.archiva.web.spring.RepositoryListenerFactoryBean"/> + </constructor-arg> + <constructor-arg ref="repositoryStatisticsManager"/> + <constructor-arg ref="repositoryMerger#maven2"/> + <constructor-arg ref="auditListener#logging"/> + <constructor-arg ref="managedRepositoryAdmin#default"/> + <constructor-arg ref="remoteRepositoryAdmin#default"/> + <constructor-arg ref="proxyConnectorAdmin#default"/> + <constructor-arg ref="repositoryGroupAdmin#default"/> + </bean> + + + <!-- Redback Web Services --> + <bean name="redbackRoleService" lazy-init="true" scope="singleton" + class="org.codehaus.redback.xmlrpc.service.RoleServiceImpl"> + <constructor-arg ref="rBACManager#cached"/> + <constructor-arg ref="roleManager"/> + </bean> + + <bean name="redbackOperationService" lazy-init="true" scope="singleton" + class="org.codehaus.redback.xmlrpc.service.OperationServiceImpl"> + <constructor-arg ref="rBACManager#cached"/> + </bean> + + <bean name="redbackPermissionService" lazy-init="true" scope="singleton" + class="org.codehaus.redback.xmlrpc.service.PermissionServiceImpl"> + <constructor-arg ref="rBACManager#cached"/> + </bean> + + <bean name="redbackResourceService" lazy-init="true" scope="singleton" + class="org.codehaus.redback.xmlrpc.service.ResourceServiceImpl"> + <constructor-arg ref="rBACManager#cached"/> + </bean> + + <bean name="redbackUserService" lazy-init="true" scope="singleton" + class="org.codehaus.redback.xmlrpc.service.UserServiceImpl"> + <constructor-arg ref="userManager#cached"/> + </bean> + + <bean name="xmlrpcServicesList" lazy-init="true" scope="singleton" class="java.util.ArrayList"> + <constructor-arg> + <list> + <ref bean="administrationService"/> + <ref bean="searchService"/> + <ref bean="pingService"/> + </list> + </constructor-arg> + </bean> + + <bean name="xmlRpcAuthenticator" class="org.apache.archiva.web.xmlrpc.security.XmlRpcAuthenticator"> + <constructor-arg ref="securitySystem"/> + <constructor-arg ref="userRepositories"/> + </bean> + + <bean name="redbackXmlrpcServicesList" class="java.util.ArrayList"> + <constructor-arg> + <list> + <ref bean="redbackOperationService"/> + <ref bean="redbackPermissionService"/> + <ref bean="redbackResourceService"/> + <ref bean="redbackRoleService"/> + <ref bean="redbackUserService"/> + </list> + </constructor-arg> + </bean> + + <bean name="redbackXmlRpcAuthenticator" class="org.codehaus.redback.xmlrpc.security.XmlRpcAuthenticator"> + <constructor-arg ref="securitySystem"/> + </bean> + + <bean id="mailSession" class="org.springframework.jndi.JndiObjectFactoryBean"> + <property name="jndiName" value="java:comp/env/mail/Session"> + </property> + </bean> + + <bean name="mailSender" class="org.springframework.mail.javamail.JavaMailSenderImpl"> + <property name="session" ref="mailSession"/> + </bean> + + <bean name="commons-configuration" class="org.codehaus.redback.components.registry.commons.CommonsConfigurationRegistry"> + <property name="properties"> + <value> + <![CDATA[ + <configuration> + <system/> + <jndi prefix="java:comp/env" config-optional="true"/> + <xml fileName="${user.home}/.m2/archiva.xml" config-optional="true" + config-name="org.apache.archiva.user" + config-at="org.apache.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.archiva.base" + config-at="org.apache.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.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/archiva/security.properties" config-at="org.codehaus.plexus.redback"/> + </configuration> + ]]> + </value> + </property> + </bean> + + <bean name="jdoFactory#users" class="org.codehaus.plexus.jdo.DataSourceConfigurableJdoFactory"> + <property name="connectionFactoryName" value="java:comp/env/jdbc/users"/> + <property name="shutdownConnectionFactoryName" value="java:comp/env/jdbc/usersShutdown"/> + <property name="persistenceManagerFactoryClass" value="org.jpox.PersistenceManagerFactoryImpl"/> + <property name="otherProperties"> + <props> + <prop key="org.jpox.autoCreateSchema">true</prop> + <prop key="org.jpox.validateTables">false</prop> + <prop key="org.jpox.validateConstraints">false</prop> + <prop key="org.jpox.validateColumns">false</prop> + <prop key="org.jpox.autoStartMechanism">None</prop> + <prop key="org.jpox.transactionIsolation">READ_COMMITTED</prop> + <prop key="org.jpox.poid.transactionIsolation">READ_COMMITTED</prop> + <prop key="org.jpox.rdbms.dateTimezone">JDK_DEFAULT_TIMEZONE</prop> + <!-- NEEDED FOR MYSQL UTF-8 Databases --> + <prop key="org.jpox.rdbms.stringDefaultLength">255</prop> + + <!-- NEEDED FOR POSTGRES, But causes problems in other JDBC implementations. + <prop key="org.jpox.identifier.case">PreserveCase</prop> + --> + + <!-- cache activation --> + <prop key="org.jpox.cache.level2">true</prop> + <prop key="org.jpox.cache.level2.type">ehcacheclassbased</prop> + <prop key="org.jpox.cache.level2.cacheName">defaultJpox</prop> + <prop key="org.jpox.cache.level2.configurationFile">/ehcache.xml</prop> + </props> + </property> + </bean> + + + <bean name="scheduler" class="org.codehaus.redback.components.scheduler.DefaultScheduler"> + <property name="properties"> + <props> + <prop key="org.quartz.scheduler.instanceName">scheduler1</prop> + <prop key="org.quartz.threadPool.class">org.quartz.simpl.SimpleThreadPool</prop> + <prop key="org.quartz.threadPool.threadCount">2</prop> + <prop key="org.quartz.threadPool.threadPriority">4</prop> + <prop key="org.quartz.jobStore.class">org.quartz.simpl.RAMJobStore</prop> + </props> + </property> + </bean> + + + + <!-- <component> + <role>org.apache.archiva.webdav.util.MimeTypes</role> + <implementation>org.apache.archiva.webdav.util.MimeTypes</implementation> + <description>MimeTypes</description> + <configuration> + <resource>archiva-mime-types.txt</resource> + </configuration> + </component> --> + + + <!-- + olamy TODO check if necessary !! + 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> + --> + + <!-- TODO move to spring sample and test it --> + <!-- 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 + --> + + <!-- + <bean name="ldapConnectionFactory" class="org.codehaus.plexus.redback.common.ldap.connection.ConfigurableLdapConnectionFactory"> + <property name="userConf" ref="userConfiguration"/> + </bean> + --> + + + <!-- + + 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. + --> + + <!-- + <bean name="ldapUserMapper" class="org.codehaus.plexus.redback.common.ldap.LdapUserMapper"> + <property name="emailAttribute" value="email"/> + <property name="fullNameAttribute" value="givenName"/> + <property name="passwordAttribute" value="userPassword"/> + <property name="userIdAttribute" value="cn"/> + <property name="userBaseDn" value="o=com"/> + <property name="userObjectClass" value="inetOrgPerson"/> + <property name="userConf" ref="userConfiguration"/> + </bean> + --> + + + + <!-- + + 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 + --> + + <!-- + <bean name="userManager#cached" class="org.codehaus.plexus.redback.users.cached.CachedUserManager"> + <property name="userImpl" ref="userMapper#ldap"/> + <property name="usersCache" ref="cache#users"/> + </bean> + --> + + + + <!-- + + 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 + --> + <!-- + <bean name="userSecurityPolicy" class="org.codehaus.plexus.redback.policy.DefaultUserSecurityPolicy"> + <property name="config" ref="userConfiguration"/> + <property name="passwordEncoder" ref="passwordEncoder#sha1"/> + <property name="userValidationSettings" ref="userValidationSettings"/> + <property name="rememberMeCookieSettings" ref="cookieSettings#rememberMe"/> + <property name="signonCookieSettings" ref="cookieSettings#signon"/> + <property name="rules"> + add the rules you want to applied + <list> + <ref bean="passwordRule#alpha-count"/> + <ref bean="passwordRule#alpha-numeric"/> + <ref bean="passwordRule#character-length"/> + <ref bean="passwordRule#must-have"/> + <ref bean="passwordRule#no-whitespaces"/> + <ref bean="passwordRule#numerical-count"/> + </list> + </property> + </bean> + --> + <!-- END SNIPPET: ldap --> + + + + <!-- override jcr repository location --> + <!-- START SNIPPET: jcr-location --> + <!-- + <bean id="jcr-config" class="org.apache.archiva.metadata.repository.jcr.ArchivaJcrRepositoryConfig" factory-method="create"> + <constructor-arg value="${appserver.base}/conf/repository.xml"/> + <constructor-arg value="${appserver.base}/data/jcr"/> + </bean> + --> + <!-- END SNIPPET: jcr-location --> + +</beans> diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/WEB-INF/web.xml b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/WEB-INF/web.xml index 9f88c1f96..c607265e8 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/WEB-INF/web.xml +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/WEB-INF/web.xml @@ -1,7 +1,180 @@ -<!DOCTYPE web-app PUBLIC - "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" - "http://java.sun.com/dtd/web-app_2_3.dtd" > +<?xml version="1.0" encoding="UTF-8"?> + +<!-- + ~ Copyright 2005-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. + --> + + +<web-app xmlns="http://java.sun.com/xml/ns/j2ee" version="2.4" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"> + + <display-name>Apache Archiva</display-name> + + <context-param> + <param-name>contextConfigLocation</param-name> + <param-value> + classpath*:META-INF/spring-context.xml, + /WEB-INF/applicationContext.xml + </param-value> + </context-param> + + <filter> + <filter-name>encodingFilter</filter-name> + <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class> + <init-param> + <param-name>encoding</param-name> + <param-value>UTF-8</param-value> + </init-param> + <init-param> + <param-name>forceEncoding</param-name> + <param-value>true</param-value> + </init-param> + </filter> + + <filter-mapping> + <filter-name>encodingFilter</filter-name> + <url-pattern>/*</url-pattern> + </filter-mapping> + + <listener> + <listener-class> + org.springframework.web.context.ContextLoaderListener + </listener-class> + </listener> + <listener> + <!-- TODO: some Spring technique for this? --> + <listener-class> + org.apache.archiva.web.startup.ArchivaStartup + </listener-class> + </listener> + + <listener> + <listener-class>net.sf.ehcache.constructs.web.ShutdownListener</listener-class> + </listener> + + <!-- to cleanup temporary group index created during a session --> + <listener> + <listener-class>org.apache.archiva.webdav.util.TemporaryGroupIndexSessionCleaner</listener-class> + </listener> + + <servlet> + <servlet-name>RepositoryServlet</servlet-name> + <servlet-class> + org.apache.archiva.webdav.RepositoryServlet + </servlet-class> + <!-- Loading this on startup so as to take advantage of configuration listeners --> + <load-on-startup>1</load-on-startup> + </servlet> + + <servlet> + <servlet-name>XmlRpcServlet</servlet-name> + <servlet-class> + com.atlassian.xmlrpc.spring.BinderSpringXmlRpcServlet + </servlet-class> + <init-param> + <param-name>serviceListBeanName</param-name> + <param-value>xmlrpcServicesList</param-value> + </init-param> + <init-param> + <param-name>authHandlerBeanName</param-name> + <param-value>xmlRpcAuthenticator</param-value> + </init-param> + <init-param> + <param-name>enabledForExtensions</param-name> + <param-value>true</param-value> + </init-param> + <load-on-startup>2</load-on-startup> + </servlet> + + <servlet> + <servlet-name>RedbackXmlRpcServlet</servlet-name> + <servlet-class>com.atlassian.xmlrpc.spring.BinderSpringXmlRpcServlet</servlet-class> + <init-param> + <param-name>serviceListBeanName</param-name> + <param-value>redbackXmlrpcServicesList</param-value> + </init-param> + <init-param> + <param-name>authHandlerBeanName</param-name> + <param-value>redbackXmlRpcAuthenticator</param-value> + </init-param> + <init-param> + <param-name>enabledForExtensions</param-name> + <param-value>true</param-value> + </init-param> + </servlet> + + <servlet> + <servlet-name>RssFeedServlet</servlet-name> + <servlet-class> + org.apache.archiva.web.rss.RssFeedServlet + </servlet-class> + </servlet> + + <servlet-mapping> + <servlet-name>RssFeedServlet</servlet-name> + <url-pattern>/feeds/*</url-pattern> + </servlet-mapping> + + <servlet-mapping> + <servlet-name>RepositoryServlet</servlet-name> + <url-pattern>/repository/*</url-pattern> + </servlet-mapping> + + <servlet-mapping> + <servlet-name>XmlRpcServlet</servlet-name> + <url-pattern>/xmlrpc</url-pattern> + </servlet-mapping> + + <servlet-mapping> + <servlet-name>RedbackXmlRpcServlet</servlet-name> + <url-pattern>/redback-xmlrpc</url-pattern> + </servlet-mapping> + + <resource-ref> + <res-ref-name>jdbc/users</res-ref-name> + <res-type>javax.sql.DataSource</res-type> + <res-auth>Container</res-auth> + <res-sharing-scope>Shareable</res-sharing-scope> + </resource-ref> + <resource-ref> + <res-ref-name>mail/Session</res-ref-name> + <res-type>javax.mail.Session</res-type> + <res-auth>Container</res-auth> + <res-sharing-scope>Shareable</res-sharing-scope> + </resource-ref> + + + <servlet> + <servlet-name>CXFServlet</servlet-name> + <servlet-class>org.apache.cxf.transport.servlet.CXFServlet</servlet-class> + <load-on-startup>1</load-on-startup> + </servlet> + + <servlet-mapping> + <servlet-name>CXFServlet</servlet-name> + <url-pattern>/restServices/*</url-pattern> + </servlet-mapping> + + <welcome-file-list> + <welcome-file>index.html</welcome-file> + </welcome-file-list> + + <session-config> + <!-- 30 minutes session timeout --> + <session-timeout>30</session-timeout> + </session-config> -<web-app> - <display-name>Archetype Created Web Application</display-name> </web-app> diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/index.html b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/index.html new file mode 100644 index 000000000..ba9f35830 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/index.html @@ -0,0 +1,67 @@ +<!DOCTYPE html> +<html> +<head> + <link rel="stylesheet" href="css/aristo.css"/> + <link rel="stylesheet" href="css/bootstrap.min.1.4.0.css"> + + <script type="text/javascript" src="js/jquery-1.7.js"></script> + + <script type="text/javascript" src="js/lab.js"></script> + <script type="text/javascript" src="js/require.1.0.1.js"></script> + +</head> + +<body style="padding-top: 40px;"> + +<div id="topbar-menu-container"></div> + +<div class="container-fluid"> + <div class="sidebar" id="sidebar-content"></div> + + <div class="content"> + <div class="row" id="user-messages"></div> + + <div class="row" id="main-content"></div> + </div> +</div> + + + + +<div id="html-fragments" class="hide"></div> + +</body> + +<div id="dialog-confirm" title="" style="display: none"> +</div> + +<script type="text/javascript"> + require.config({ + baseUrl: "js/" + }); + $LAB.setGlobalDefaults({AlwaysPreserveOrder:true,BasePath:"js/",explicit_preloading:false}); + $LAB + .script("utils.js").wait() + .script("jquery.tmpl.js").wait() + .script("jquery.cookie.1.0.0.js").wait() + .script("knockout-debug.js").wait() + .script("jquery-ui-1.8.16.custom.min.js").wait() + .script("redback/register.js").wait() + .script("jquery.i18n.properties-1.0.9.js").wait() + .script("redback/i18nload.js").wait() + .script("jquery.validate.js").wait() + .script("jquery.json-2.3.min.js").wait() + .script("redback/operation.js").wait() + .script("main-tmpl.js").wait() + .script("redback/redback-tmpl.js").wait() + .script("bootstrap-modal.js").wait() + .script("bootstrap-alerts.js").wait() + .script("bootstrap-dropdown.js").wait() + .script("knockout.simpleGrid.js").wait() + .script("redback/user.js").wait() + .script("redback/users.js").wait() + .script("main.js"); + +</script> + +</html> diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/index.jsp b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/index.jsp deleted file mode 100644 index c38169bb9..000000000 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/index.jsp +++ /dev/null @@ -1,5 +0,0 @@ -<html> -<body> -<h2>Hello World!</h2> -</body> -</html> diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/test/tomcat/auto-admin-creation.properties b/archiva-modules/archiva-web/archiva-webapp-js/src/test/tomcat/auto-admin-creation.properties new file mode 100644 index 000000000..7c8c5815b --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/test/tomcat/auto-admin-creation.properties @@ -0,0 +1,22 @@ +# +# 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. +# + +redback.admin.fullname=Archiva Admin +redback.admin.email=admin@toto.com +redback.admin.password=admin123
\ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/test/tomcat/log4j.xml b/archiva-modules/archiva-web/archiva-webapp-js/src/test/tomcat/log4j.xml new file mode 100644 index 000000000..934409da7 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/test/tomcat/log4j.xml @@ -0,0 +1,80 @@ +<?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. + --> + +<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> + +<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"> + + <appender name="console" class="org.apache.log4j.ConsoleAppender"> + <layout class="org.apache.log4j.PatternLayout"> + <param name="ConversionPattern" value="%d [%t] %-5p %c %x - %m%n"/> + </layout> + </appender> + + <logger name="org.apache.archiva.indexer.search.NexusRepositorySearch"> + <level value="debug"/> + </logger> + <logger name="org.apache.archiva.common.plexusbridge.MavenIndexerUtils"> + <level value="debug"/> + </logger> + <logger name="JPOX"> + <level value="error"/> + </logger> + + <logger name="org.apache.commons.configuration.DefaultConfigurationBuilder"> + <level value="error"/> + </logger> + + <logger name="org.apache.archiva.admin.repository.managed"> + <level value="debug"/> + </logger> + + + + <logger name="org.springframework"> + <level value="info"/> + </logger> + + <logger name="org.codehaus.plexus"> + <level value="info"/> + </logger> + + <logger name="org.codehaus.redback"> + <level value="info"/> + </logger> + + <logger name="org.apache.cxf"> + <level value="info"/> + </logger> + + <logger name="org.quartz"> + <level value="info"/> + </logger> + + <logger name="org.apache.archiva.indexer.merger"> + <level value="debug"/> + </logger> + + <root> + <priority value ="info" /> + <appender-ref ref="console" /> + </root> + +</log4j:configuration> diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/test/tomcat/tomcat-context-archiva.xml b/archiva-modules/archiva-web/archiva-webapp-js/src/test/tomcat/tomcat-context-archiva.xml new file mode 100644 index 000000000..fda8f8221 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/test/tomcat/tomcat-context-archiva.xml @@ -0,0 +1,31 @@ +<?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="/archiva"> + <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="mail/Session" auth="Container" + type="javax.mail.Session" + mail.smtp.host="localhost"/> + +</Context> |