You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@archiva.apache.org by ma...@apache.org on 2020/06/20 14:08:38 UTC
[archiva] branch master updated (8023535 -> 3988bfa)
This is an automated email from the ASF dual-hosted git repository.
martin_s pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/archiva.git.
from 8023535 Adding release 2.2.5 to doap file
new 1bcd776 Finish dependency cleanup for maven-repository
new 3988bfa Cleanup maven-scheduler dependencies
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../archiva-maven/archiva-maven-indexer/pom.xml | 3 +
.../archiva-maven/archiva-maven-repository/pom.xml | 2 +
.../archiva-maven/archiva-maven-scheduler/pom.xml | 101 +++++++++++----------
.../maven/DefaultDownloadRemoteIndexScheduler.java | 1 -
.../maven/DownloadRemoteIndexTaskTest.java | 81 +++++++++++------
.../src/test/resources/spring-context.xml | 39 +-------
status-dep.txt | 2 +
7 files changed, 115 insertions(+), 114 deletions(-)
[archiva] 02/02: Cleanup maven-scheduler dependencies
Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
martin_s pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/archiva.git
commit 3988bfa918a1b4a08497c075ba23f5f2615eaf58
Author: Martin Stockhammer <ma...@apache.org>
AuthorDate: Sat Jun 20 16:06:40 2020 +0200
Cleanup maven-scheduler dependencies
---
.../archiva-maven/archiva-maven-scheduler/pom.xml | 101 +++++++++++----------
.../maven/DefaultDownloadRemoteIndexScheduler.java | 1 -
.../maven/DownloadRemoteIndexTaskTest.java | 81 +++++++++++------
.../src/test/resources/spring-context.xml | 39 +-------
status-dep.txt | 1 +
5 files changed, 109 insertions(+), 114 deletions(-)
diff --git a/archiva-modules/archiva-maven/archiva-maven-scheduler/pom.xml b/archiva-modules/archiva-maven/archiva-maven-scheduler/pom.xml
index d08e854..30d6e8d 100644
--- a/archiva-modules/archiva-maven/archiva-maven-scheduler/pom.xml
+++ b/archiva-modules/archiva-maven/archiva-maven-scheduler/pom.xml
@@ -46,6 +46,14 @@
</dependency>
<dependency>
<groupId>org.apache.archiva</groupId>
+ <artifactId>archiva-common</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.archiva</groupId>
+ <artifactId>archiva-storage-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.archiva</groupId>
<artifactId>archiva-configuration</artifactId>
</dependency>
<dependency>
@@ -58,11 +66,28 @@
</dependency>
<dependency>
<groupId>org.apache.archiva.maven</groupId>
- <artifactId>archiva-maven-proxy</artifactId>
+ <artifactId>archiva-maven-common</artifactId>
</dependency>
<dependency>
<groupId>org.apache.archiva</groupId>
- <artifactId>archiva-repository-admin-api</artifactId>
+ <artifactId>archiva-repository-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.archiva</groupId>
+ <artifactId>archiva-proxy-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.archiva.components</groupId>
+ <artifactId>archiva-components-spring-taskqueue</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.annotation</groupId>
+ <artifactId>javax.annotation-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>javax.inject</groupId>
+ <artifactId>javax.inject</artifactId>
</dependency>
<dependency>
@@ -72,51 +97,44 @@
</dependency>
<dependency>
<groupId>org.apache.maven.wagon</groupId>
- <artifactId>wagon-http</artifactId>
+ <artifactId>wagon-http-shared</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.maven.wagon</groupId>
- <artifactId>wagon-http-lightweight</artifactId>
- <scope>provided</scope>
+ <artifactId>wagon-provider-api</artifactId>
</dependency>
- <!-- Test dependencies -->
<dependency>
- <groupId>javax.persistence</groupId>
- <artifactId>javax.persistence-api</artifactId>
- <scope>test</scope>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-lang3</artifactId>
</dependency>
+
+
+ <!-- Test dependencies -->
<dependency>
- <groupId>org.apache.archiva.redback</groupId>
- <artifactId>redback-keys-jpa</artifactId>
+ <groupId>org.apache.archiva</groupId>
+ <artifactId>repository-statistics</artifactId>
<scope>test</scope>
</dependency>
<dependency>
- <groupId>org.apache.archiva.redback</groupId>
- <artifactId>redback-keys-cached</artifactId>
+ <groupId>org.apache.maven.wagon</groupId>
+ <artifactId>wagon-http</artifactId>
<scope>test</scope>
</dependency>
<dependency>
- <groupId>javax.transaction</groupId>
- <artifactId>javax.transaction-api</artifactId>
+ <groupId>org.apache.maven.wagon</groupId>
+ <artifactId>wagon-http-lightweight</artifactId>
<scope>test</scope>
</dependency>
<dependency>
- <groupId>org.apache.archiva.redback</groupId>
- <artifactId>redback-common-jpa</artifactId>
- <version>${redback.version}</version>
+ <groupId>org.apache.archiva.maven</groupId>
+ <artifactId>archiva-maven-proxy</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
- <artifactId>spring-tx</artifactId>
- <version>${spring.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.archiva</groupId>
- <artifactId>archiva-repository-admin-default</artifactId>
+ <artifactId>spring-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
@@ -137,6 +155,12 @@
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-servlet</artifactId>
+ <version>${jetty.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-server</artifactId>
<version>${jetty.version}</version>
<scope>test</scope>
@@ -152,19 +176,6 @@
<artifactId>assertj-core</artifactId>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>org.apache.archiva</groupId>
- <artifactId>archiva-mock</artifactId>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.archiva.redback</groupId>
- <artifactId>redback-rbac-cached</artifactId>
- <scope>test</scope>
- <version>${redback.version}</version>
- </dependency>
-
<dependency>
<groupId>org.apache.archiva</groupId>
@@ -173,21 +184,11 @@
</dependency>
<dependency>
- <groupId>org.apache.logging.log4j</groupId>
- <artifactId>log4j-slf4j-impl</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.apache.archiva.redback</groupId>
- <artifactId>redback-common-test-resources</artifactId>
+ <groupId>org.apache.archiva</groupId>
+ <artifactId>archiva-mock</artifactId>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>org.ow2.asm</groupId>
- <artifactId>asm</artifactId>
- <scope>test</scope>
- </dependency>
</dependencies>
<build>
diff --git a/archiva-modules/archiva-maven/archiva-maven-scheduler/src/main/java/org/apache/archiva/scheduler/indexing/maven/DefaultDownloadRemoteIndexScheduler.java b/archiva-modules/archiva-maven/archiva-maven-scheduler/src/main/java/org/apache/archiva/scheduler/indexing/maven/DefaultDownloadRemoteIndexScheduler.java
index 7d3fe95..452ea65 100644
--- a/archiva-modules/archiva-maven/archiva-maven-scheduler/src/main/java/org/apache/archiva/scheduler/indexing/maven/DefaultDownloadRemoteIndexScheduler.java
+++ b/archiva-modules/archiva-maven/archiva-maven-scheduler/src/main/java/org/apache/archiva/scheduler/indexing/maven/DefaultDownloadRemoteIndexScheduler.java
@@ -22,7 +22,6 @@ import org.apache.archiva.proxy.ProxyRegistry;
import org.apache.archiva.proxy.model.NetworkProxy;
import org.apache.archiva.scheduler.indexing.DownloadRemoteIndexException;
import org.apache.archiva.scheduler.indexing.DownloadRemoteIndexScheduler;
-import org.apache.archiva.admin.model.RepositoryAdminException;
import org.apache.archiva.configuration.ArchivaConfiguration;
import org.apache.archiva.configuration.ConfigurationEvent;
import org.apache.archiva.configuration.ConfigurationListener;
diff --git a/archiva-modules/archiva-maven/archiva-maven-scheduler/src/test/java/org/apache/archiva/scheduler/indexing/maven/DownloadRemoteIndexTaskTest.java b/archiva-modules/archiva-maven/archiva-maven-scheduler/src/test/java/org/apache/archiva/scheduler/indexing/maven/DownloadRemoteIndexTaskTest.java
index 01921e4..ae71891 100644
--- a/archiva-modules/archiva-maven/archiva-maven-scheduler/src/test/java/org/apache/archiva/scheduler/indexing/maven/DownloadRemoteIndexTaskTest.java
+++ b/archiva-modules/archiva-maven/archiva-maven-scheduler/src/test/java/org/apache/archiva/scheduler/indexing/maven/DownloadRemoteIndexTaskTest.java
@@ -18,10 +18,19 @@ package org.apache.archiva.scheduler.indexing.maven;
* under the License.
*/
-import org.apache.archiva.admin.model.beans.RemoteRepository;
-import org.apache.archiva.admin.model.remote.RemoteRepositoryAdmin;
import org.apache.archiva.common.utils.FileUtils;
+import org.apache.archiva.indexer.ArchivaIndexManager;
+import org.apache.archiva.indexer.IndexCreationFailedException;
+import org.apache.archiva.repository.EditableRemoteRepository;
+import org.apache.archiva.repository.EditableRepository;
+import org.apache.archiva.repository.RemoteRepository;
+import org.apache.archiva.repository.RepositoryException;
+import org.apache.archiva.repository.RepositoryProvider;
import org.apache.archiva.repository.RepositoryRegistry;
+import org.apache.archiva.repository.RepositoryType;
+import org.apache.archiva.repository.UnsupportedURIException;
+import org.apache.archiva.repository.features.IndexCreationFeature;
+import org.apache.archiva.repository.features.RemoteIndexFeature;
import org.apache.archiva.test.utils.ArchivaSpringJUnit4ClassRunner;
import org.apache.maven.index.FlatSearchRequest;
import org.apache.maven.index.FlatSearchResponse;
@@ -49,15 +58,14 @@ import org.springframework.test.context.ContextConfiguration;
import javax.inject.Inject;
import java.io.IOException;
+import java.net.URI;
+import java.net.URISyntaxException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Arrays;
-import java.util.Locale;
import java.util.concurrent.TimeUnit;
-import static org.assertj.core.api.Assertions.assertThat;
-
/**
* @author Olivier Lamy
*/
@@ -74,9 +82,6 @@ public class DownloadRemoteIndexTaskTest
private Logger log = LoggerFactory.getLogger( getClass() );
@Inject
- RemoteRepositoryAdmin remoteRepositoryAdmin;
-
- @Inject
DefaultDownloadRemoteIndexScheduler downloadRemoteIndexScheduler;
@Inject
@@ -85,6 +90,9 @@ public class DownloadRemoteIndexTaskTest
@Inject
RepositoryRegistry repositoryRegistry;
+ @Inject
+ RepositoryProvider repositoryProvider;
+
@Before
public void initialize()
throws Exception
@@ -94,7 +102,7 @@ public class DownloadRemoteIndexTaskTest
Files.delete(cfgFile);
}
try {
- remoteRepositoryAdmin.deleteRemoteRepository("test-repo-re", null);
+ repositoryRegistry.removeRepository( "test-repo-re" );
} catch (Exception e) {
// Ignore
}
@@ -136,9 +144,12 @@ public class DownloadRemoteIndexTaskTest
public void downloadAndMergeRemoteIndexInEmptyIndex()
throws Exception
{
- RemoteRepository remoteRepository = getRemoteRepository();
+ Path repoDirectory = Paths.get( FileUtils.getBasedir( ), "target/repo-" + Long.toString( System.currentTimeMillis( ) ) );
+
+ RemoteRepository remoteRepository = getRemoteRepository(repoDirectory);
- remoteRepositoryAdmin.addRemoteRepository( remoteRepository, null );
+ repositoryRegistry.putRepository( remoteRepository);
+ repositoryRegistry.reload();
downloadRemoteIndexScheduler.startup();
@@ -147,17 +158,17 @@ public class DownloadRemoteIndexTaskTest
( (ThreadPoolTaskScheduler) downloadRemoteIndexScheduler.getTaskScheduler() ).getScheduledExecutor().awaitTermination(
10, TimeUnit.SECONDS );
- remoteRepositoryAdmin.deleteRemoteRepository( "test-repo-re", null );
+ repositoryRegistry.removeRepository( "test-repo-re" );
// search
BooleanQuery.Builder iQuery = new BooleanQuery.Builder();
iQuery.add( indexer.constructQuery( MAVEN.GROUP_ID, new StringSearchExpression( "commons-logging" ) ),
BooleanClause.Occur.SHOULD );
- remoteRepositoryAdmin.addRemoteRepository(remoteRepository, null);
+ remoteRepository = getRemoteRepository( repoDirectory );
FlatSearchRequest rq = new FlatSearchRequest( iQuery.build() );
rq.setContexts(
- Arrays.asList( repositoryRegistry.getRemoteRepository(remoteRepository.getId()).getIndexingContext().getBaseContext(IndexingContext.class) ) );
+ Arrays.asList( remoteRepository.getIndexingContext().getBaseContext(IndexingContext.class) ) );
FlatSearchResponse response = indexer.searchFlat(rq);
@@ -166,22 +177,38 @@ public class DownloadRemoteIndexTaskTest
}
- protected RemoteRepository getRemoteRepository() throws IOException
+ protected RemoteRepository getRemoteRepository(Path repoDirectory) throws IOException, URISyntaxException, UnsupportedURIException, RepositoryException
{
- RemoteRepository remoteRepository = new RemoteRepository( Locale.getDefault());
- Path indexDirectory =
- Paths.get( FileUtils.getBasedir(), "target/index/test-" + Long.toString( System.currentTimeMillis() ) );
- Files.createDirectories( indexDirectory );
- indexDirectory.toFile().deleteOnExit();
-
- remoteRepository.setName( "foo" );
- remoteRepository.setIndexDirectory( indexDirectory.toAbsolutePath().toString() );
- remoteRepository.setDownloadRemoteIndex( true );
- remoteRepository.setId( "test-repo-re" );
- remoteRepository.setUrl( "http://localhost:" + port );
- remoteRepository.setRemoteIndexUrl( "http://localhost:" + port + "/index-updates/" );
+ EditableRemoteRepository remoteRepository = repositoryProvider.createRemoteInstance( "test-repo-re", "foo" );
+ Path indexDirectory = repoDirectory.resolve( "index" );
+ Files.createDirectories( indexDirectory );
+ remoteRepository.setLocation( new URI( "http://localhost:" + port ) );
+ repoDirectory.toFile().deleteOnExit();
+ createIndexingContext( remoteRepository );
+
+ RemoteIndexFeature rif = remoteRepository.getFeature( RemoteIndexFeature.class ).get();
+ rif.setDownloadRemoteIndex( true );
+ rif.setIndexUri( new URI("http://localhost:" + port + "/index-updates/" ) );
+ IndexCreationFeature icf = remoteRepository.getFeature( IndexCreationFeature.class ).get( );
+ icf.setLocalIndexPath( remoteRepository.getAsset( "index" ) );
return remoteRepository;
}
+ private void createIndexingContext( EditableRepository editableRepo) throws RepositoryException
+ {
+ if (editableRepo.supportsFeature(IndexCreationFeature.class)) {
+ ArchivaIndexManager idxManager = getIndexManager(editableRepo.getType());
+ try {
+ editableRepo.setIndexingContext(idxManager.createContext(editableRepo));
+ idxManager.updateLocalIndexPath(editableRepo);
+ } catch ( IndexCreationFailedException e) {
+ throw new RepositoryException("Could not create index for repository " + editableRepo.getId() + ": " + e.getMessage(), e);
+ }
+ }
+ }
+
+ public ArchivaIndexManager getIndexManager( RepositoryType type ) {
+ return repositoryRegistry.getIndexManager( type );
+ }
}
diff --git a/archiva-modules/archiva-maven/archiva-maven-scheduler/src/test/resources/spring-context.xml b/archiva-modules/archiva-maven/archiva-maven-scheduler/src/test/resources/spring-context.xml
index 2f4feda..1e5ed58 100644
--- a/archiva-modules/archiva-maven/archiva-maven-scheduler/src/test/resources/spring-context.xml
+++ b/archiva-modules/archiva-maven/archiva-maven-scheduler/src/test/resources/spring-context.xml
@@ -19,13 +19,12 @@
~ under the License.
-->
<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tx="http://www.springframework.org/schema/tx"
- xmlns:context="http://www.springframework.org/schema/context"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans
- http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd"
+ 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.xsd"
default-lazy-init="true">
- <context:component-scan base-package="org.apache.archiva.repository.content.maven2,org.apache.archiva.indexer.maven" />
+ <context:component-scan base-package="org.apache.archiva.indexer.maven" />
<bean name="scheduler" class="org.apache.archiva.components.scheduler.DefaultScheduler">
<property name="properties">
@@ -39,7 +38,6 @@
</property>
</bean>
-
<!-- wire up more basic configuration so it doesn't overwrite any config files -->
<bean name="archivaConfiguration#default" class="org.apache.archiva.configuration.DefaultArchivaConfiguration">
<property name="registry" ref="registry#default"/>
@@ -62,38 +60,7 @@
</property>
</bean>
- <alias name="userConfiguration#redback" alias="userConfiguration#default"/>
-
- <!-- ***
- JPA settings
- *** -->
- <bean name="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
- <property name="jpaVendorAdapter" >
- <bean class="org.springframework.orm.jpa.vendor.OpenJpaVendorAdapter" />
- </property>
- <property name="persistenceXmlLocation" value="classpath:META-INF/persistence-hsqldb.xml" />
- <property name="jpaPropertyMap">
- <map>
- <entry key="openjpa.ConnectionURL" value="jdbc:hsqldb:mem:redback_database" />
- <entry key="openjpa.ConnectionDriverName" value="org.hsqldb.jdbcDriver" />
- <entry key="openjpa.ConnectionUserName" value="sa" />
- <entry key="openjpa.ConnectionPassword" value="" />
- <entry key="openjpa.Log" value="${openjpa.Log:DefaultLevel=INFO,Runtime=ERROR,Tool=ERROR,SQL=ERROR,Schema=ERROR,MetaData=ERROR}" />
- <entry key="openjpa.jdbc.SynchronizeMappings" value="buildSchema(ForeignKeys=true)" />
- <entry key="openjpa.jdbc.MappingDefaults"
- value="ForeignKeyDeleteAction=restrict,JoinForeignKeyDeleteAction=restrict"/>
- </map>
- </property>
- </bean>
-
- <bean name="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager" >
- <property name="entityManagerFactory" ref="entityManagerFactory" />
- </bean>
- <tx:annotation-driven />
- <!-- ***
- End of JPA settings
- *** -->
</beans>
\ No newline at end of file
diff --git a/status-dep.txt b/status-dep.txt
index 8dfbe27..a8c1d43 100644
--- a/status-dep.txt
+++ b/status-dep.txt
@@ -46,6 +46,7 @@ archiva-modules
archiva-maven-proxy
archiva-maven-indexer
archiva-maven-repository
+ archiva-maven-scheduler
[archiva] 01/02: Finish dependency cleanup for maven-repository
Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
martin_s pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/archiva.git
commit 1bcd7762ac8b0b3f719524e29f4a11e36c624992
Author: Martin Stockhammer <ma...@apache.org>
AuthorDate: Sat Jun 20 09:29:04 2020 +0200
Finish dependency cleanup for maven-repository
---
archiva-modules/archiva-maven/archiva-maven-indexer/pom.xml | 3 +++
archiva-modules/archiva-maven/archiva-maven-repository/pom.xml | 2 ++
status-dep.txt | 1 +
3 files changed, 6 insertions(+)
diff --git a/archiva-modules/archiva-maven/archiva-maven-indexer/pom.xml b/archiva-modules/archiva-maven/archiva-maven-indexer/pom.xml
index 29d22e6..28ded4e 100644
--- a/archiva-modules/archiva-maven/archiva-maven-indexer/pom.xml
+++ b/archiva-modules/archiva-maven/archiva-maven-indexer/pom.xml
@@ -130,12 +130,15 @@
</exclusions>
</dependency>
+ <!-- Runtime scope, because it's needed by maven classes -->
<dependency>
<groupId>org.eclipse.sisu</groupId>
<artifactId>org.eclipse.sisu.plexus</artifactId>
+ <scope>runtime</scope>
</dependency>
+
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
diff --git a/archiva-modules/archiva-maven/archiva-maven-repository/pom.xml b/archiva-modules/archiva-maven/archiva-maven-repository/pom.xml
index 6e2ec91..5c663dd 100644
--- a/archiva-modules/archiva-maven/archiva-maven-repository/pom.xml
+++ b/archiva-modules/archiva-maven/archiva-maven-repository/pom.xml
@@ -177,9 +177,11 @@
</exclusion>
</exclusions>
</dependency>
+ <!-- Runtime scope, because it's needed by maven classes -->
<dependency>
<groupId>org.eclipse.sisu</groupId>
<artifactId>org.eclipse.sisu.plexus</artifactId>
+ <scope>runtime</scope>
</dependency>
<dependency>
diff --git a/status-dep.txt b/status-dep.txt
index 2e663c5..8dfbe27 100644
--- a/status-dep.txt
+++ b/status-dep.txt
@@ -45,6 +45,7 @@ archiva-modules
archiva-maven-model
archiva-maven-proxy
archiva-maven-indexer
+ archiva-maven-repository