aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Lamy <olamy@apache.org>2011-11-07 08:29:35 +0000
committerOlivier Lamy <olamy@apache.org>2011-11-07 08:29:35 +0000
commitcef293cf574359cda04473e4010ee3c1b7059ee8 (patch)
tree20abdc47da5da588840a09e4e446671326363d58
parent972142978631964541c91004d18ddc3588041d07 (diff)
downloadarchiva-cef293cf574359cda04473e4010ee3c1b7059ee8.tar.gz
archiva-cef293cf574359cda04473e4010ee3c1b7059ee8.zip
move jdbc test url and jdbc test driver to properties to be able to change that in one place
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1198646 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--archiva-modules/archiva-base/archiva-consumers/archiva-consumer-archetype/src/main/resources/archetype-resources/pom.xml3
-rw-r--r--archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/pom.xml4
-rw-r--r--archiva-modules/archiva-base/archiva-indexer/pom.xml4
-rw-r--r--archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/merger/DefaultIndexMerger.java23
-rw-r--r--archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/merger/IndexMerger.java11
-rw-r--r--archiva-modules/archiva-base/archiva-proxy/pom.xml4
-rw-r--r--archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/pom.xml4
-rw-r--r--archiva-modules/archiva-scheduler/archiva-scheduler-indexing/pom.xml4
-rw-r--r--archiva-modules/archiva-web/archiva-rest/archiva-rest-services/pom.xml4
-rw-r--r--archiva-modules/archiva-web/archiva-security/pom.xml4
-rw-r--r--archiva-modules/archiva-web/archiva-webapp/pom.xml5
-rw-r--r--archiva-modules/archiva-web/archiva-webdav/pom.xml4
-rw-r--r--archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/ArchivaDavResourceFactory.java2
-rw-r--r--archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-services/pom.xml4
-rw-r--r--pom.xml3
15 files changed, 58 insertions, 25 deletions
diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-archetype/src/main/resources/archetype-resources/pom.xml b/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-archetype/src/main/resources/archetype-resources/pom.xml
index 08c3752ed..ec49d4a95 100644
--- a/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-archetype/src/main/resources/archetype-resources/pom.xml
+++ b/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-archetype/src/main/resources/archetype-resources/pom.xml
@@ -150,7 +150,8 @@
<appserver.base>${project.build.directory}/appserver-base</appserver.base>
<archiva.user.configFileName>${basedir}/target/archiva.xml</archiva.user.configFileName>
<test.resources.path>${project.build.testOutputDirectory}</test.resources.path>
- <redback.jdbc.url>jdbc:derby:memory:users-test;create=true</redback.jdbc.url>
+ <!-- restore when we will be able to use a derby in memory database -->
+ <!--redback.jdbc.url>jdbc:derby:memory:users-test;create=true</redback.jdbc.url-->
<redback.jdbc.driver.name>org.apache.derby.jdbc.EmbeddedDriver</redback.jdbc.driver.name>
</systemPropertyVariables>
</configuration>
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 4222dfc0d..0367aa66d 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
@@ -119,8 +119,8 @@
<appserver.base>${project.build.directory}/appserver-base</appserver.base>
<plexus.home>${project.build.directory}/appserver-base</plexus.home>
<derby.system.home>${project.build.directory}/appserver-base</derby.system.home>
- <redback.jdbc.url>jdbc:derby:memory:users-test;create=true</redback.jdbc.url>
- <redback.jdbc.driver.name>org.apache.derby.jdbc.EmbeddedDriver</redback.jdbc.driver.name>
+ <redback.jdbc.url>${redbackTestJdbcUrl}</redback.jdbc.url>
+ <redback.jdbc.driver.name>${redbackTestJdbcDriver}</redback.jdbc.driver.name>
<archiva.user.configFileName>${project.build.directory}/archiva.xml</archiva.user.configFileName>
</systemPropertyVariables>
</configuration>
diff --git a/archiva-modules/archiva-base/archiva-indexer/pom.xml b/archiva-modules/archiva-base/archiva-indexer/pom.xml
index ec70560dc..426f6d34e 100644
--- a/archiva-modules/archiva-base/archiva-indexer/pom.xml
+++ b/archiva-modules/archiva-base/archiva-indexer/pom.xml
@@ -170,8 +170,8 @@
<appserver.base>${project.build.directory}/appserver-base</appserver.base>
<plexus.home>${project.build.directory}/appserver-base</plexus.home>
<derby.system.home>${project.build.directory}/appserver-base</derby.system.home>
- <redback.jdbc.url>jdbc:derby:memory:users-test;create=true</redback.jdbc.url>
- <redback.jdbc.driver.name>org.apache.derby.jdbc.EmbeddedDriver</redback.jdbc.driver.name>
+ <redback.jdbc.url>${redbackTestJdbcUrl}</redback.jdbc.url>
+ <redback.jdbc.driver.name>${redbackTestJdbcDriver}</redback.jdbc.driver.name>
</systemPropertyVariables>
</configuration>
</plugin>
diff --git a/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/merger/DefaultIndexMerger.java b/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/merger/DefaultIndexMerger.java
index 045d2c28d..11b0814c2 100644
--- a/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/merger/DefaultIndexMerger.java
+++ b/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/merger/DefaultIndexMerger.java
@@ -24,6 +24,7 @@ import org.apache.archiva.common.plexusbridge.MavenIndexerUtils;
import org.apache.archiva.common.plexusbridge.PlexusSisuBridge;
import org.apache.archiva.common.plexusbridge.PlexusSisuBridgeException;
import org.apache.commons.io.FileUtils;
+import org.apache.commons.lang.math.NumberUtils;
import org.apache.maven.index.NexusIndexer;
import org.apache.maven.index.context.IndexingContext;
import org.apache.maven.index.context.UnsupportedExistingLuceneIndexException;
@@ -34,6 +35,7 @@ import org.slf4j.LoggerFactory;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
+import javax.annotation.PostConstruct;
import javax.inject.Inject;
import java.io.File;
import java.io.IOException;
@@ -50,6 +52,11 @@ public class DefaultIndexMerger
implements IndexMerger
{
+ /**
+ * default tmp created group index ttl in minutes
+ */
+ static final int DEFAULT_GROUP_INDEX_TTL = 30;
+
private Logger log = LoggerFactory.getLogger( getClass() );
@Inject
@@ -63,6 +70,8 @@ public class DefaultIndexMerger
private List<TemporaryGroupIndex> temporaryGroupIndexes = new CopyOnWriteArrayList<TemporaryGroupIndex>();
+ private int defaultGroupIndexTtl;
+
@Inject
public DefaultIndexMerger( PlexusSisuBridge plexusSisuBridge, MavenIndexerUtils mavenIndexerUtils )
throws PlexusSisuBridgeException
@@ -72,6 +81,15 @@ public class DefaultIndexMerger
indexPacker = plexusSisuBridge.lookup( IndexPacker.class, "default" );
}
+ @PostConstruct
+ public void intialize()
+ {
+ String ttlStr =
+ System.getProperty( IndexMerger.TMP_GROUP_INDEX_SYS_KEY, Integer.toString( DEFAULT_GROUP_INDEX_TTL ) );
+ this.defaultGroupIndexTtl = NumberUtils.toInt( ttlStr, DEFAULT_GROUP_INDEX_TTL );
+
+ }
+
public IndexingContext buildMergedIndex( Collection<String> repositoriesIds, boolean packIndex )
throws IndexMergerException
{
@@ -148,4 +166,9 @@ public class DefaultIndexMerger
{
return this.temporaryGroupIndexes;
}
+
+ public int getDefaultGroupIndexTtl()
+ {
+ return this.defaultGroupIndexTtl;
+ }
}
diff --git a/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/merger/IndexMerger.java b/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/merger/IndexMerger.java
index 999d85bd5..4dbe2a819 100644
--- a/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/merger/IndexMerger.java
+++ b/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/merger/IndexMerger.java
@@ -29,11 +29,12 @@ import java.util.Collection;
*/
public interface IndexMerger
{
+
/**
- * default tmp created group index ttl in minutes
+ * system property which contains the value in s for ttl of temporary index groups
*/
- static final int DEFAULT_GROUP_INDEX_TTL = 30;
-
+ static final String TMP_GROUP_INDEX_SYS_KEY = "archiva.tmp.group.index.ttl";
+
/**
* @param repositoriesIds repositories Ids to merge content
* @param packIndex will generate a downloadable index
@@ -47,5 +48,9 @@ public interface IndexMerger
Collection<TemporaryGroupIndex> getTemporaryGroupIndexes();
+ /**
+ * @return ttl of temporay group index
+ */
+ int getDefaultGroupIndexTtl();
}
diff --git a/archiva-modules/archiva-base/archiva-proxy/pom.xml b/archiva-modules/archiva-base/archiva-proxy/pom.xml
index 3cf6f60bd..62e485ed2 100644
--- a/archiva-modules/archiva-base/archiva-proxy/pom.xml
+++ b/archiva-modules/archiva-base/archiva-proxy/pom.xml
@@ -159,8 +159,8 @@
<appserver.base>${project.build.directory}/appserver-base</appserver.base>
<plexus.home>${project.build.directory}/appserver-base</plexus.home>
<derby.system.home>${project.build.directory}/appserver-base</derby.system.home>
- <redback.jdbc.url>jdbc:derby:memory:users-test;create=true</redback.jdbc.url>
- <redback.jdbc.driver.name>org.apache.derby.jdbc.EmbeddedDriver</redback.jdbc.driver.name>
+ <redback.jdbc.url>${redbackTestJdbcUrl}</redback.jdbc.url>
+ <redback.jdbc.driver.name>${redbackTestJdbcDriver}</redback.jdbc.driver.name>
</systemPropertyVariables>
</configuration>
</plugin>
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 b01764f23..4e4524e2d 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
@@ -213,8 +213,8 @@
<appserver.base>${project.build.directory}/appserver-base</appserver.base>
<plexus.home>${project.build.directory}/appserver-base</plexus.home>
<derby.system.home>${project.build.directory}/appserver-base</derby.system.home>
- <redback.jdbc.url>jdbc:derby:memory:users-test;create=true</redback.jdbc.url>
- <redback.jdbc.driver.name>org.apache.derby.jdbc.EmbeddedDriver</redback.jdbc.driver.name>
+ <redback.jdbc.url>${redbackTestJdbcUrl}</redback.jdbc.url>
+ <redback.jdbc.driver.name>${redbackTestJdbcDriver}</redback.jdbc.driver.name>
</systemPropertyVariables>
</configuration>
</plugin>
diff --git a/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/pom.xml b/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/pom.xml
index 50375e7ab..11d084e00 100644
--- a/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/pom.xml
+++ b/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/pom.xml
@@ -147,8 +147,8 @@
<appserver.base>${project.build.directory}/appserver-base</appserver.base>
<plexus.home>${project.build.directory}/appserver-base</plexus.home>
<derby.system.home>${project.build.directory}/appserver-base</derby.system.home>
- <redback.jdbc.url>jdbc:derby:memory:users-test;create=true</redback.jdbc.url>
- <redback.jdbc.driver.name>org.apache.derby.jdbc.EmbeddedDriver</redback.jdbc.driver.name>
+ <redback.jdbc.url>${redbackTestJdbcUrl}</redback.jdbc.url>
+ <redback.jdbc.driver.name>${redbackTestJdbcDriver}</redback.jdbc.driver.name>
<basedir>${basedir}</basedir>
</systemPropertyVariables>
</configuration>
diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/pom.xml b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/pom.xml
index 06a428e70..b2bae3f29 100644
--- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/pom.xml
+++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/pom.xml
@@ -311,8 +311,8 @@
<archiva.baseRestUrl>${archiva.baseRestUrl}</archiva.baseRestUrl>
<rest.admin.pwd>${rest.admin.pwd}</rest.admin.pwd>
<test.useTomcat>${test.useTomcat}</test.useTomcat>
- <redback.jdbc.url>jdbc:derby:memory:users-test;create=true</redback.jdbc.url>
- <redback.jdbc.driver.name>org.apache.derby.jdbc.EmbeddedDriver</redback.jdbc.driver.name>
+ <redback.jdbc.url>${redbackTestJdbcUrl}</redback.jdbc.url>
+ <redback.jdbc.driver.name>${redbackTestJdbcDriver}</redback.jdbc.driver.name>
</systemPropertyVariables>
</configuration>
</plugin>
diff --git a/archiva-modules/archiva-web/archiva-security/pom.xml b/archiva-modules/archiva-web/archiva-security/pom.xml
index cb9709f3e..99ac1d7a2 100644
--- a/archiva-modules/archiva-web/archiva-security/pom.xml
+++ b/archiva-modules/archiva-web/archiva-security/pom.xml
@@ -161,8 +161,8 @@
<configuration>
<systemPropertyVariables>
<derby.system.home>${project.build.directory}/appserver-base</derby.system.home>
- <redback.jdbc.url>jdbc:derby:memory:users-test;create=true</redback.jdbc.url>
- <redback.jdbc.driver.name>org.apache.derby.jdbc.EmbeddedDriver</redback.jdbc.driver.name>
+ <redback.jdbc.url>${redbackTestJdbcUrl}</redback.jdbc.url>
+ <redback.jdbc.driver.name>${redbackTestJdbcDriver}</redback.jdbc.driver.name>
</systemPropertyVariables>
</configuration>
</plugin>
diff --git a/archiva-modules/archiva-web/archiva-webapp/pom.xml b/archiva-modules/archiva-web/archiva-webapp/pom.xml
index a8e5b31db..47ce9fd60 100644
--- a/archiva-modules/archiva-web/archiva-webapp/pom.xml
+++ b/archiva-modules/archiva-web/archiva-webapp/pom.xml
@@ -579,8 +579,8 @@
<rest.admin.pwd>${rest.admin.pwd}</rest.admin.pwd>
<archiva.user.configFileName>${basedir}/target/archiva.xml</archiva.user.configFileName>
<test.resources.path>${project.build.testOutputDirectory}</test.resources.path>
- <redback.jdbc.url>jdbc:derby:memory:users-test;create=true</redback.jdbc.url>
- <redback.jdbc.driver.name>org.apache.derby.jdbc.EmbeddedDriver</redback.jdbc.driver.name>
+ <redback.jdbc.url>${redbackTestJdbcUrl}</redback.jdbc.url>
+ <redback.jdbc.driver.name>${redbackTestJdbcDriver}</redback.jdbc.driver.name>
<basedir>${basedir}</basedir>
</systemPropertyVariables>
</configuration>
@@ -648,6 +648,7 @@
<appserver.home>${project.build.directory}/appserver-home</appserver.home>
<derby.system.home>${basedir}/appserver-base/logs</derby.system.home>
<redback.admin.creation.file>${basedir}/target/auto-admin-creation.properties</redback.admin.creation.file>
+ <java.io.tmpdir>${project.build.directory}</java.io.tmpdir>
</systemProperties>
</configuration>
<dependencies>
diff --git a/archiva-modules/archiva-web/archiva-webdav/pom.xml b/archiva-modules/archiva-web/archiva-webdav/pom.xml
index 6047ef797..3b6b83bcd 100644
--- a/archiva-modules/archiva-web/archiva-webdav/pom.xml
+++ b/archiva-modules/archiva-web/archiva-webdav/pom.xml
@@ -199,8 +199,8 @@
<derby.system.home>${project.build.directory}/appserver-base</derby.system.home>
<test.resources.path>${project.build.testOutputDirectory}</test.resources.path>
<archiva.user.configFileName>${project.build.testOutputDirectory}/repository-archiva.xml</archiva.user.configFileName>
- <redback.jdbc.url>jdbc:derby:memory:users-test;create=true</redback.jdbc.url>
- <redback.jdbc.driver.name>org.apache.derby.jdbc.EmbeddedDriver</redback.jdbc.driver.name>
+ <redback.jdbc.url>${redbackTestJdbcUrl}</redback.jdbc.url>
+ <redback.jdbc.driver.name>${redbackTestJdbcDriver}</redback.jdbc.driver.name>
</systemPropertyVariables>
<forkMode>${webdav.forkMode}</forkMode>
</configuration>
diff --git a/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/ArchivaDavResourceFactory.java b/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/ArchivaDavResourceFactory.java
index a4341ced0..de71e9d15 100644
--- a/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/ArchivaDavResourceFactory.java
+++ b/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/ArchivaDavResourceFactory.java
@@ -1215,7 +1215,7 @@ public class ArchivaDavResourceFactory
if ( tmp != null && tmp.getDirectory() != null && tmp.getDirectory().exists() )
{
- if ( System.currentTimeMillis() - tmp.getCreationTime() > ( IndexMerger.DEFAULT_GROUP_INDEX_TTL * 60
+ if ( System.currentTimeMillis() - tmp.getCreationTime() > ( indexMerger.getDefaultGroupIndexTtl() * 60
* 1000 ) )
{
log.debug( "tmp group index is too old so delete it" );
diff --git a/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-services/pom.xml b/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-services/pom.xml
index 901eb48c8..3a01a683d 100644
--- a/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-services/pom.xml
+++ b/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-services/pom.xml
@@ -169,8 +169,8 @@
<plexus.home>${project.build.directory}/appserver-base</plexus.home>
<java.io.tmpdir>${project.build.testOutputDirectory}</java.io.tmpdir>
<derby.system.home>${project.build.directory}/appserver-base</derby.system.home>
- <redback.jdbc.url>jdbc:derby:memory:users-test;create=true</redback.jdbc.url>
- <redback.jdbc.driver.name>org.apache.derby.jdbc.EmbeddedDriver</redback.jdbc.driver.name>
+ <redback.jdbc.url>${redbackTestJdbcUrl}</redback.jdbc.url>
+ <redback.jdbc.driver.name>${redbackTestJdbcDriver}</redback.jdbc.driver.name>
</systemPropertyVariables>
</configuration>
</plugin>
diff --git a/pom.xml b/pom.xml
index d94192e81..61c2267d4 100644
--- a/pom.xml
+++ b/pom.xml
@@ -78,6 +78,9 @@
<derbyVersion>10.1.3.1</derbyVersion>
<javaxMailVersion>1.4</javaxMailVersion>
<jettyVersion>7.4.5.v20110725</jettyVersion>
+ <!-- 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>
</properties>
<dependencyManagement>