aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/pom.xml6
-rw-r--r--archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/pom.xml8
-rw-r--r--archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/remote/RemoteRepositoryAdmin.java4
-rw-r--r--archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/pom.xml248
-rw-r--r--archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/DefaultRepositoryCommonValidator.java46
-rw-r--r--archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/admin/DefaultArchivaAdministration.java2
-rw-r--r--archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/remote/DefaultRemoteRepositoryAdmin.java16
-rw-r--r--archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/test/java/org/apache/archiva/admin/repository/ValidatorTest.java9
-rw-r--r--archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/test/java/org/apache/archiva/admin/repository/networkproxy/NetworkProxyAdminTest.java2
-rw-r--r--archiva-modules/archiva-maven/archiva-maven-repository/src/test/java/org/apache/archiva/configuration/MockRepoAdmin.java4
-rw-r--r--archiva-modules/archiva-scheduler/archiva-scheduler-repository/src/test/java/org/apache/archiva/mock/MockRemoteRepositoryAdmin.java4
-rw-r--r--pom.xml14
12 files changed, 214 insertions, 149 deletions
diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/pom.xml b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/pom.xml
index 4fa36b2b8..50176bd77 100644
--- a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/pom.xml
+++ b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/pom.xml
@@ -68,12 +68,6 @@
<groupId>org.apache.archiva.maven</groupId>
<artifactId>archiva-maven-metadata</artifactId>
</dependency>
- <!--
- <dependency>
- <groupId>org.apache.archiva</groupId>
- <artifactId>archiva-plexus-bridge</artifactId>
- </dependency>
- -->
<dependency>
<groupId>org.apache.archiva</groupId>
<artifactId>archiva-storage-api</artifactId>
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/pom.xml b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/pom.xml
index 85b9dc11a..d378abcad 100644
--- a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/pom.xml
+++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/pom.xml
@@ -35,7 +35,11 @@
<dependencies>
<dependency>
<groupId>org.apache.archiva</groupId>
- <artifactId>archiva-repository-layer</artifactId>
+ <artifactId>archiva-storage-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.archiva</groupId>
+ <artifactId>archiva-repository-api</artifactId>
</dependency>
<dependency>
<groupId>org.apache.archiva</groupId>
@@ -53,6 +57,7 @@
<groupId>org.apache.archiva.redback</groupId>
<artifactId>redback-users-api</artifactId>
</dependency>
+ <!--
<dependency>
<groupId>org.apache.maven.indexer</groupId>
<artifactId>indexer-core</artifactId>
@@ -96,6 +101,7 @@
</exclusion>
</exclusions>
</dependency>
+ -->
</dependencies>
<build>
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/remote/RemoteRepositoryAdmin.java b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/remote/RemoteRepositoryAdmin.java
index da841f401..f9bc61a29 100644
--- a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/remote/RemoteRepositoryAdmin.java
+++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/remote/RemoteRepositoryAdmin.java
@@ -22,7 +22,7 @@ package org.apache.archiva.admin.model.remote;
import org.apache.archiva.admin.model.AuditInformation;
import org.apache.archiva.admin.model.RepositoryAdminException;
import org.apache.archiva.admin.model.beans.RemoteRepository;
-import org.apache.maven.index.context.IndexingContext;
+import org.apache.archiva.indexer.ArchivaIndexingContext;
import java.util.List;
import java.util.Map;
@@ -57,6 +57,6 @@ public interface RemoteRepositoryAdmin
* @throws RepositoryAdminException
* @since 1.4-M2
*/
- IndexingContext createIndexContext( RemoteRepository repository )
+ ArchivaIndexingContext createIndexContext( RemoteRepository repository )
throws RepositoryAdminException;
}
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/pom.xml b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/pom.xml
index 23ab24ff0..7a2e4e3b2 100644
--- a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/pom.xml
+++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/pom.xml
@@ -42,97 +42,144 @@
<artifactId>archiva-security-common</artifactId>
</dependency>
<dependency>
- <groupId>org.apache.maven.indexer</groupId>
- <artifactId>indexer-core</artifactId>
- <classifier>shaded-lucene</classifier>
+ <groupId>org.apache.archiva</groupId>
+ <artifactId>archiva-storage-api</artifactId>
</dependency>
<dependency>
- <groupId>com.google.guava</groupId>
- <artifactId>guava</artifactId>
+ <groupId>org.apache.archiva</groupId>
+ <artifactId>archiva-storage-fs</artifactId>
</dependency>
<dependency>
<groupId>org.apache.archiva</groupId>
- <artifactId>archiva-scheduler-repository-api</artifactId>
+ <artifactId>archiva-repository-api</artifactId>
</dependency>
<dependency>
<groupId>org.apache.archiva</groupId>
- <artifactId>archiva-repository-admin-api</artifactId>
+ <artifactId>archiva-repository-layer</artifactId>
</dependency>
<dependency>
<groupId>org.apache.archiva</groupId>
- <artifactId>archiva-plexus-bridge</artifactId>
+ <artifactId>archiva-filelock</artifactId>
</dependency>
<dependency>
<groupId>org.apache.archiva</groupId>
- <artifactId>metadata-repository-api</artifactId>
+ <artifactId>archiva-proxy-api</artifactId>
</dependency>
<dependency>
<groupId>org.apache.archiva</groupId>
- <artifactId>repository-statistics</artifactId>
+ <artifactId>archiva-common</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.archiva.components.cache</groupId>
+ <artifactId>archiva-components-spring-cache-api</artifactId>
</dependency>
<dependency>
<groupId>org.apache.archiva</groupId>
- <artifactId>metadata-model</artifactId>
+ <artifactId>metadata-statistics-api</artifactId>
</dependency>
<dependency>
- <groupId>org.apache.archiva.maven</groupId>
- <artifactId>archiva-maven-repository</artifactId>
+ <groupId>org.apache.archiva</groupId>
+ <artifactId>archiva-scheduler-repository-api</artifactId>
</dependency>
<dependency>
- <groupId>org.apache.commons</groupId>
- <artifactId>commons-text</artifactId>
+ <groupId>org.apache.archiva</groupId>
+ <artifactId>archiva-repository-admin-api</artifactId>
</dependency>
<dependency>
- <groupId>commons-lang</groupId>
- <artifactId>commons-lang</artifactId>
- <version>2.6</version>
+ <groupId>org.apache.archiva.redback</groupId>
+ <artifactId>redback-users-api</artifactId>
</dependency>
<dependency>
- <groupId>javax.inject</groupId>
- <artifactId>javax.inject</artifactId>
+ <groupId>org.apache.archiva.redback</groupId>
+ <artifactId>redback-configuration</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.archiva.redback</groupId>
+ <artifactId>redback-rbac-role-manager</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.archiva.components.registry</groupId>
+ <artifactId>archiva-components-spring-registry-api</artifactId>
</dependency>
<dependency>
<groupId>org.apache.archiva.components</groupId>
- <artifactId>archiva-components-spring-taskqueue</artifactId>
+ <artifactId>archiva-components-spring-quartz</artifactId>
</dependency>
<dependency>
- <groupId>javax.transaction</groupId>
- <artifactId>javax.transaction-api</artifactId>
- <scope>test</scope>
+ <groupId>javax.annotation</groupId>
+ <artifactId>javax.annotation-api</artifactId>
</dependency>
<dependency>
+ <groupId>javax.inject</groupId>
+ <artifactId>javax.inject</artifactId>
+ </dependency>
+
+
+ <dependency>
<groupId>org.springframework</groupId>
- <artifactId>spring-tx</artifactId>
- <scope>test</scope>
+ <artifactId>spring-core</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
- <artifactId>spring-orm</artifactId>
- <scope>test</scope>
+ <artifactId>spring-beans</artifactId>
</dependency>
<dependency>
- <groupId>org.apache.openjpa</groupId>
- <artifactId>openjpa</artifactId>
- <scope>test</scope>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context</artifactId>
</dependency>
+
+
+ <!--
<dependency>
- <groupId>org.apache.archiva.redback</groupId>
- <artifactId>redback-rbac-jpa</artifactId>
- <version>${redback.version}</version>
- <scope>test</scope>
+ <groupId>commons-validator</groupId>
+ <artifactId>commons-validator</artifactId>
</dependency>
+ -->
<dependency>
- <groupId>org.apache.archiva.redback</groupId>
- <artifactId>redback-common-jpa</artifactId>
- <version>${redback.version}</version>
- <scope>test</scope>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-lang3</artifactId>
</dependency>
<dependency>
- <groupId>org.apache.archiva.components.registry</groupId>
- <artifactId>archiva-components-spring-registry-commons</artifactId>
- <scope>test</scope>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-collections4</artifactId>
+ </dependency>
+ <!--
+ <dependency>
+ <groupId>com.google.guava</groupId>
+ <artifactId>guava</artifactId>
+ </dependency>
+ -->
+ <!--
+ <dependency>
+ <groupId>org.apache.archiva</groupId>
+ <artifactId>archiva-plexus-bridge</artifactId>
+ </dependency>
+ -->
+ <dependency>
+ <groupId>org.apache.archiva</groupId>
+ <artifactId>metadata-repository-api</artifactId>
+ </dependency>
+ <!--
+
+ -->
+ <dependency>
+ <groupId>org.apache.archiva</groupId>
+ <artifactId>metadata-model</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.archiva.components</groupId>
+ <artifactId>archiva-components-spring-taskqueue</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.maven.wagon</groupId>
+ <artifactId>wagon-provider-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven.wagon</groupId>
+ <artifactId>wagon-http-shared</artifactId>
</dependency>
<dependency>
<groupId>org.modelmapper</groupId>
@@ -141,12 +188,6 @@
<dependency>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-http</artifactId>
- <exclusions>
- <exclusion>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- </exclusion>
- </exclusions>
</dependency>
<dependency>
<groupId>org.apache.maven.wagon</groupId>
@@ -156,67 +197,79 @@
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
- <exclusions>
- <exclusion>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- </exclusion>
- </exclusions>
</dependency>
+
+
+
+ <!-- Used by spring configuration -->
<dependency>
<groupId>org.apache.archiva</groupId>
- <artifactId>archiva-test-utils</artifactId>
- <version>${project.version}</version>
+ <artifactId>repository-statistics</artifactId>
+ <scope>runtime</scope>
+ </dependency>
+
+
+ <!-- Test scope -->
+ <dependency>
+ <groupId>org.apache.archiva.maven</groupId>
+ <artifactId>archiva-maven-common</artifactId>
<scope>test</scope>
- <exclusions>
- <exclusion>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-simple</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
+ </dependency>
<dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-context-support</artifactId>
- <exclusions>
- <exclusion>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- </exclusion>
- </exclusions>
+ <groupId>org.apache.maven.indexer</groupId>
+ <artifactId>indexer-core</artifactId>
+ <classifier>shaded-lucene</classifier>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.archiva.maven</groupId>
+ <artifactId>archiva-maven-repository</artifactId>
+ <scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
- <artifactId>spring-context</artifactId>
- <exclusions>
- <exclusion>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- </exclusion>
- </exclusions>
+ <artifactId>spring-test</artifactId>
+ <scope>test</scope>
</dependency>
<dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
+ <groupId>javax.transaction</groupId>
+ <artifactId>javax.transaction-api</artifactId>
+ <scope>test</scope>
</dependency>
<dependency>
- <groupId>commons-validator</groupId>
- <artifactId>commons-validator</artifactId>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context-support</artifactId>
+ <scope>test</scope>
</dependency>
<dependency>
- <groupId>org.apache.archiva.components</groupId>
- <artifactId>archiva-components-spring-quartz</artifactId>
+ <groupId>org.apache.openjpa</groupId>
+ <artifactId>openjpa</artifactId>
+ <scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.archiva.redback</groupId>
- <artifactId>redback-rbac-role-manager</artifactId>
- <exclusions>
- <exclusion>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- </exclusion>
- </exclusions>
+ <artifactId>redback-rbac-jpa</artifactId>
+ <version>${redback.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.archiva.redback</groupId>
+ <artifactId>redback-common-jpa</artifactId>
+ <version>${redback.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.archiva.components.registry</groupId>
+ <artifactId>archiva-components-spring-registry-commons</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.archiva</groupId>
+ <artifactId>archiva-test-utils</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
</dependency>
+ <!--
<dependency>
<groupId>org.apache.archiva.redback</groupId>
<artifactId>redback-authentication-api</artifactId>
@@ -227,11 +280,14 @@
</exclusion>
</exclusions>
</dependency>
+ -->
+ <!--
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-1.2-api</artifactId>
<scope>test</scope>
</dependency>
+ -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
@@ -255,19 +311,15 @@
<groupId>org.apache.archiva.redback</groupId>
<artifactId>redback-rbac-cached</artifactId>
<scope>test</scope>
- <exclusions>
- <exclusion>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- </exclusion>
- </exclusions>
</dependency>
+ <!--
<dependency>
<groupId>org.apache.derby</groupId>
<artifactId>derby</artifactId>
<scope>test</scope>
</dependency>
+ -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
@@ -293,11 +345,13 @@
<scope>test</scope>
</dependency>
+ <!--
<dependency>
<groupId>org.ow2.asm</groupId>
<artifactId>asm</artifactId>
<scope>test</scope>
</dependency>
+ -->
</dependencies>
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/DefaultRepositoryCommonValidator.java b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/DefaultRepositoryCommonValidator.java
index c46362e85..7375942fe 100644
--- a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/DefaultRepositoryCommonValidator.java
+++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/DefaultRepositoryCommonValidator.java
@@ -28,11 +28,11 @@ import org.apache.archiva.configuration.Configuration;
import org.apache.archiva.components.registry.Registry;
import org.apache.archiva.components.scheduler.CronExpressionValidator;
import org.apache.commons.lang3.StringUtils;
-import org.apache.commons.validator.GenericValidator;
import org.springframework.stereotype.Service;
import javax.inject.Inject;
import javax.inject.Named;
+import java.util.regex.Pattern;
/**
* apply basic repository validation : id and name.
@@ -46,6 +46,11 @@ public class DefaultRepositoryCommonValidator
implements RepositoryCommonValidator
{
+ private static final Pattern REPOSITORY_ID_VALID_EXPRESSION_PATTERN = Pattern.compile( REPOSITORY_ID_VALID_EXPRESSION );
+ private static final Pattern REPOSITORY_NAME_VALID_EXPRESSION_PATTERN = Pattern.compile( REPOSITORY_NAME_VALID_EXPRESSION );
+ private static final Pattern REPOSITORY_LOCATION_VALID_EXPRESSION_PATTERN = Pattern.compile( ManagedRepositoryAdmin.REPOSITORY_LOCATION_VALID_EXPRESSION );
+
+
@Inject
private ArchivaConfiguration archivaConfiguration;
@@ -62,27 +67,27 @@ public class DefaultRepositoryCommonValidator
public void basicValidation( AbstractRepository abstractRepository, boolean update )
throws RepositoryAdminException
{
- Configuration config = archivaConfiguration.getConfiguration();
+ Configuration config = archivaConfiguration.getConfiguration( );
- String repoId = abstractRepository.getId();
+ String repoId = abstractRepository.getId( );
if ( !update )
{
- if ( config.getManagedRepositoriesAsMap().containsKey( repoId ) )
+ if ( config.getManagedRepositoriesAsMap( ).containsKey( repoId ) )
{
throw new RepositoryAdminException( "Unable to add new repository with id [" + repoId
- + "], that id already exists as a managed repository." );
+ + "], that id already exists as a managed repository." );
}
- else if ( config.getRepositoryGroupsAsMap().containsKey( repoId ) )
+ else if ( config.getRepositoryGroupsAsMap( ).containsKey( repoId ) )
{
throw new RepositoryAdminException( "Unable to add new repository with id [" + repoId
- + "], that id already exists as a repository group." );
+ + "], that id already exists as a repository group." );
}
- else if ( config.getRemoteRepositoriesAsMap().containsKey( repoId ) )
+ else if ( config.getRemoteRepositoriesAsMap( ).containsKey( repoId ) )
{
throw new RepositoryAdminException( "Unable to add new repository with id [" + repoId
- + "], that id already exists as a remote repository." );
+ + "], that id already exists as a remote repository." );
}
}
@@ -91,20 +96,20 @@ public class DefaultRepositoryCommonValidator
throw new RepositoryAdminException( "Repository ID cannot be empty." );
}
- if ( !GenericValidator.matchRegexp( repoId, REPOSITORY_ID_VALID_EXPRESSION ) )
+ if ( !REPOSITORY_ID_VALID_EXPRESSION_PATTERN.matcher( repoId ).matches( ) )
{
throw new RepositoryAdminException(
"Invalid repository ID. Identifier must only contain alphanumeric characters, underscores(_), dots(.), and dashes(-)." );
}
- String name = abstractRepository.getName();
+ String name = abstractRepository.getName( );
if ( StringUtils.isBlank( name ) )
{
throw new RepositoryAdminException( "repository name cannot be empty" );
}
- if ( !GenericValidator.matchRegexp( name, REPOSITORY_NAME_VALID_EXPRESSION ) )
+ if ( !REPOSITORY_NAME_VALID_EXPRESSION_PATTERN.matcher( name ).matches( ) )
{
throw new RepositoryAdminException(
"Invalid repository name. Repository Name must only contain alphanumeric characters, white-spaces(' '), "
@@ -123,11 +128,11 @@ public class DefaultRepositoryCommonValidator
public void validateManagedRepository( ManagedRepository managedRepository )
throws RepositoryAdminException
{
- String cronExpression = managedRepository.getCronExpression();
+ String cronExpression = managedRepository.getCronExpression( );
// FIXME : olamy can be empty to avoid scheduled scan ?
if ( StringUtils.isNotBlank( cronExpression ) )
{
- CronExpressionValidator validator = new CronExpressionValidator();
+ CronExpressionValidator validator = new CronExpressionValidator( );
if ( !validator.validate( cronExpression ) )
{
@@ -139,10 +144,9 @@ public class DefaultRepositoryCommonValidator
throw new RepositoryAdminException( "Cron expression cannot be empty." );
}
- String repoLocation = removeExpressions( managedRepository.getLocation() );
+ String repoLocation = removeExpressions( managedRepository.getLocation( ) );
- if ( !GenericValidator.matchRegexp( repoLocation,
- ManagedRepositoryAdmin.REPOSITORY_LOCATION_VALID_EXPRESSION ) )
+ if ( !REPOSITORY_LOCATION_VALID_EXPRESSION_PATTERN.matcher( repoLocation ).matches() )
{
throw new RepositoryAdminException(
"Invalid repository location. Directory must only contain alphanumeric characters, equals(=), question-marks(?), "
@@ -161,13 +165,13 @@ public class DefaultRepositoryCommonValidator
public String removeExpressions( String directory )
{
String value = StringUtils.replace( directory, "${appserver.base}",
- getRegistry().getString( "appserver.base", "${appserver.base}" ) );
+ getRegistry( ).getString( "appserver.base", "${appserver.base}" ) );
value = StringUtils.replace( value, "${appserver.home}",
- getRegistry().getString( "appserver.home", "${appserver.home}" ) );
+ getRegistry( ).getString( "appserver.home", "${appserver.home}" ) );
return value;
}
- public ArchivaConfiguration getArchivaConfiguration()
+ public ArchivaConfiguration getArchivaConfiguration( )
{
return archivaConfiguration;
}
@@ -177,7 +181,7 @@ public class DefaultRepositoryCommonValidator
this.archivaConfiguration = archivaConfiguration;
}
- public Registry getRegistry()
+ public Registry getRegistry( )
{
return registry;
}
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/admin/DefaultArchivaAdministration.java b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/admin/DefaultArchivaAdministration.java
index 9231f8038..87216b473 100644
--- a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/admin/DefaultArchivaAdministration.java
+++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/admin/DefaultArchivaAdministration.java
@@ -27,7 +27,7 @@ import org.apache.archiva.configuration.Configuration;
import org.apache.archiva.configuration.UserInterfaceOptions;
import org.apache.archiva.configuration.WebappConfiguration;
import org.apache.archiva.metadata.model.facets.AuditEvent;
-import org.apache.commons.text.StringEscapeUtils;
+import org.apache.commons.lang3.StringEscapeUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
import org.apache.maven.wagon.providers.http.HttpWagon;
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/remote/DefaultRemoteRepositoryAdmin.java b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/remote/DefaultRemoteRepositoryAdmin.java
index dae9dabcb..3e655d927 100644
--- a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/remote/DefaultRemoteRepositoryAdmin.java
+++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/remote/DefaultRemoteRepositoryAdmin.java
@@ -26,17 +26,16 @@ import org.apache.archiva.common.utils.PathUtil;
import org.apache.archiva.configuration.Configuration;
import org.apache.archiva.configuration.RemoteRepositoryConfiguration;
import org.apache.archiva.configuration.RepositoryCheckPath;
-import org.apache.archiva.indexer.UnsupportedBaseContextException;
+import org.apache.archiva.indexer.ArchivaIndexingContext;
import org.apache.archiva.metadata.model.facets.AuditEvent;
-import org.apache.archiva.repository.base.PasswordCredentials;
import org.apache.archiva.repository.RemoteRepository;
import org.apache.archiva.repository.RepositoryCredentials;
import org.apache.archiva.repository.RepositoryException;
import org.apache.archiva.repository.RepositoryRegistry;
+import org.apache.archiva.repository.base.PasswordCredentials;
import org.apache.archiva.repository.features.IndexCreationFeature;
import org.apache.archiva.repository.features.RemoteIndexFeature;
import org.apache.commons.lang3.StringUtils;
-import org.apache.maven.index.context.IndexingContext;
import org.springframework.stereotype.Service;
import javax.annotation.PostConstruct;
@@ -262,16 +261,11 @@ public class DefaultRemoteRepositoryAdmin
}
@Override
- public IndexingContext createIndexContext( org.apache.archiva.admin.model.beans.RemoteRepository remoteRepository )
+ public ArchivaIndexingContext createIndexContext( org.apache.archiva.admin.model.beans.RemoteRepository remoteRepository )
throws RepositoryAdminException
{
- try
- {
- RemoteRepository repo = repositoryRegistry.getRemoteRepository(remoteRepository.getId());
- return repo.getIndexingContext().getBaseContext(IndexingContext.class);
- } catch (UnsupportedBaseContextException e) {
- throw new RepositoryAdminException( e.getMessage(), e);
- }
+ RemoteRepository repo = repositoryRegistry.getRemoteRepository(remoteRepository.getId());
+ return repo.getIndexingContext();
}
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/test/java/org/apache/archiva/admin/repository/ValidatorTest.java b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/test/java/org/apache/archiva/admin/repository/ValidatorTest.java
index 4027198bf..e17e32f2e 100644
--- a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/test/java/org/apache/archiva/admin/repository/ValidatorTest.java
+++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/test/java/org/apache/archiva/admin/repository/ValidatorTest.java
@@ -20,10 +20,11 @@ package org.apache.archiva.admin.repository;
import org.apache.archiva.admin.model.managed.ManagedRepositoryAdmin;
import org.apache.archiva.test.utils.ArchivaSpringJUnit4ClassRunner;
-import org.apache.commons.validator.GenericValidator;
import org.junit.Test;
import org.junit.runner.RunWith;
+import java.util.regex.Pattern;
+
/**
* @author Eric Barboni
*/
@@ -34,9 +35,9 @@ public class ValidatorTest
@Test
public void testGenericValidator()
{
- // Be sure M
- assertFalse("A repo location cannot contains space",GenericValidator.matchRegexp( "/opt/ testme/",
- ManagedRepositoryAdmin.REPOSITORY_LOCATION_VALID_EXPRESSION ));
+ Pattern pattern = Pattern.compile( ManagedRepositoryAdmin.REPOSITORY_LOCATION_VALID_EXPRESSION );
+ // Checks only the pattern
+ assertFalse("A repo location cannot contains space",pattern.matcher( "/opt/ testme/" ).matches());
}
}
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/test/java/org/apache/archiva/admin/repository/networkproxy/NetworkProxyAdminTest.java b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/test/java/org/apache/archiva/admin/repository/networkproxy/NetworkProxyAdminTest.java
index cf8f91bd3..fab9d2647 100644
--- a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/test/java/org/apache/archiva/admin/repository/networkproxy/NetworkProxyAdminTest.java
+++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/test/java/org/apache/archiva/admin/repository/networkproxy/NetworkProxyAdminTest.java
@@ -23,7 +23,7 @@ import org.apache.archiva.admin.model.beans.RemoteRepository;
import org.apache.archiva.admin.model.networkproxy.NetworkProxyAdmin;
import org.apache.archiva.admin.repository.AbstractRepositoryAdminTest;
import org.apache.archiva.metadata.model.facets.AuditEvent;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
import org.junit.Test;
import javax.inject.Inject;
diff --git a/archiva-modules/archiva-maven/archiva-maven-repository/src/test/java/org/apache/archiva/configuration/MockRepoAdmin.java b/archiva-modules/archiva-maven/archiva-maven-repository/src/test/java/org/apache/archiva/configuration/MockRepoAdmin.java
index 138060a6a..2ae29a34a 100644
--- a/archiva-modules/archiva-maven/archiva-maven-repository/src/test/java/org/apache/archiva/configuration/MockRepoAdmin.java
+++ b/archiva-modules/archiva-maven/archiva-maven-repository/src/test/java/org/apache/archiva/configuration/MockRepoAdmin.java
@@ -30,8 +30,8 @@ import org.apache.archiva.admin.model.networkproxy.NetworkProxyAdmin;
import org.apache.archiva.admin.model.proxyconnector.ProxyConnectorAdmin;
import org.apache.archiva.admin.model.proxyconnector.ProxyConnectorOrderComparator;
import org.apache.archiva.admin.model.remote.RemoteRepositoryAdmin;
+import org.apache.archiva.indexer.ArchivaIndexingContext;
import org.apache.commons.lang3.StringUtils;
-import org.apache.maven.index.context.IndexingContext;
import org.modelmapper.ModelMapper;
import org.springframework.stereotype.Service;
@@ -126,7 +126,7 @@ public class MockRepoAdmin
}
@Override
- public IndexingContext createIndexContext( RemoteRepository repository )
+ public ArchivaIndexingContext createIndexContext( RemoteRepository repository )
throws RepositoryAdminException
{
return null; //To change body of implemented methods use File | Settings | File Templates.
diff --git a/archiva-modules/archiva-scheduler/archiva-scheduler-repository/src/test/java/org/apache/archiva/mock/MockRemoteRepositoryAdmin.java b/archiva-modules/archiva-scheduler/archiva-scheduler-repository/src/test/java/org/apache/archiva/mock/MockRemoteRepositoryAdmin.java
index 0a610c1bc..d5f7c389a 100644
--- a/archiva-modules/archiva-scheduler/archiva-scheduler-repository/src/test/java/org/apache/archiva/mock/MockRemoteRepositoryAdmin.java
+++ b/archiva-modules/archiva-scheduler/archiva-scheduler-repository/src/test/java/org/apache/archiva/mock/MockRemoteRepositoryAdmin.java
@@ -23,7 +23,7 @@ import org.apache.archiva.admin.model.RepositoryAdminException;
import org.apache.archiva.admin.model.beans.RemoteRepository;
import org.apache.archiva.admin.model.remote.RemoteRepositoryAdmin;
import org.apache.archiva.configuration.ArchivaConfiguration;
-import org.apache.maven.index.context.IndexingContext;
+import org.apache.archiva.indexer.ArchivaIndexingContext;
import java.util.List;
import java.util.Map;
@@ -89,7 +89,7 @@ public class MockRemoteRepositoryAdmin
}
@Override
- public IndexingContext createIndexContext( RemoteRepository repository )
+ public ArchivaIndexingContext createIndexContext( RemoteRepository repository )
throws RepositoryAdminException
{
return null;
diff --git a/pom.xml b/pom.xml
index 04339982f..a4417d719 100644
--- a/pom.xml
+++ b/pom.xml
@@ -96,6 +96,8 @@
<asm.version>5.0.4</asm.version>
+ <modelmapper.version>2.3.5</modelmapper.version>
+
<!-- restore when we will be able to use a derby in memory database -->
<redbackTestJdbcUrl>jdbc:derby:memory:users-test;create=true</redbackTestJdbcUrl>
<redbackTestJdbcDriver>org.apache.derby.jdbc.EmbeddedDriver</redbackTestJdbcDriver>
@@ -735,7 +737,7 @@
<dependency>
<groupId>org.modelmapper</groupId>
<artifactId>modelmapper</artifactId>
- <version>0.7.3</version>
+ <version>${modelmapper.version}</version>
</dependency>
<dependency>
@@ -1063,6 +1065,11 @@
<artifactId>redback-users-api</artifactId>
<version>${redback.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.archiva.redback</groupId>
+ <artifactId>redback-configuration</artifactId>
+ <version>${redback.version}</version>
+ </dependency>
<dependency>
<groupId>org.apache.archiva.redback</groupId>
@@ -1454,6 +1461,11 @@
</dependency>
<dependency>
<groupId>org.apache.maven.wagon</groupId>
+ <artifactId>wagon-http-shared</artifactId>
+ <version>${wagon.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-http</artifactId>
<version>${wagon.version}</version>
<exclusions>