You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@archiva.apache.org by jo...@apache.org on 2007/01/18 21:39:20 UTC
svn commit: r497563 - in /maven/archiva/trunk: ./ archiva-cli/
archiva-converter/ archiva-core/
archiva-core/src/main/java/org/apache/maven/archiva/proxy/
archiva-plexus-application/ archiva-plexus-application/src/conf/
archiva-plexus-runtime/ archiva-...
Author: joakime
Date: Thu Jan 18 12:39:19 2007
New Revision: 497563
URL: http://svn.apache.org/viewvc?view=rev&rev=497563
Log:
* Upgraded webdav server to use new plexus-webdav with ability to override logic and correct flaws found in webdav servers.
* Added ProxiedDavServer component (used by plexus-webdav) to make /repository/ access proxied.
* Upgraded plexus, used [MRM-264] as baseline, but many more changes were needed.
* Plexus upgrade broken JSTL's <c:forTokens> taglib everywhere, corrected by moving away from that taglib.
* Created GroupIdLink tag following webwork guidelines for UI component.
* Fixed AuditLog.
Added:
maven/archiva/trunk/archiva-webapp/src/main/java/org/apache/maven/archiva/web/repository/
maven/archiva/trunk/archiva-webapp/src/main/java/org/apache/maven/archiva/web/repository/AuditLog.java (with props)
maven/archiva/trunk/archiva-webapp/src/main/java/org/apache/maven/archiva/web/repository/ProxiedDavServer.java (with props)
maven/archiva/trunk/archiva-webapp/src/main/java/org/apache/maven/archiva/web/repository/RepositoryServlet.java (with props)
maven/archiva/trunk/archiva-webapp/src/main/java/org/apache/maven/archiva/web/tags/
maven/archiva/trunk/archiva-webapp/src/main/java/org/apache/maven/archiva/web/tags/GroupIdLink.java (with props)
maven/archiva/trunk/archiva-webapp/src/main/java/org/apache/maven/archiva/web/tags/GroupIdLinkTag.java (with props)
maven/archiva/trunk/archiva-webapp/src/main/resources/META-INF/taglib.tld
Removed:
maven/archiva/trunk/archiva-core/src/main/java/org/apache/maven/archiva/proxy/
maven/archiva/trunk/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/ProxyAction.java
maven/archiva/trunk/archiva-webapp/src/main/java/org/apache/maven/archiva/web/servlet/
maven/archiva/trunk/archiva-webapp/src/test/java/org/apache/maven/archiva/web/servlet/repository/RepositoryAccessTest.java
Modified:
maven/archiva/trunk/archiva-cli/pom.xml
maven/archiva/trunk/archiva-converter/pom.xml
maven/archiva/trunk/archiva-core/pom.xml
maven/archiva/trunk/archiva-plexus-application/pom.xml
maven/archiva/trunk/archiva-plexus-application/src/conf/application.xml
maven/archiva/trunk/archiva-plexus-runtime/pom.xml
maven/archiva/trunk/archiva-security/pom.xml
maven/archiva/trunk/archiva-webapp/pom.xml
maven/archiva/trunk/archiva-webapp/src/main/resources/META-INF/plexus/application.xml
maven/archiva/trunk/archiva-webapp/src/main/resources/xwork.xml
maven/archiva/trunk/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/managedRepositories.jsp
maven/archiva/trunk/archiva-webapp/src/main/webapp/WEB-INF/jsp/browseArtifact.jsp
maven/archiva/trunk/archiva-webapp/src/main/webapp/WEB-INF/jsp/browseGroup.jsp
maven/archiva/trunk/archiva-webapp/src/main/webapp/WEB-INF/jsp/include/artifactInfo.jspf
maven/archiva/trunk/archiva-webapp/src/main/webapp/WEB-INF/tags/showArtifactLink.tag
maven/archiva/trunk/archiva-webapp/src/main/webapp/WEB-INF/web.xml
maven/archiva/trunk/pom.xml
maven/archiva/trunk/src/site/apt/guides/getting-started/index.apt
Modified: maven/archiva/trunk/archiva-cli/pom.xml
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-cli/pom.xml?view=diff&rev=497563&r1=497562&r2=497563
==============================================================================
--- maven/archiva/trunk/archiva-cli/pom.xml (original)
+++ maven/archiva/trunk/archiva-cli/pom.xml Thu Jan 18 12:39:19 2007
@@ -37,7 +37,7 @@
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-cli</artifactId>
- <version>1.0-SNAPSHOT</version>
+ <version>1.0</version>
</dependency>
<dependency>
<groupId>commons-lang</groupId>
Modified: maven/archiva/trunk/archiva-converter/pom.xml
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-converter/pom.xml?view=diff&rev=497563&r1=497562&r2=497563
==============================================================================
--- maven/archiva/trunk/archiva-converter/pom.xml (original)
+++ maven/archiva/trunk/archiva-converter/pom.xml Thu Jan 18 12:39:19 2007
@@ -34,6 +34,10 @@
<artifactId>plexus-utils</artifactId>
</dependency>
<dependency>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-component-api</artifactId>
+ </dependency>
+ <dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-artifact</artifactId>
</dependency>
@@ -53,6 +57,12 @@
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
+ </dependency>
+ <!-- Needed for PlexusTestCase -->
+ <dependency>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-container-default</artifactId>
+ <scope>test</scope>
</dependency>
</dependencies>
</project>
Modified: maven/archiva/trunk/archiva-core/pom.xml
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-core/pom.xml?view=diff&rev=497563&r1=497562&r2=497563
==============================================================================
--- maven/archiva/trunk/archiva-core/pom.xml (original)
+++ maven/archiva/trunk/archiva-core/pom.xml Thu Jan 18 12:39:19 2007
@@ -51,17 +51,27 @@
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-component-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-quartz</artifactId>
- <version>1.0-alpha-2</version>
+ <version>1.0-alpha-4-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-taskqueue</artifactId>
- <version>1.0-alpha-4</version>
+ <version>1.0-alpha-6-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
+ </dependency>
+ <!-- needed for PlexusTestCase -->
+ <dependency>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-container-default</artifactId>
+ <scope>test</scope>
</dependency>
</dependencies>
<build>
Modified: maven/archiva/trunk/archiva-plexus-application/pom.xml
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-plexus-application/pom.xml?view=diff&rev=497563&r1=497562&r2=497563
==============================================================================
--- maven/archiva/trunk/archiva-plexus-application/pom.xml (original)
+++ maven/archiva/trunk/archiva-plexus-application/pom.xml Thu Jan 18 12:39:19 2007
@@ -34,7 +34,7 @@
<plugin>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-appserver-maven-plugin</artifactId>
- <version>2.0-alpha-5</version>
+ <version>2.0-alpha-7-SNAPSHOT</version>
<extensions>true</extensions>
<configuration>
<applicationConfiguration>src/conf/application.xml</applicationConfiguration>
Modified: maven/archiva/trunk/archiva-plexus-application/src/conf/application.xml
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-plexus-application/src/conf/application.xml?view=diff&rev=497563&r1=497562&r2=497563
==============================================================================
--- maven/archiva/trunk/archiva-plexus-application/src/conf/application.xml (original)
+++ maven/archiva/trunk/archiva-plexus-application/src/conf/application.xml Thu Jan 18 12:39:19 2007
@@ -27,7 +27,7 @@
<webapps>
<webapp>
<file>${plexus.home}/lib/archiva-webapp-@archivaVersion@.war</file>
- <context>/</context>
+ <context>/archiva</context>
<extraction-path>${plexus.home}/webapp</extraction-path>
<standardWebappClassloader>true</standardWebappClassloader>
<listeners>
Modified: maven/archiva/trunk/archiva-plexus-runtime/pom.xml
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-plexus-runtime/pom.xml?view=diff&rev=497563&r1=497562&r2=497563
==============================================================================
--- maven/archiva/trunk/archiva-plexus-runtime/pom.xml (original)
+++ maven/archiva/trunk/archiva-plexus-runtime/pom.xml Thu Jan 18 12:39:19 2007
@@ -40,13 +40,13 @@
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-appserver-host</artifactId>
- <version>2.0-alpha-5</version>
+ <version>2.0-alpha-7-SNAPSHOT</version>
</dependency>
<!-- Services -->
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-appserver-service-jetty</artifactId>
- <version>2.0-alpha-5</version>
+ <version>2.0-alpha-7-SNAPSHOT</version>
<type>plexus-service</type>
</dependency>
<!-- Plexus applications -->
@@ -92,7 +92,7 @@
<plugin>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-appserver-maven-plugin</artifactId>
- <version>2.0-alpha-5</version>
+ <version>2.0-alpha-7-SNAPSHOT</version>
<extensions>true</extensions>
<executions>
<execution>
Modified: maven/archiva/trunk/archiva-security/pom.xml
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-security/pom.xml?view=diff&rev=497563&r1=497562&r2=497563
==============================================================================
--- maven/archiva/trunk/archiva-security/pom.xml (original)
+++ maven/archiva/trunk/archiva-security/pom.xml Thu Jan 18 12:39:19 2007
@@ -37,5 +37,9 @@
<groupId>org.codehaus.plexus.security</groupId>
<artifactId>plexus-security-system</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-component-api</artifactId>
+ </dependency>
</dependencies>
</project>
Modified: maven/archiva/trunk/archiva-webapp/pom.xml
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-webapp/pom.xml?view=diff&rev=497563&r1=497562&r2=497563
==============================================================================
--- maven/archiva/trunk/archiva-webapp/pom.xml (original)
+++ maven/archiva/trunk/archiva-webapp/pom.xml Thu Jan 18 12:39:19 2007
@@ -33,7 +33,13 @@
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
- <version>2.4</version>
+ <version>2.5</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>jsp-api</artifactId>
+ <version>2.0</version>
<scope>provided</scope>
</dependency>
<dependency>
@@ -140,6 +146,17 @@
<groupId>org.codehaus.plexus.security</groupId>
<artifactId>plexus-security-ui-web-taglib</artifactId>
</dependency>
+ <!-- Other dependencies -->
+ <dependency>
+ <groupId>org.codehaus.plexus.webdav</groupId>
+ <artifactId>plexus-webdav-simple</artifactId>
+ <version>1.0-alpha-1-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-xwork-integration</artifactId>
+ <version>1.0-alpha-5-SNAPSHOT</version>
+ </dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
@@ -149,11 +166,6 @@
<artifactId>derby</artifactId>
<version>10.1.3.1</version>
</dependency>
- <dependency>
- <groupId>it.could</groupId>
- <artifactId>webdav</artifactId>
- <version>0.4</version>
- </dependency>
</dependencies>
<build>
<plugins>
@@ -221,7 +233,7 @@
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
- <version>6.1.0</version>
+ <version>6.1.1</version>
<configuration>
<scanIntervalSeconds>10</scanIntervalSeconds>
<contextPath>/</contextPath>
@@ -240,6 +252,10 @@
<systemProperty>
<name>derby.system.home</name>
<value>${project.build.directory}/appserver-base/logs</value>
+ </systemProperty>
+ <systemProperty>
+ <name>configuration.store.file</name>
+ <value>archiva-configuration.xml</value>
</systemProperty>
</systemProperties>
</configuration>
Added: maven/archiva/trunk/archiva-webapp/src/main/java/org/apache/maven/archiva/web/repository/AuditLog.java
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-webapp/src/main/java/org/apache/maven/archiva/web/repository/AuditLog.java?view=auto&rev=497563
==============================================================================
--- maven/archiva/trunk/archiva-webapp/src/main/java/org/apache/maven/archiva/web/repository/AuditLog.java (added)
+++ maven/archiva/trunk/archiva-webapp/src/main/java/org/apache/maven/archiva/web/repository/AuditLog.java Thu Jan 18 12:39:19 2007
@@ -0,0 +1,137 @@
+package org.apache.maven.archiva.web.repository;
+
+/*
+ * 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.commons.lang.StringUtils;
+import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable;
+import org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException;
+import org.codehaus.plexus.webdav.DavServerComponent;
+import org.codehaus.plexus.webdav.DavServerListener;
+
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+/**
+ * AuditLog - Audit Log.
+ *
+ * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
+ * @version $Id$
+ *
+ * @plexus.component role="org.apache.maven.archiva.web.repository.AuditLog"
+ */
+public class AuditLog
+ implements DavServerListener, Initializable
+{
+ public static final String ROLE = AuditLog.class.getName();
+
+ /**
+ * @plexus.configuration default-value="${appserver.base}/logs/audit.log"
+ */
+ private File logFile;
+
+ /**
+ * @plexus.configuration default-value="yyyy-MM-dd HH:mm:ss"
+ */
+ private String timestampFormat;
+
+ private PrintWriter writer;
+
+ private SimpleDateFormat timestamp;
+
+ private String getServerId( DavServerComponent server )
+ {
+ return "[" + server.getPrefix() + "]";
+ }
+
+ public void serverCollectionCreated( DavServerComponent server, String resource )
+ {
+ log( getServerId( server ) + " Created Directory \"" + resource + "\"" );
+ }
+
+ public void serverCollectionRemoved( DavServerComponent server, String resource )
+ {
+ log( getServerId( server ) + " Removed Directory \"" + resource + "\"" );
+ }
+
+ public void serverResourceCreated( DavServerComponent server, String resource )
+ {
+ log( getServerId( server ) + " Created File \"" + resource + "\"" );
+ }
+
+ public void serverResourceModified( DavServerComponent server, String resource )
+ {
+ log( getServerId( server ) + " Modified Existing File \"" + resource + "\"" );
+ }
+
+ public void serverResourceRemoved( DavServerComponent server, String resource )
+ {
+ log( getServerId( server ) + " Removed File \"" + resource + "\"" );
+ }
+
+ /**
+ * Log the message to the file.
+ *
+ * @param msg the message.
+ */
+ public void log( String msg )
+ {
+ // Synchronize to prevent threading issues.
+ synchronized ( writer )
+ {
+ writer.println( timestamp.format( new Date() ) + " - " + msg );
+ // Manually flush buffer to ensure data is written to disk.
+ writer.flush();
+ }
+ }
+
+ public void initialize()
+ throws InitializationException
+ {
+ File parentDir = logFile.getParentFile();
+ if ( parentDir != null )
+ {
+ if ( !parentDir.exists() )
+ {
+ parentDir.mkdirs();
+ }
+ }
+
+ if ( StringUtils.isBlank( timestampFormat ) )
+ {
+ timestampFormat = "yyyy-MM-dd HH:mm:ss";
+ }
+
+ timestamp = new SimpleDateFormat( timestampFormat );
+
+ try
+ {
+ writer = new PrintWriter( new FileWriter( logFile ) );
+ log( "Logging Initialized." );
+ }
+ catch ( IOException e )
+ {
+ throw new InitializationException( "Unable to initialize log file writer: " + logFile.getAbsolutePath(), e );
+ }
+ }
+}
Propchange: maven/archiva/trunk/archiva-webapp/src/main/java/org/apache/maven/archiva/web/repository/AuditLog.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/archiva/trunk/archiva-webapp/src/main/java/org/apache/maven/archiva/web/repository/AuditLog.java
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Propchange: maven/archiva/trunk/archiva-webapp/src/main/java/org/apache/maven/archiva/web/repository/AuditLog.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: maven/archiva/trunk/archiva-webapp/src/main/java/org/apache/maven/archiva/web/repository/ProxiedDavServer.java
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-webapp/src/main/java/org/apache/maven/archiva/web/repository/ProxiedDavServer.java?view=auto&rev=497563
==============================================================================
--- maven/archiva/trunk/archiva-webapp/src/main/java/org/apache/maven/archiva/web/repository/ProxiedDavServer.java (added)
+++ maven/archiva/trunk/archiva-webapp/src/main/java/org/apache/maven/archiva/web/repository/ProxiedDavServer.java Thu Jan 18 12:39:19 2007
@@ -0,0 +1,198 @@
+package org.apache.maven.archiva.web.repository;
+
+/*
+ * 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.commons.lang.StringUtils;
+import org.apache.maven.archiva.configuration.Configuration;
+import org.apache.maven.archiva.configuration.ConfigurationStore;
+import org.apache.maven.archiva.configuration.ConfigurationStoreException;
+import org.apache.maven.archiva.configuration.ConfiguredRepositoryFactory;
+import org.apache.maven.archiva.configuration.ProxiedRepositoryConfiguration;
+import org.apache.maven.archiva.configuration.Proxy;
+import org.apache.maven.archiva.configuration.RepositoryConfiguration;
+import org.apache.maven.archiva.proxy.ProxyException;
+import org.apache.maven.archiva.proxy.ProxyRequestHandler;
+import org.apache.maven.artifact.repository.ArtifactRepository;
+import org.apache.maven.wagon.ResourceDoesNotExistException;
+import org.apache.maven.wagon.proxy.ProxyInfo;
+import org.codehaus.plexus.webdav.AbstractDavServerComponent;
+import org.codehaus.plexus.webdav.DavServerComponent;
+import org.codehaus.plexus.webdav.DavServerException;
+import org.codehaus.plexus.webdav.servlet.DavServerRequest;
+import org.codehaus.plexus.webdav.util.WebdavMethodUtil;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * ProxiedDavServer
+ *
+ * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
+ * @version $Id$
+ *
+ * @plexus.component role="org.codehaus.plexus.webdav.DavServerComponent"
+ * role-hint="proxied"
+ * instantiation-strategy="per-lookup"
+ */
+public class ProxiedDavServer
+ extends AbstractDavServerComponent
+{
+ /**
+ * @plexus.requirement role-hint="simple"
+ */
+ private DavServerComponent davServer;
+
+ /**
+ * @plexus.requirement
+ */
+ private ConfigurationStore configurationStore;
+
+ /**
+ * @plexus.requirement role="org.apache.maven.archiva.proxy.ProxyRequestHandler"
+ * @todo seems to be a bug in qdox that the role above is required
+ */
+ private ProxyRequestHandler proxyRequestHandler;
+
+ /**
+ * @plexus.requirement
+ */
+ private ConfiguredRepositoryFactory repositoryFactory;
+
+ private RepositoryConfiguration repositoryConfiguration;
+
+ private ArtifactRepository managedRepository;
+
+ private List/*<ArtifactRepository>*/ proxiedRepositories;
+
+ private ProxyInfo wagonProxy;
+
+ public String getPrefix()
+ {
+ return davServer.getPrefix();
+ }
+
+ public File getRootDirectory()
+ {
+ return davServer.getRootDirectory();
+ }
+
+ public void setPrefix( String prefix )
+ {
+ davServer.setPrefix( prefix );
+ }
+
+ public void setRootDirectory( File rootDirectory )
+ {
+ davServer.setRootDirectory( rootDirectory );
+ }
+
+ public void init( ServletConfig servletConfig )
+ throws DavServerException
+ {
+ davServer.init( servletConfig );
+
+ proxiedRepositories = new ArrayList();
+
+ try
+ {
+ Configuration config = configurationStore.getConfigurationFromStore();
+
+ wagonProxy = createWagonProxy( config.getProxy() );
+
+ repositoryConfiguration = config.getRepositoryByUrlName( getPrefix() );
+
+ managedRepository = repositoryFactory.createRepository( repositoryConfiguration );
+
+ for ( Iterator i = config.getProxiedRepositories().iterator(); i.hasNext(); )
+ {
+ ProxiedRepositoryConfiguration proxiedRepoConfig = (ProxiedRepositoryConfiguration) i.next();
+
+ if ( proxiedRepoConfig.getManagedRepository().equals( repositoryConfiguration.getId() ) )
+ {
+ proxiedRepositories.add( repositoryFactory.createProxiedRepository( proxiedRepoConfig ) );
+ }
+ }
+ }
+ catch ( ConfigurationStoreException e )
+ {
+ throw new DavServerException( "Unable to obtain configuration.", e );
+ }
+ }
+
+ public void process( DavServerRequest request, HttpServletResponse response )
+ throws DavServerException, ServletException, IOException
+ {
+ if ( WebdavMethodUtil.isReadMethod( request.getRequest().getMethod() ) )
+ {
+ if ( !hasResource( request.getLogicalResource() ) )
+ {
+ fetchContentFromProxies( request );
+ }
+ }
+
+ davServer.process( request, response );
+ }
+
+ private void fetchContentFromProxies( DavServerRequest request )
+ throws ServletException
+ {
+ try
+ {
+ proxyRequestHandler.get( request.getLogicalResource(), this.proxiedRepositories, this.managedRepository,
+ this.wagonProxy );
+ }
+ catch ( ResourceDoesNotExistException e )
+ {
+ throw new ServletException( "Unable to fetch resource, it does not exist.", e );
+ }
+ catch ( ProxyException e )
+ {
+ throw new ServletException( "Unable to fetch resource.", e );
+ }
+ }
+
+ private ProxyInfo createWagonProxy( Proxy proxy )
+ {
+ ProxyInfo proxyInfo = null;
+ if ( proxy != null && StringUtils.isNotEmpty( proxy.getHost() ) )
+ {
+ proxyInfo = new ProxyInfo();
+ proxyInfo.setHost( proxy.getHost() );
+ proxyInfo.setPort( proxy.getPort() );
+ proxyInfo.setUserName( proxy.getUsername() );
+ proxyInfo.setPassword( proxy.getPassword() );
+ proxyInfo.setNonProxyHosts( proxy.getNonProxyHosts() );
+ proxyInfo.setType( proxy.getProtocol() );
+ }
+ return proxyInfo;
+ }
+
+ public RepositoryConfiguration getRepositoryConfiguration()
+ {
+ return repositoryConfiguration;
+ }
+}
Propchange: maven/archiva/trunk/archiva-webapp/src/main/java/org/apache/maven/archiva/web/repository/ProxiedDavServer.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/archiva/trunk/archiva-webapp/src/main/java/org/apache/maven/archiva/web/repository/ProxiedDavServer.java
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Propchange: maven/archiva/trunk/archiva-webapp/src/main/java/org/apache/maven/archiva/web/repository/ProxiedDavServer.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: maven/archiva/trunk/archiva-webapp/src/main/java/org/apache/maven/archiva/web/repository/RepositoryServlet.java
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-webapp/src/main/java/org/apache/maven/archiva/web/repository/RepositoryServlet.java?view=auto&rev=497563
==============================================================================
--- maven/archiva/trunk/archiva-webapp/src/main/java/org/apache/maven/archiva/web/repository/RepositoryServlet.java (added)
+++ maven/archiva/trunk/archiva-webapp/src/main/java/org/apache/maven/archiva/web/repository/RepositoryServlet.java Thu Jan 18 12:39:19 2007
@@ -0,0 +1,234 @@
+package org.apache.maven.archiva.web.repository;
+
+/*
+ * 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.maven.archiva.configuration.Configuration;
+import org.apache.maven.archiva.configuration.ConfigurationChangeException;
+import org.apache.maven.archiva.configuration.ConfigurationChangeListener;
+import org.apache.maven.archiva.configuration.ConfigurationStore;
+import org.apache.maven.archiva.configuration.ConfigurationStoreException;
+import org.apache.maven.archiva.configuration.InvalidConfigurationException;
+import org.apache.maven.archiva.configuration.RepositoryConfiguration;
+import org.apache.maven.archiva.security.ArchivaRoleConstants;
+import org.codehaus.plexus.security.authentication.AuthenticationException;
+import org.codehaus.plexus.security.authentication.AuthenticationResult;
+import org.codehaus.plexus.security.authorization.AuthorizationException;
+import org.codehaus.plexus.security.authorization.AuthorizationResult;
+import org.codehaus.plexus.security.policy.AccountLockedException;
+import org.codehaus.plexus.security.policy.MustChangePasswordException;
+import org.codehaus.plexus.security.system.SecuritySession;
+import org.codehaus.plexus.security.system.SecuritySystem;
+import org.codehaus.plexus.security.ui.web.filter.authentication.HttpAuthenticator;
+import org.codehaus.plexus.webdav.DavServerComponent;
+import org.codehaus.plexus.webdav.DavServerException;
+import org.codehaus.plexus.webdav.servlet.DavServerRequest;
+import org.codehaus.plexus.webdav.servlet.multiplexed.MultiplexedWebDavServlet;
+import org.codehaus.plexus.webdav.util.WebdavMethodUtil;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * RepositoryServlet
+ *
+ * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
+ * @version $Id$
+ */
+public class RepositoryServlet
+ extends MultiplexedWebDavServlet
+ implements ConfigurationChangeListener
+{
+ /**
+ * @plexus.requirement
+ */
+ private SecuritySystem securitySystem;
+
+ /**
+ * @plexus.requirement role-hint="basic"
+ */
+ private HttpAuthenticator httpAuth;
+
+ /**
+ * @plexus.requirement
+ */
+ private AuditLog audit;
+
+ private Configuration config;
+
+ public void initComponents()
+ throws ServletException
+ {
+ super.initComponents();
+
+ ConfigurationStore configurationStore;
+
+ configurationStore = (ConfigurationStore) lookup( ConfigurationStore.ROLE );
+ securitySystem = (SecuritySystem) lookup( SecuritySystem.ROLE );
+ httpAuth = (HttpAuthenticator) lookup( HttpAuthenticator.ROLE, "basic" );
+ audit = (AuditLog) lookup( AuditLog.ROLE );
+
+ try
+ {
+ config = configurationStore.getConfigurationFromStore();
+ configurationStore.addChangeListener( this );
+ }
+ catch ( ConfigurationStoreException e )
+ {
+ throw new ServletException( "Unable to obtain configuration.", e );
+ }
+
+ }
+
+ public void initServers( ServletConfig servletConfig )
+ throws DavServerException
+ {
+ List repositories = config.getRepositories();
+ Iterator itrepos = repositories.iterator();
+ while ( itrepos.hasNext() )
+ {
+ RepositoryConfiguration repoConfig = (RepositoryConfiguration) itrepos.next();
+ DavServerComponent server = createServer( repoConfig.getUrlName(), new File( repoConfig.getDirectory() ),
+ servletConfig );
+ server.addListener( audit );
+ }
+ }
+
+ public RepositoryConfiguration getRepositoryConfiguration( DavServerRequest request )
+ {
+ return config.getRepositoryByUrlName( request.getPrefix() );
+ }
+
+ public String getRepositoryName( DavServerRequest request )
+ {
+ RepositoryConfiguration repoConfig = getRepositoryConfiguration( request );
+ if ( repoConfig == null )
+ {
+ return "Unknown";
+ }
+
+ return repoConfig.getName();
+ }
+
+ public boolean isAuthenticated( DavServerRequest davRequest, HttpServletResponse response )
+ throws ServletException, IOException
+ {
+ HttpServletRequest request = davRequest.getRequest();
+
+ // Authentication Tests.
+ try
+ {
+ AuthenticationResult result = httpAuth.getAuthenticationResult( request, response );
+
+ if ( ( result != null ) && !result.isAuthenticated() )
+ {
+ // Must Authenticate.
+ httpAuth.challenge( request, response, "Repository " + getRepositoryName( davRequest ),
+ new AuthenticationException( "User Credentials Invalid" ) );
+ return false;
+ }
+
+ }
+ catch ( AuthenticationException e )
+ {
+ log( "Fatal Http Authentication Error.", e );
+ throw new ServletException( "Fatal Http Authentication Error.", e );
+ }
+ catch ( AccountLockedException e )
+ {
+ httpAuth.challenge( request, response, "Repository " + getRepositoryName( davRequest ),
+ new AuthenticationException( "User account is locked" ) );
+ }
+ catch ( MustChangePasswordException e )
+ {
+ httpAuth.challenge( request, response, "Repository " + getRepositoryName( davRequest ),
+ new AuthenticationException( "You must change your password." ) );
+ }
+
+ return true;
+ }
+
+ public boolean isAuthorized( DavServerRequest davRequest, HttpServletResponse response )
+ throws ServletException, IOException
+ {
+ // Authorization Tests.
+ HttpServletRequest request = davRequest.getRequest();
+
+ boolean isWriteRequest = WebdavMethodUtil.isWriteMethod( request.getMethod() );
+
+ SecuritySession securitySession = httpAuth.getSecuritySession();
+ try
+ {
+ String permission = ArchivaRoleConstants.OPERATION_REPOSITORY_ACCESS;
+
+ if ( isWriteRequest )
+ {
+ permission = ArchivaRoleConstants.OPERATION_REPOSITORY_UPLOAD;
+ }
+
+ AuthorizationResult authzResult = securitySystem.authorize( securitySession, permission,
+ getRepositoryConfiguration( davRequest )
+ .getId() );
+
+ if ( !authzResult.isAuthorized() )
+ {
+ if ( authzResult.getException() != null )
+ {
+ log( "Authorization Denied [ip=" + request.getRemoteAddr() + ",isWriteRequest=" + isWriteRequest
+ + ",permission=" + permission + "] : " + authzResult.getException().getMessage() );
+ }
+
+ // Issue HTTP Challenge.
+ httpAuth.challenge( request, response, "Repository " + getRepositoryName( davRequest ),
+ new AuthenticationException( "Authorization Denied." ) );
+ return false;
+ }
+ }
+ catch ( AuthorizationException e )
+ {
+ throw new ServletException( "Fatal Authorization Subsystem Error." );
+ }
+
+ return true;
+ }
+
+ public void notifyOfConfigurationChange( Configuration newConfiguration )
+ throws InvalidConfigurationException, ConfigurationChangeException
+ {
+ config = newConfiguration;
+
+ getDavManager().removeAllServers();
+
+ try
+ {
+ initServers( getServletConfig() );
+ }
+ catch ( DavServerException e )
+ {
+ throw new ConfigurationChangeException( "Unable to process configuration change.", e );
+ }
+ }
+}
Propchange: maven/archiva/trunk/archiva-webapp/src/main/java/org/apache/maven/archiva/web/repository/RepositoryServlet.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/archiva/trunk/archiva-webapp/src/main/java/org/apache/maven/archiva/web/repository/RepositoryServlet.java
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Propchange: maven/archiva/trunk/archiva-webapp/src/main/java/org/apache/maven/archiva/web/repository/RepositoryServlet.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: maven/archiva/trunk/archiva-webapp/src/main/java/org/apache/maven/archiva/web/tags/GroupIdLink.java
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-webapp/src/main/java/org/apache/maven/archiva/web/tags/GroupIdLink.java?view=auto&rev=497563
==============================================================================
--- maven/archiva/trunk/archiva-webapp/src/main/java/org/apache/maven/archiva/web/tags/GroupIdLink.java (added)
+++ maven/archiva/trunk/archiva-webapp/src/main/java/org/apache/maven/archiva/web/tags/GroupIdLink.java Thu Jan 18 12:39:19 2007
@@ -0,0 +1,148 @@
+package org.apache.maven.archiva.web.tags;
+
+/*
+ * 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 com.opensymphony.webwork.WebWorkException;
+import com.opensymphony.webwork.components.Component;
+import com.opensymphony.xwork.util.OgnlValueStack;
+
+import java.io.IOException;
+import java.io.Writer;
+import java.util.StringTokenizer;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * GroupIdLink
+ *
+ * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
+ * @version $Id$
+ */
+public class GroupIdLink
+ extends Component
+{
+ private static final String ACTION = "browseGroup";
+
+ private static final String NAMESPACE = "/";
+
+ private static final boolean includeContext = false;
+
+ private static final boolean encode = true;
+
+ private static final String method = null;
+
+ private HttpServletRequest req;
+
+ private HttpServletResponse res;
+
+ private String groupId;
+
+ private boolean includeTop = false;
+
+ public GroupIdLink( OgnlValueStack stack, HttpServletRequest req, HttpServletResponse res )
+ {
+ super( stack );
+ this.req = req;
+ this.res = res;
+ }
+
+ public boolean end( Writer writer, String body )
+ {
+ StringBuffer sb = new StringBuffer();
+
+ sb.append( "<span class=\"groupId\">" );
+
+ if ( includeTop )
+ {
+ sb.append( "<a href=\"" );
+ sb.append( determineBrowseActionUrl() );
+ sb.append( "\">[top]</a> / " ); // TODO: i18n
+ }
+
+ StringTokenizer tok = new StringTokenizer( groupId, "." );
+ String cumulativeGroup = null;
+
+ while ( tok.hasMoreTokens() )
+ {
+ String token = tok.nextToken();
+
+ if ( cumulativeGroup == null )
+ {
+ cumulativeGroup = token;
+ }
+ else
+ {
+ cumulativeGroup += "." + token;
+ }
+ sb.append( "<a href=\"" );
+ sb.append( determineBrowseGroupActionUrl( cumulativeGroup ) );
+ sb.append( "\">" ).append( token ).append( "</a> / " );
+ }
+
+ sb.append( "</span>" );
+
+ try
+ {
+ writer.write( sb.toString() );
+ }
+ catch ( IOException e )
+ {
+ throw new WebWorkException( "IOError: " + e.getMessage(), e );
+ }
+
+ return super.end( writer, body );
+ }
+
+ private String determineBrowseActionUrl()
+ {
+ return determineActionURL( "browse", NAMESPACE, method, req, res, parameters, req.getScheme(), includeContext,
+ encode );
+ }
+
+ private String determineBrowseGroupActionUrl( String gid )
+ {
+ parameters.put( "groupId", gid );
+
+ return determineActionURL( ACTION, NAMESPACE, method, req, res, parameters, req.getScheme(), includeContext,
+ encode );
+ }
+
+ public String getGroupId()
+ {
+ return groupId;
+ }
+
+ public void setGroupId( String groupId )
+ {
+ this.groupId = groupId;
+ }
+
+ public boolean isIncludeTop()
+ {
+ return includeTop;
+ }
+
+ public void setIncludeTop( boolean includeTop )
+ {
+ this.includeTop = includeTop;
+ }
+
+}
Propchange: maven/archiva/trunk/archiva-webapp/src/main/java/org/apache/maven/archiva/web/tags/GroupIdLink.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/archiva/trunk/archiva-webapp/src/main/java/org/apache/maven/archiva/web/tags/GroupIdLink.java
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Propchange: maven/archiva/trunk/archiva-webapp/src/main/java/org/apache/maven/archiva/web/tags/GroupIdLink.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: maven/archiva/trunk/archiva-webapp/src/main/java/org/apache/maven/archiva/web/tags/GroupIdLinkTag.java
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-webapp/src/main/java/org/apache/maven/archiva/web/tags/GroupIdLinkTag.java?view=auto&rev=497563
==============================================================================
--- maven/archiva/trunk/archiva-webapp/src/main/java/org/apache/maven/archiva/web/tags/GroupIdLinkTag.java (added)
+++ maven/archiva/trunk/archiva-webapp/src/main/java/org/apache/maven/archiva/web/tags/GroupIdLinkTag.java Thu Jan 18 12:39:19 2007
@@ -0,0 +1,100 @@
+package org.apache.maven.archiva.web.tags;
+
+/*
+ * 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 com.opensymphony.webwork.views.jsp.TagUtils;
+
+import org.apache.taglibs.standard.tag.common.core.NullAttributeException;
+import org.apache.taglibs.standard.tag.el.core.ExpressionUtil;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.jsp.JspException;
+import javax.servlet.jsp.tagext.TagSupport;
+
+/**
+ * GroupIdLink
+ *
+ * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
+ * @version $Id$
+ */
+public class GroupIdLinkTag
+ extends TagSupport
+{
+ private String var_; // stores EL-based property
+
+ private Object var; // stores the evaluated object.
+
+ private boolean includeTop = false;
+
+ public void release()
+ {
+ var_ = null;
+ var = null;
+ includeTop = false;
+
+ super.release();
+ }
+
+ public int doEndTag()
+ throws JspException
+ {
+ evaluateExpressions();
+
+ GroupIdLink gidlink = new GroupIdLink( TagUtils.getStack( pageContext ), (HttpServletRequest) pageContext
+ .getRequest(), (HttpServletResponse) pageContext.getResponse() );
+
+ gidlink.setGroupId( var.toString() );
+ gidlink.setIncludeTop( includeTop );
+
+ gidlink.end( pageContext.getOut(), "" );
+
+ return super.doEndTag();
+ }
+
+ private void evaluateExpressions()
+ throws JspException
+ {
+ try
+ {
+ var = ExpressionUtil.evalNotNull( "groupIdLink", "var", var_, String.class, this, pageContext );
+ }
+ catch ( NullAttributeException e )
+ {
+ log( "groupIdLink var is null!", e );
+ var = "";
+ }
+ }
+
+ public void setVar( String value )
+ {
+ this.var_ = value;
+ }
+
+ private void log( String msg, Throwable t )
+ {
+ pageContext.getServletContext().log( msg, t );
+ }
+
+ public void setIncludeTop( boolean includeTop )
+ {
+ this.includeTop = includeTop;
+ }
+}
Propchange: maven/archiva/trunk/archiva-webapp/src/main/java/org/apache/maven/archiva/web/tags/GroupIdLinkTag.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/archiva/trunk/archiva-webapp/src/main/java/org/apache/maven/archiva/web/tags/GroupIdLinkTag.java
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Propchange: maven/archiva/trunk/archiva-webapp/src/main/java/org/apache/maven/archiva/web/tags/GroupIdLinkTag.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Modified: maven/archiva/trunk/archiva-webapp/src/main/resources/META-INF/plexus/application.xml
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-webapp/src/main/resources/META-INF/plexus/application.xml?view=diff&rev=497563&r1=497562&r2=497563
==============================================================================
--- maven/archiva/trunk/archiva-webapp/src/main/resources/META-INF/plexus/application.xml (original)
+++ maven/archiva/trunk/archiva-webapp/src/main/resources/META-INF/plexus/application.xml Thu Jan 18 12:39:19 2007
@@ -40,6 +40,16 @@
<jndiSessionName>java:comp/env/mail/Session</jndiSessionName>
</configuration>
</component>
+
+ <component>
+ <role>org.codehaus.plexus.webdav.DavServerManager</role>
+ <role-hint>default</role-hint>
+ <implementation>org.codehaus.plexus.webdav.DefaultDavServerManager</implementation>
+ <description>DefaultDavServerManager</description>
+ <configuration>
+ <provider-hint>proxied</provider-hint>
+ </configuration>
+ </component>
<component>
<role>org.codehaus.plexus.jdo.JdoFactory</role>
@@ -130,36 +140,9 @@
</property>
</properties>
</appender>
-
- <appender>
- <id>audit</id>
- <threshold>DEBUG</threshold>
- <type>org.apache.log4j.DailyRollingFileAppender</type>
- <conversion-pattern>%-4r [%t] %-5p %c %x - %m%n</conversion-pattern>
-
- <properties>
- <property>
- <name>file</name>
- <value>${appserver.base}/logs/audit.log</value>
- </property>
- <property>
- <name>append</name>
- <value>true</value>
- </property>
- <property>
- <name>datePattern</name>
- <value>'.'yyyy-MM-dd</value>
- </property>
- </properties>
- </appender>
</appenders>
<levels>
- <level>
- <hierarchy>org.apache.maven.archiva.web.servlet.repository.RepositoryMapping</hierarchy>
- <level>DEBUG, audit</level>
- </level>
-
<!-- Help identify bugs during testing -->
<level>
<hierarchy>org.apache.maven</hierarchy>
Added: maven/archiva/trunk/archiva-webapp/src/main/resources/META-INF/taglib.tld
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-webapp/src/main/resources/META-INF/taglib.tld?view=auto&rev=497563
==============================================================================
--- maven/archiva/trunk/archiva-webapp/src/main/resources/META-INF/taglib.tld (added)
+++ maven/archiva/trunk/archiva-webapp/src/main/resources/META-INF/taglib.tld Thu Jan 18 12:39:19 2007
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN" "http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd">
+<taglib>
+
+ <tlib-version>2.2.3</tlib-version>
+ <jsp-version>1.2</jsp-version>
+ <short-name>Archiva Taglib</short-name>
+
+ <uri>http://maven.apache.org/archiva</uri>
+
+ <display-name>Archiva Taglib</display-name>
+ <description><![CDATA[Archiva JSP Taglib]]></description>
+
+ <tag>
+
+ <name>groupIdLink</name>
+ <tag-class>org.apache.maven.archiva.web.tags.GroupIdLinkTag</tag-class>
+ <body-content>empty</body-content>
+ <description><![CDATA[Render a groupId as a set of Links]]></description>
+
+ <attribute>
+ <name>var</name>
+ <required>true</required>
+ <rtexprvalue>true</rtexprvalue>
+
+ <description><![CDATA[The GroupID String]]></description>
+ </attribute>
+
+ <attribute>
+ <name>includeTop</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+
+ <description><![CDATA[Boolean indicating if 'top' link should be created or not.]]></description>
+ </attribute>
+
+ </tag>
+
+</taglib>
\ No newline at end of file
Modified: maven/archiva/trunk/archiva-webapp/src/main/resources/xwork.xml
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-webapp/src/main/resources/xwork.xml?view=diff&rev=497563&r1=497562&r2=497563
==============================================================================
--- maven/archiva/trunk/archiva-webapp/src/main/resources/xwork.xml (original)
+++ maven/archiva/trunk/archiva-webapp/src/main/resources/xwork.xml Thu Jan 18 12:39:19 2007
@@ -181,16 +181,6 @@
<result>/WEB-INF/jsp/showArtifact.jsp</result>
</action>
- <action name="proxy" class="proxyAction">
- <result type="stream">
- <param name="contentType">${contentType}</param>
- <param name="contentDisposition">filename="${filename}"</param>
- <param name="inputName">artifactStream</param>
- <param name="bufferSize">1024</param>
- <param name="contentLength">${contentLength}</param>
- </result>
- <result name="notFound" type="httpheader">404</result>
- </action>
</package>
<package name="components" namespace="/components" extends="default">
Modified: maven/archiva/trunk/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/managedRepositories.jsp
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/managedRepositories.jsp?view=diff&rev=497563&r1=497562&r2=497563
==============================================================================
--- maven/archiva/trunk/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/managedRepositories.jsp (original)
+++ maven/archiva/trunk/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/managedRepositories.jsp Thu Jan 18 12:39:19 2007
@@ -79,7 +79,7 @@
</tr>
<tr>
<th>WebDAV URL</th>
- <td><a href="${urlbase}${repository.urlName}">${urlbase}${repository.urlName}</a></td>
+ <td><a href="${urlbase}${repository.urlName}/">${urlbase}${repository.urlName}/</a></td>
</tr>
<tr>
<th>Type</th>
@@ -121,7 +121,7 @@
<repository>
<id>${repository.id}</id>
<name>${repository.name}</name>
- <url>${urlbase}${repository.urlName}</url><c:if test="${repository.layout != 'default'}">
+ <url>${urlbase}${repository.urlName}/</url><c:if test="${repository.layout != 'default'}">
<layout>${repository.layout}</layout></c:if>
<releases>
<enabled>${repository.includeSnapshots ? 'false' : 'true'}</enabled>
Modified: maven/archiva/trunk/archiva-webapp/src/main/webapp/WEB-INF/jsp/browseArtifact.jsp
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-webapp/src/main/webapp/WEB-INF/jsp/browseArtifact.jsp?view=diff&rev=497563&r1=497562&r2=497563
==============================================================================
--- maven/archiva/trunk/archiva-webapp/src/main/webapp/WEB-INF/jsp/browseArtifact.jsp (original)
+++ maven/archiva/trunk/archiva-webapp/src/main/webapp/WEB-INF/jsp/browseArtifact.jsp Thu Jan 18 12:39:19 2007
@@ -19,6 +19,7 @@
<%@ taglib prefix="ww" uri="/webwork" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
+<%@ taglib prefix="archiva" uri="http://maven.apache.org/archiva" %>
<html>
<head>
@@ -33,23 +34,7 @@
<div id="contentArea">
<div id="nameColumn">
<p>
- <c:set var="cumulativeGroup" value=""/>
- <c:forTokens items="${groupId}" delims="./" var="part">
- <c:choose>
- <c:when test="${empty(cumulativeGroup)}">
- <c:set var="cumulativeGroup" value="${part}"/>
- </c:when>
- <c:otherwise>
- <c:set var="cumulativeGroup" value="${cumulativeGroup}.${part}"/>
- </c:otherwise>
- </c:choose>
- <c:set var="url">
- <ww:url action="browseGroup" namespace="/">
- <ww:param name="groupId" value="%{'${cumulativeGroup}'}"/>
- </ww:url>
- </c:set>
- <a href="${url}">${part}</a> /
- </c:forTokens>
+ <archiva:groupIdLink var="${groupId}" includeTop="true" />
<strong>${artifactId}</strong>
</p>
Modified: maven/archiva/trunk/archiva-webapp/src/main/webapp/WEB-INF/jsp/browseGroup.jsp
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-webapp/src/main/webapp/WEB-INF/jsp/browseGroup.jsp?view=diff&rev=497563&r1=497562&r2=497563
==============================================================================
--- maven/archiva/trunk/archiva-webapp/src/main/webapp/WEB-INF/jsp/browseGroup.jsp (original)
+++ maven/archiva/trunk/archiva-webapp/src/main/webapp/WEB-INF/jsp/browseGroup.jsp Thu Jan 18 12:39:19 2007
@@ -19,6 +19,7 @@
<%@ taglib prefix="ww" uri="/webwork" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
+<%@ taglib prefix="archiva" uri="http://maven.apache.org/archiva" %>
<html>
<head>
@@ -33,30 +34,7 @@
<div id="contentArea">
<div id="nameColumn">
<p>
- <c:set var="cumulativeGroup" value=""/>
- <c:forTokens items="${groupId}" delims="." var="part" varStatus="status">
- <c:choose>
- <c:when test="${empty(cumulativeGroup)}">
- <c:set var="cumulativeGroup" value="${part}"/>
- </c:when>
- <c:otherwise>
- <c:set var="cumulativeGroup" value="${cumulativeGroup}.${part}"/>
- </c:otherwise>
- </c:choose>
- <c:choose>
- <c:when test="${status.last}">
- <strong>${part}</strong>
- </c:when>
- <c:otherwise>
- <c:set var="url">
- <ww:url action="browseGroup" namespace="/">
- <ww:param name="groupId" value="%{'${cumulativeGroup}'}"/>
- </ww:url>
- </c:set>
- <a href="${url}">${part}</a> /
- </c:otherwise>
- </c:choose>
- </c:forTokens>
+ <archiva:groupIdLink var="${groupId}" includeTop="true" />
</p>
<ww:set name="groups" value="groups"/>
Modified: maven/archiva/trunk/archiva-webapp/src/main/webapp/WEB-INF/jsp/include/artifactInfo.jspf
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-webapp/src/main/webapp/WEB-INF/jsp/include/artifactInfo.jspf?view=diff&rev=497563&r1=497562&r2=497563
==============================================================================
--- maven/archiva/trunk/archiva-webapp/src/main/webapp/WEB-INF/jsp/include/artifactInfo.jspf (original)
+++ maven/archiva/trunk/archiva-webapp/src/main/webapp/WEB-INF/jsp/include/artifactInfo.jspf Thu Jan 18 12:39:19 2007
@@ -19,25 +19,11 @@
<%@ taglib prefix="ww" uri="/webwork" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
+<%@ taglib prefix="archiva" uri="http://maven.apache.org/archiva" %>
<p>
- <c:set var="cumulativeGroup" value=""/>
- <c:forTokens items="${model.groupId}" delims="." var="part">
- <c:choose>
- <c:when test="${empty(cumulativeGroup)}">
- <c:set var="cumulativeGroup" value="${part}"/>
- </c:when>
- <c:otherwise>
- <c:set var="cumulativeGroup" value="${cumulativeGroup}.${part}"/>
- </c:otherwise>
- </c:choose>
- <c:set var="url">
- <ww:url action="browseGroup" namespace="/">
- <ww:param name="groupId" value="%{'${cumulativeGroup}'}"/>
- </ww:url>
- </c:set>
- <a href="${url}">${part}</a> /
- </c:forTokens>
+ <archiva:groupIdLink var="${model.groupId}" includeTop="true" />
+
<c:set var="url">
<ww:url action="browseArtifact" namespace="/">
<ww:param name="groupId" value="%{'${model.groupId}'}"/>
Modified: maven/archiva/trunk/archiva-webapp/src/main/webapp/WEB-INF/tags/showArtifactLink.tag
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-webapp/src/main/webapp/WEB-INF/tags/showArtifactLink.tag?view=diff&rev=497563&r1=497562&r2=497563
==============================================================================
--- maven/archiva/trunk/archiva-webapp/src/main/webapp/WEB-INF/tags/showArtifactLink.tag (original)
+++ maven/archiva/trunk/archiva-webapp/src/main/webapp/WEB-INF/tags/showArtifactLink.tag Thu Jan 18 12:39:19 2007
@@ -19,6 +19,7 @@
<%@ taglib prefix="ww" uri="/webwork" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
+<%@ taglib prefix="archiva" uri="http://maven.apache.org/archiva" %>
<%@ attribute name="groupId" required="true" %>
<%@ attribute name="artifactId" %>
<%@ attribute name="version" %>
@@ -27,26 +28,8 @@
<%@ attribute name="versions" type="java.util.List" %>
<span class="artifact-link">
- <c:set var="cumulativeGroup" value=""/>
- <c:forTokens items="${groupId}" delims="." var="part" varStatus="i">
- <c:choose>
- <c:when test="${empty(cumulativeGroup)}">
- <c:set var="cumulativeGroup" value="${part}"/>
- </c:when>
- <c:otherwise>
- <c:set var="cumulativeGroup" value="${cumulativeGroup}.${part}"/>
- </c:otherwise>
- </c:choose>
- <c:set var="url">
- <ww:url action="browseGroup" namespace="/">
- <ww:param name="groupId" value="%{'${cumulativeGroup}'}"/>
- </ww:url>
- </c:set>
- <a href="${url}">${part}</a>
- <c:if test="${!i.last}">
- /
- </c:if>
- </c:forTokens>
+ <archiva:groupIdLink var="${model.groupId}" includeTop="true" />
+
<c:if test="${!empty(artifactId)}">
<c:set var="url">
<ww:url action="browseArtifact" namespace="/">
Modified: maven/archiva/trunk/archiva-webapp/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-webapp/src/main/webapp/WEB-INF/web.xml?view=diff&rev=497563&r1=497562&r2=497563
==============================================================================
--- maven/archiva/trunk/archiva-webapp/src/main/webapp/WEB-INF/web.xml (original)
+++ maven/archiva/trunk/archiva-webapp/src/main/webapp/WEB-INF/web.xml Thu Jan 18 12:39:19 2007
@@ -60,16 +60,12 @@
</listener>
<servlet>
- <servlet-name>RepositoryAccessServlet</servlet-name>
- <servlet-class>org.apache.maven.archiva.web.servlet.PlexusComponentServlet</servlet-class>
- <init-param>
- <param-name>key</param-name>
- <param-value>repositoryAccess</param-value>
- </init-param>
+ <servlet-name>RepositoryServlet</servlet-name>
+ <servlet-class>org.apache.maven.archiva.web.repository.RepositoryServlet</servlet-class>
</servlet>
<servlet-mapping>
- <servlet-name>RepositoryAccessServlet</servlet-name>
+ <servlet-name>RepositoryServlet</servlet-name>
<url-pattern>/repository/*</url-pattern>
</servlet-mapping>
Modified: maven/archiva/trunk/pom.xml
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/pom.xml?view=diff&rev=497563&r1=497562&r2=497563
==============================================================================
--- maven/archiva/trunk/pom.xml (original)
+++ maven/archiva/trunk/pom.xml Thu Jan 18 12:39:19 2007
@@ -154,15 +154,44 @@
<artifactId>maven-app-configuration-web</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
+ <!--
+ Rejected Plexus Container / Component Versions:
+ 1.0-alpha-11
+ 2007-01-17 11:40:40.371::WARN: Failed startup of context org.mortbay.jetty.webapp.WebAppContext@553763
+ {/,/home/joakim/code/maven/trunks/archiva/archiva-webapp/src/main/webapp}
+ java.lang.NullPointerException
+ at org.codehaus.plexus.classworlds.strategy.DefaultStrategy.getResource(DefaultStrategy.java:99)
+ at org.codehaus.plexus.classworlds.strategy.ForeignStrategy.getResource(ForeignStrategy.java:54)
+ at org.codehaus.plexus.classworlds.strategy.DefaultStrategy.getResourceAsStream(DefaultStrategy.java:107)
+ at org.codehaus.plexus.classworlds.realm.ClassRealm.getResourceAsStream(ClassRealm.java:207)
+ at org.codehaus.plexus.DefaultPlexusContainer.<init>(DefaultPlexusContainer.java:244)
+
+ 1.0-alpha-12
+ 1.0-alpha-13
+ 1.0-alpha-14
+ Caused by: org.codehaus.plexus.PlexusContainerException: The specified user configuration
+ 'file:/home/joakim/code/maven/trunks/archiva/archiva-webapp/src/main/webapp/WEB-INF/classes/META-INF/plexus/application.xml' is null.
+
+ 1.0-alpha-15
+ The resolution of ${configuration.store.file} is never attempted.
+
+ 1.0-alpha-16-SNAPSHOT
+ Incompatible with plexus-xwork-integration
+ -->
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-container-default</artifactId>
- <version>1.0-alpha-10</version>
+ <version>1.0-alpha-16-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-component-api</artifactId>
+ <version>1.0-alpha-16-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
- <version>1.3</version>
+ <version>1.4</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
@@ -188,6 +217,12 @@
<groupId>org.apache.maven</groupId>
<artifactId>maven-project</artifactId>
<version>${maven.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>plexus</groupId>
+ <artifactId>plexus-container-default</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
@@ -400,6 +435,7 @@
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
+ <source>1.4</source>
<aggregate>true</aggregate>
</configuration>
</plugin>
Modified: maven/archiva/trunk/src/site/apt/guides/getting-started/index.apt
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/src/site/apt/guides/getting-started/index.apt?view=diff&rev=497563&r1=497562&r2=497563
==============================================================================
--- maven/archiva/trunk/src/site/apt/guides/getting-started/index.apt (original)
+++ maven/archiva/trunk/src/site/apt/guides/getting-started/index.apt Thu Jan 18 12:39:19 2007
@@ -94,7 +94,7 @@
Setting up your Archiva instance
- * Goto {{http://localhost:9091/}} if on the embedded Jetty, {{http://localhost:8080/archiva/}} if on Tomcat or {{http://localhost:8080/}} if on Plexus.
+ * Goto {{http://localhost:9091/}} if on the embedded Jetty, {{http://localhost:8080/archiva/}} if on Tomcat or {{http://localhost:8080/archiva/}} if on Plexus.
* On the first page - setup your administration user. The password requires a numerical character and must not be longer than 8 chars. You'll then need to log in. User 'admin' as the username and the password you've entered.