]> source.dussan.org Git - archiva.git/commitdiff
[MRM-46] introduce modello configuration, change indexer API to use a File for the...
authorBrett Porter <brett@apache.org>
Thu, 8 Jun 2006 07:15:34 +0000 (07:15 +0000)
committerBrett Porter <brett@apache.org>
Thu, 8 Jun 2006 07:15:34 +0000 (07:15 +0000)
git-svn-id: https://svn.apache.org/repos/asf/maven/repository-manager/trunk@412683 13f79535-47bb-0310-9956-ffa450edef68

30 files changed:
maven-repository-application/src/main/java/org/apache/maven/repository/manager/cli/IndexCli.java
maven-repository-application/src/main/java/org/apache/maven/repository/manager/cli/IndexSearcherCli.java
maven-repository-configuration/pom.xml [new file with mode: 0644]
maven-repository-configuration/src/main/mdo/configuration.mdo [new file with mode: 0644]
maven-repository-core/pom.xml [new file with mode: 0644]
maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/AbstractRepositoryIndex.java
maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/ArtifactRepositoryIndex.java
maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/DefaultRepositoryIndexSearcher.java
maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/DefaultRepositoryIndexingFactory.java
maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/EclipseRepositoryIndex.java
maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/MetadataRepositoryIndex.java
maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/PomRepositoryIndex.java
maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/RepositoryIndex.java
maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/RepositoryIndexingFactory.java
maven-repository-indexer/src/test/java/org/apache/maven/repository/indexing/ArtifactRepositoryIndexingTest.java
maven-repository-indexer/src/test/java/org/apache/maven/repository/indexing/EclipseRepositoryIndexTest.java
maven-repository-indexer/src/test/java/org/apache/maven/repository/indexing/MetadataRepositoryIndexingTest.java
maven-repository-indexer/src/test/java/org/apache/maven/repository/indexing/PomRepositoryIndexingTest.java
maven-repository-indexer/src/test/java/org/apache/maven/repository/indexing/RepositoryIndexSearchLayerTest.java
maven-repository-reports-standard/src/main/java/org/apache/maven/repository/reporting/DuplicateArtifactFileReportProcessor.java
maven-repository-reports-standard/src/test/java/org/apache/maven/repository/reporting/DuplicateArtifactFileReportProcessorTest.java
maven-repository-webapp/pom.xml
maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/action/BaseAction.java
maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/action/GeneralSearchAction.java
maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/action/PackageSearchAction.java
maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/execution/DiscovererExecution.java
maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/job/Configuration.java [deleted file]
maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/job/DiscovererScheduler.java
maven-repository-webapp/src/main/webapp/WEB-INF/plexus.xml
pom.xml

index edbcc856850a1757dba514280522fb2a63ad6a2b..fd3bead98195992883dbb8357e13e1b24b5bd0c9 100644 (file)
@@ -69,7 +69,7 @@ public class IndexCli
         List artifacts = discoverer.discoverArtifacts( repository, null, false );
 
         ArtifactRepositoryIndex index =
-            indexFactory.createArtifactRepositoryIndex( new File( args[0], ".index" ).getAbsolutePath(), repository );
+            indexFactory.createArtifactRepositoryIndex( new File( args[0], ".index" ), repository );
 
         long time = System.currentTimeMillis();
         try
index b7e410bb304449e5163fbbda6297171db21ee5ed..b4b04ed693ee963d2e86c816259e63170ed12012 100644 (file)
@@ -65,7 +65,7 @@ public class IndexSearcherCli
                                                                           layout, null, null );
 
         ArtifactRepositoryIndex index =
-            indexFactory.createArtifactRepositoryIndex( new File( args[0], ".index" ).getAbsolutePath(), repository );
+            indexFactory.createArtifactRepositoryIndex( new File( args[0], ".index" ), repository );
 
         RepositoryIndexSearcher searcher = (RepositoryIndexSearcher) embedder.lookup( RepositoryIndexSearcher.ROLE );
 
diff --git a/maven-repository-configuration/pom.xml b/maven-repository-configuration/pom.xml
new file mode 100644 (file)
index 0000000..783bade
--- /dev/null
@@ -0,0 +1,40 @@
+<?xml version="1.0"?>
+<project>
+  <parent>
+    <artifactId>maven-repository-manager</artifactId>
+    <groupId>org.apache.maven.repository</groupId>
+    <version>1.0-SNAPSHOT</version>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache.maven.repository</groupId>
+  <artifactId>maven-repository-configuration</artifactId>
+  <name>Maven Repository Manager Configuration</name>
+  <dependencies>
+    <dependency>
+      <groupId>org.codehaus.plexus</groupId>
+      <artifactId>plexus-utils</artifactId>
+    </dependency>
+  </dependencies>
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.codehaus.modello</groupId>
+        <artifactId>modello-maven-plugin</artifactId>
+        <version>1.0-alpha-8</version>
+        <executions>
+          <execution>
+            <goals>
+              <goal>xpp3-writer</goal>
+              <goal>java</goal>
+              <goal>xpp3-reader</goal>
+            </goals>
+          </execution>
+        </executions>
+        <configuration>
+          <version>1.0.0</version>
+          <model>src/main/mdo/configuration.mdo</model>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>
diff --git a/maven-repository-configuration/src/main/mdo/configuration.mdo b/maven-repository-configuration/src/main/mdo/configuration.mdo
new file mode 100644 (file)
index 0000000..37b2175
--- /dev/null
@@ -0,0 +1,82 @@
+<model>
+  <id>configuration</id>
+  <name>Configuration</name>
+  <description>
+    Configuration for the Maven Repository Manager.
+  </description>
+  <defaults>
+    <default>
+      <key>package</key>
+      <value>org.apache.maven.repository.configuration</value>
+    </default>
+  </defaults>
+  <!-- TODO! break out subtypes such as <discovery> and create a list of blacklist -->
+  <classes>
+    <class rootElement="true" xml.tagName="configuration">
+      <name>Configuration</name>
+      <version>1.0.0</version>
+      <fields>
+        <field>
+          <name>repositoryDirectory</name>
+          <version>1.0.0</version>
+          <type>String</type>
+          <required>true</required>
+          <description>
+            The location of the repository to monitor.
+          </description>
+        </field>
+        <field>
+          <name>repositoryLayout</name>
+          <version>1.0.0</version>
+          <type>String</type>
+          <required>true</required>
+          <description>
+            The layout of the repository. Valid values are "default" and "legacy".
+          </description>
+          <!-- TODO: should be able to detect this from the repository (perhaps by metadata at the root) -->
+          <defaultValue>default</defaultValue>
+        </field>
+        <field>
+          <name>indexPath</name>
+          <version>1.0.0</version>
+          <type>String</type>
+          <description>
+            The location of the Lucene index to use for the repository. The default is the .index subdirectory of
+            the repository.
+          </description>
+        </field>
+        <field>
+          <name>minimalIndexPath</name>
+          <version>1.0.0</version>
+          <type>String</type>
+          <description>
+            The location of the reduced Lucene index to use for the repository. The default is the .small-index
+            subdirectory of the repository.
+          </description>
+        </field>
+        <field>
+          <name>discoveryCronExpression</name>
+          <version>1.0.0</version>
+          <type>String</type>
+          <description>When to run the discovery mechanism.</description>
+          <defaultValue>0 0 8 * * ?</defaultValue>
+        </field>
+        <field>
+          <name>discoverSnapshots</name>
+          <version>1.0.0</version>
+          <type>boolean</type>
+          <description>Whether to include snapshot versions in the discovery process</description>
+          <defaultValue>false</defaultValue>
+        </field>
+        <field>
+          <name>discoveryBlackListPatterns</name>
+          <version>1.0.0</version>
+          <type>String</type>
+          <description>Blacklisted patterns in the discovery process</description>
+        </field>
+      </fields>
+    </class>
+  </classes>
+</model>
+
+
diff --git a/maven-repository-core/pom.xml b/maven-repository-core/pom.xml
new file mode 100644 (file)
index 0000000..feb702f
--- /dev/null
@@ -0,0 +1,20 @@
+<?xml version="1.0"?>
+<project>
+  <parent>
+    <artifactId>maven-repository-manager</artifactId>
+    <groupId>org.apache.maven.repository</groupId>
+    <version>1.0-SNAPSHOT</version>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache.maven.repository</groupId>
+  <artifactId>maven-repository-core</artifactId>
+  <name>Maven Repository Manager Core</name>
+  <dependencies>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>3.8.1</version>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+</project>
index f65c6ff9df6c16748d0ce413b6af6eee19d7255d..2c21027adaa621330a63089241ee05d7b3efc177 100644 (file)
@@ -41,7 +41,7 @@ public abstract class AbstractRepositoryIndex
     implements RepositoryIndex
 {
     // TODO: can this be derived from the repository? -- probably a sensible default, but still should be configurable, but this could just be on the call to open()
-    private String indexPath;
+    private File indexPath;
 
     private boolean indexOpen;
 
@@ -58,7 +58,7 @@ public abstract class AbstractRepositoryIndex
      * @param indexPath
      * @param repository
      */
-    protected AbstractRepositoryIndex( String indexPath, ArtifactRepository repository )
+    protected AbstractRepositoryIndex( File indexPath, ArtifactRepository repository )
     {
         this.repository = repository;
         this.indexPath = indexPath;
@@ -144,7 +144,7 @@ public abstract class AbstractRepositoryIndex
     /**
      * @see org.apache.maven.repository.indexing.RepositoryIndex#getIndexPath()
      */
-    public String getIndexPath()
+    public File getIndexPath()
     {
         return indexPath;
     }
@@ -244,19 +244,17 @@ public abstract class AbstractRepositoryIndex
     protected boolean indexExists()
         throws RepositoryIndexException
     {
-        File indexDir = new File( indexPath );
-
-        if ( IndexReader.indexExists( indexDir ) )
+        if ( IndexReader.indexExists( indexPath ) )
         {
             return true;
         }
-        else if ( !indexDir.exists() )
+        else if ( !indexPath.exists() )
         {
             return false;
         }
-        else if ( indexDir.isDirectory() )
+        else if ( indexPath.isDirectory() )
         {
-            if ( indexDir.listFiles().length > 1 )
+            if ( indexPath.listFiles().length > 1 )
             {
                 throw new RepositoryIndexException( indexPath + " is not a valid index directory." );
             }
index bb410b81561e254a10586bb05866fbeb1066f610..09b1674af7aca42ca20e9d2119b9d7b9a58ec7f8 100644 (file)
@@ -22,6 +22,7 @@ import org.apache.maven.artifact.Artifact;
 import org.apache.maven.artifact.repository.ArtifactRepository;
 import org.apache.maven.repository.digest.Digester;
 
+import java.io.File;
 import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.security.NoSuchAlgorithmException;
@@ -48,7 +49,7 @@ public class ArtifactRepositoryIndex
      * @param repository the repository where the indexed artifacts are located
      * @param digester   the digester object to generate the checksum strings
      */
-    public ArtifactRepositoryIndex( String indexPath, ArtifactRepository repository, Digester digester )
+    public ArtifactRepositoryIndex( File indexPath, ArtifactRepository repository, Digester digester )
     {
         super( indexPath, repository );
         this.digester = digester;
index f83c0d5dec6c2896326efcd981466ed09292851e..95314574759813c620be1270d20a7b22e2539e39 100644 (file)
@@ -78,7 +78,7 @@ public class DefaultRepositoryIndexSearcher
         IndexSearcher searcher;\r
         try\r
         {\r
-            searcher = new IndexSearcher( index.getIndexPath() );\r
+            searcher = new IndexSearcher( index.getIndexPath().getAbsolutePath() );\r
         }\r
         catch ( IOException e )\r
         {\r
index 62276d717a12600fc082adb1965e3bf6b3cb155a..b03f9320910b9bb8904399411ca0099b066c0762 100644 (file)
@@ -20,6 +20,8 @@ import org.apache.maven.artifact.factory.ArtifactFactory;
 import org.apache.maven.artifact.repository.ArtifactRepository;
 import org.apache.maven.repository.digest.Digester;
 
+import java.io.File;
+
 /**
  * @author Edwin Punzalan
  * @plexus.component role="org.apache.maven.repository.indexing.RepositoryIndexingFactory"
@@ -37,28 +39,19 @@ public class DefaultRepositoryIndexingFactory
      */
     private ArtifactFactory artifactFactory;
 
-    /**
-     * @see RepositoryIndexingFactory#createArtifactRepositoryIndex(String, org.apache.maven.artifact.repository.ArtifactRepository)
-     */
-    public ArtifactRepositoryIndex createArtifactRepositoryIndex( String indexPath, ArtifactRepository repository )
+    public ArtifactRepositoryIndex createArtifactRepositoryIndex( File indexPath, ArtifactRepository repository )
         throws RepositoryIndexException
     {
         return new ArtifactRepositoryIndex( indexPath, repository, digester );
     }
 
-    /**
-     * @see RepositoryIndexingFactory#createPomRepositoryIndex(String, org.apache.maven.artifact.repository.ArtifactRepository)
-     */
-    public PomRepositoryIndex createPomRepositoryIndex( String indexPath, ArtifactRepository repository )
+    public PomRepositoryIndex createPomRepositoryIndex( File indexPath, ArtifactRepository repository )
         throws RepositoryIndexException
     {
         return new PomRepositoryIndex( indexPath, repository, digester, artifactFactory );
     }
 
-    /**
-     * @see RepositoryIndexingFactory#createMetadataRepositoryIndex(String, org.apache.maven.artifact.repository.ArtifactRepository)
-     */
-    public MetadataRepositoryIndex createMetadataRepositoryIndex( String indexPath, ArtifactRepository repository )
+    public MetadataRepositoryIndex createMetadataRepositoryIndex( File indexPath, ArtifactRepository repository )
         throws RepositoryIndexException
     {
         return new MetadataRepositoryIndex( indexPath, repository );
index c54ea9f3cfff398c6530275365f475ef8d744b64..61d15e537be69f09bcb0e0fff95cc68e40073641 100644 (file)
@@ -68,7 +68,7 @@ public class EclipseRepositoryIndex
      * @param repository the repository where the indexed artifacts are located
      * @param digester   the digester object to generate the checksum strings
      */
-    public EclipseRepositoryIndex( String indexPath, ArtifactRepository repository, Digester digester )
+    public EclipseRepositoryIndex( File indexPath, ArtifactRepository repository, Digester digester )
     {
         super( indexPath, repository );
 
@@ -169,7 +169,7 @@ public class EclipseRepositoryIndex
     public File getCompressedCopy()
         throws IOException
     {
-        File indexPath = new File( getIndexPath() );
+        File indexPath = getIndexPath();
         String name = indexPath.getName();
 
         File outputFile = new File( indexPath.getParent(), name + ".zip" );
index 8fcea86672719b3052cf40f6be5222a36202995c..8e38f3070c851a74f0e8178bd3c9169170ecc7b5 100644 (file)
@@ -24,6 +24,7 @@ import org.apache.maven.artifact.repository.metadata.Plugin;
 import org.apache.maven.artifact.repository.metadata.RepositoryMetadata;\r
 import org.apache.maven.artifact.repository.metadata.Versioning;\r
 \r
+import java.io.File;\r
 import java.io.IOException;\r
 import java.util.Iterator;\r
 import java.util.List;\r
@@ -40,7 +41,7 @@ public class MetadataRepositoryIndex
      * @param indexPath  the path to the index\r
      * @param repository the repository where the metadata to be indexed is located\r
      */\r
-    public MetadataRepositoryIndex( String indexPath, ArtifactRepository repository )\r
+    public MetadataRepositoryIndex( File indexPath, ArtifactRepository repository )\r
     {\r
         super( indexPath, repository );\r
     }\r
index b4f7260b0197b419f92333b3e2fae8e024c04959..6e95e85d64bc09676985d5d17d7f457f92563df7 100644 (file)
@@ -56,7 +56,7 @@ public class PomRepositoryIndex
      * @param digester        the digester to be used for generating checksums
      * @param artifactFactory the factory for building artifact objects
      */
-    public PomRepositoryIndex( String indexPath, ArtifactRepository repository, Digester digester,
+    public PomRepositoryIndex( File indexPath, ArtifactRepository repository, Digester digester,
                                ArtifactFactory artifactFactory )
     {
         super( indexPath, repository );
index 52064e9d77e3793a821ba22a769ce58c5dff4133..6735f864f4f5578cf7c23f284eab8e4ab7922131 100644 (file)
@@ -19,6 +19,7 @@ package org.apache.maven.repository.indexing;
 import org.apache.lucene.analysis.Analyzer;
 import org.apache.maven.artifact.repository.ArtifactRepository;
 
+import java.io.File;
 import java.util.Arrays;
 import java.util.List;
 
@@ -113,7 +114,7 @@ public interface RepositoryIndex
      *
      * @return the path where the index resides
      */
-    String getIndexPath();
+    File getIndexPath();
 
     /**
      * Tests an index field if it is a keyword field
index 8a8891d1533bd7294a7689724873d36b65bd69f7..e51701cbbdcecf928872a8f4cf5d49421ff14d2d 100644 (file)
@@ -18,6 +18,8 @@ package org.apache.maven.repository.indexing;
 
 import org.apache.maven.artifact.repository.ArtifactRepository;
 
+import java.io.File;
+
 
 /**
  * @author Edwin Punzalan
@@ -34,7 +36,7 @@ public interface RepositoryIndexingFactory
      * @return the ArtifactRepositoryIndex instance
      * @throws RepositoryIndexException
      */
-    ArtifactRepositoryIndex createArtifactRepositoryIndex( String indexPath, ArtifactRepository repository )
+    ArtifactRepositoryIndex createArtifactRepositoryIndex( File indexPath, ArtifactRepository repository )
         throws RepositoryIndexException;
 
     /**
@@ -45,7 +47,7 @@ public interface RepositoryIndexingFactory
      * @return the PomRepositoryIndex instance
      * @throws RepositoryIndexException
      */
-    PomRepositoryIndex createPomRepositoryIndex( String indexPath, ArtifactRepository repository )
+    PomRepositoryIndex createPomRepositoryIndex( File indexPath, ArtifactRepository repository )
         throws RepositoryIndexException;
 
     /**
@@ -56,7 +58,7 @@ public interface RepositoryIndexingFactory
      * @return the MetadataRepositoryIndex instance
      * @throws RepositoryIndexException
      */
-    MetadataRepositoryIndex createMetadataRepositoryIndex( String indexPath, ArtifactRepository repository )
+    MetadataRepositoryIndex createMetadataRepositoryIndex( File indexPath, ArtifactRepository repository )
         throws RepositoryIndexException;
 
 }
index fce15eefe73d76bac0c7125afce08cfd23611694..b04e804334f50fa7f0bee5c995acc1dbf75e8eec 100644 (file)
@@ -43,7 +43,7 @@ public class ArtifactRepositoryIndexingTest
 
     private ArtifactRepository repository;
 
-    private String indexPath;
+    private File indexPath;
 
     private Digester digester;
 
@@ -59,7 +59,7 @@ public class ArtifactRepositoryIndexingTest
         repository = repoFactory.createArtifactRepository( "test", repoDir, layout, null, null );
         digester = new DefaultDigester();
 
-        indexPath = "target/index";
+        indexPath = getTestFile( "target/index" );
         FileUtils.deleteDirectory( indexPath );
     }
 
@@ -77,7 +77,7 @@ public class ArtifactRepositoryIndexingTest
 
         try
         {
-            String notIndexDir = new File( "pom.xml" ).getAbsolutePath();
+            File notIndexDir = new File( "pom.xml" );
             ArtifactRepositoryIndex indexer = factory.createArtifactRepositoryIndex( notIndexDir, repository );
             indexer.indexArtifact( artifact );
             fail( "Must throw exception on non-directory index directory" );
@@ -89,7 +89,7 @@ public class ArtifactRepositoryIndexingTest
 
         try
         {
-            String notIndexDir = new File( "" ).getAbsolutePath();
+            File notIndexDir = new File( "" );
             ArtifactRepositoryIndex indexer = factory.createArtifactRepositoryIndex( notIndexDir, repository );
             indexer.indexArtifact( artifact );
             fail( "Must throw an exception on a non-index directory" );
@@ -433,7 +433,7 @@ public class ArtifactRepositoryIndexingTest
             assertTrue( true );
         }
 
-        indexer = factory.createArtifactRepositoryIndex( "target/index/sample", repository );
+        indexer = factory.createArtifactRepositoryIndex( getTestFile( "target/index/sample" ), repository );
 
         try
         {
index 39670273fecc7d2bac9a33022d777ec1846831f4..19974cbd932fc4634e91c1449c20814b36f992b6 100644 (file)
@@ -43,7 +43,7 @@ public class EclipseRepositoryIndexTest
 
     private ArtifactRepository repository;
 
-    private String indexPath;
+    private File indexPath;
 
     private Digester digester;
 
@@ -63,7 +63,7 @@ public class EclipseRepositoryIndexTest
         repository = repoFactory.createArtifactRepository( "test", repoDir, layout, null, null );
         digester = new DefaultDigester();
 
-        indexPath = "target/index";
+        indexPath = getTestFile( "target/index" );
         FileUtils.deleteDirectory( indexPath );
     }
 
@@ -125,7 +125,7 @@ public class EclipseRepositoryIndexTest
 
         try
         {
-            String notIndexDir = new File( "pom.xml" ).getAbsolutePath();
+            File notIndexDir = new File( "pom.xml" );
             EclipseRepositoryIndex indexer = new EclipseRepositoryIndex( notIndexDir, repository, digester );
             indexer.indexArtifact( artifact );
             fail( "Must throw exception on non-directory index directory" );
@@ -137,7 +137,7 @@ public class EclipseRepositoryIndexTest
 
         try
         {
-            String notIndexDir = new File( "" ).getAbsolutePath();
+            File notIndexDir = new File( "" );
             EclipseRepositoryIndex indexer = new EclipseRepositoryIndex( notIndexDir, repository, digester );
             indexer.indexArtifact( artifact );
             fail( "Must throw an exception on a non-index directory" );
@@ -169,7 +169,7 @@ public class EclipseRepositoryIndexTest
     {
         EclipseRepositoryIndex index = createTestIndex();
 
-        IndexSearcher searcher = new IndexSearcher( index.getIndexPath() );
+        IndexSearcher searcher = new IndexSearcher( index.getIndexPath().getAbsolutePath() );
         try
         {
             QueryParser parser = new QueryParser( "j", index.getAnalyzer() );
index 34e80e2a03dfa50aba53238d96768dd168438a38..ba3a072db20451fc05b45b7cddee32dec0caae38 100644 (file)
@@ -52,7 +52,7 @@ public class MetadataRepositoryIndexingTest
 {\r
     private ArtifactRepository repository;\r
 \r
-    private String indexPath;\r
+    private File indexPath;\r
 \r
     private ArtifactFactory artifactFactory;\r
 \r
@@ -71,7 +71,7 @@ public class MetadataRepositoryIndexingTest
         ArtifactRepositoryFactory repoFactory = (ArtifactRepositoryFactory) lookup( ArtifactRepositoryFactory.ROLE );\r
         repository = repoFactory.createArtifactRepository( "test", repoDir, layout, null, null );\r
 \r
-        indexPath = "target/index";\r
+        indexPath = getTestFile( "target/index" );\r
         FileUtils.deleteDirectory( indexPath );\r
     }\r
 \r
index a7087736fb9b1eb90ac1e09986987aae368d5e67..fe0aa1d41e2cb91b193548c86060671a35930575 100644 (file)
@@ -48,7 +48,7 @@ public class PomRepositoryIndexingTest
 
     private ArtifactFactory artifactFactory;
 
-    private String indexPath;
+    private File indexPath;
 
     private Digester digester;
 
@@ -64,7 +64,7 @@ public class PomRepositoryIndexingTest
         repository = repoFactory.createArtifactRepository( "test", repoDir, layout, null, null );
         digester = new DefaultDigester();
 
-        indexPath = "target/index";
+        indexPath = getTestFile( "target/index" );
         FileUtils.deleteDirectory( indexPath );
     }
 
@@ -77,7 +77,7 @@ public class PomRepositoryIndexingTest
 
         try
         {
-            String notIndexDir = new File( "pom.xml" ).getAbsolutePath();
+            File notIndexDir = new File( "pom.xml" );
             PomRepositoryIndex indexer = factory.createPomRepositoryIndex( notIndexDir, repository );
             indexer.indexPom( pom );
             fail( "Must throw exception on non-directory index directory" );
@@ -89,7 +89,7 @@ public class PomRepositoryIndexingTest
 
         try
         {
-            String notIndexDir = new File( "" ).getAbsolutePath();
+            File notIndexDir = new File( "" );
             PomRepositoryIndex indexer = factory.createPomRepositoryIndex( notIndexDir, repository );
             indexer.indexPom( pom );
             fail( "Must throw an exception on a non-index directory" );
index 9c48ddc2391d116f534d5cd6fb35108f92b6e20b..5b425a5525b5a472af8f799ffdafd5557c1bbee1 100644 (file)
@@ -54,7 +54,7 @@ public class RepositoryIndexSearchLayerTest
 \r
     private ArtifactFactory artifactFactory;\r
 \r
-    private String indexPath;\r
+    private File indexPath;\r
 \r
     /**\r
      * Setup method\r
@@ -71,7 +71,7 @@ public class RepositoryIndexSearchLayerTest
         ArtifactRepositoryFactory repoFactory = (ArtifactRepositoryFactory) lookup( ArtifactRepositoryFactory.ROLE );\r
         repository = repoFactory.createArtifactRepository( "test", repoDir, layout, null, null );\r
 \r
-        indexPath = "target/index";\r
+        indexPath = getTestFile( "target/index" );\r
         FileUtils.deleteDirectory( indexPath );\r
     }\r
 \r
index 076e3b81a74c3a3e56e11879e3616364266694c9..e865e8cec7f80e3e4e70c01049913b21cfb2dcca 100644 (file)
@@ -68,8 +68,8 @@ public class DuplicateArtifactFileReportProcessor
     {
         if ( artifact.getFile() != null )
         {
-            //@todo remove hard-coded value; current value enables tests to pass
-            String indexPath = new File( "target/.index" ).getAbsolutePath();
+            //@todo remove hard-coded value; current value enables tests to pass!
+            File indexPath = new File( "target/.index" );
 
             RepositoryIndex index;
             try
index 5f97f05ea43eaa5222f347416e12212098be5085..7c6b317023eb7a94696fcfd7808b872ab4f64bcf 100644 (file)
@@ -41,7 +41,7 @@ public class DuplicateArtifactFileReportProcessorTest
 
     private ArtifactFactory artifactFactory;
 
-    private String indexPath = new File( "target/.index" ).getAbsolutePath();
+    private File indexPath = getTestFile( "target/.index" );
 
     protected void setUp()
         throws Exception
index 6e275db52162bd348a2f3ffa307e463e11cd910b..070b49098151d73e8c71ce33b171705989d681c1 100644 (file)
       <groupId>org.apache.maven.repository</groupId>
       <artifactId>maven-repository-discovery</artifactId>
     </dependency>
+    <dependency>
+      <groupId>org.apache.maven.repository</groupId>
+      <artifactId>maven-repository-configuration</artifactId>
+    </dependency>
     <dependency>
       <groupId>org.apache.maven.repository</groupId>
       <artifactId>maven-repository-artifact-applet</artifactId>
index fe4a615a692c8f1a4433e6d5490518a9d8160760..79d5f7d685b9e488807979380fdd550f601b8cf4 100644 (file)
@@ -17,9 +17,12 @@ package org.apache.maven.repository.manager.web.action;
  */\r
 \r
 import com.opensymphony.xwork.Action;\r
+import org.apache.maven.repository.configuration.Configuration;\r
 import org.apache.maven.repository.manager.web.execution.DiscovererExecution;\r
 import org.apache.maven.repository.manager.web.job.DiscovererScheduler;\r
 \r
+import java.io.File;\r
+\r
 /**\r
  * This is the Action class of index.jsp, which is the initial page of the web application.\r
  * It invokes the DiscovererScheduler to set the DiscoverJob in the scheduler.\r
@@ -48,8 +51,9 @@ public class BaseAction
     {\r
         try\r
         {\r
-            execution.executeDiscovererIfIndexDoesNotExist();\r
-            discovererScheduler.setSchedule();\r
+            Configuration configuration = new Configuration(); // TODO!\r
+            execution.executeDiscovererIfIndexDoesNotExist( new File( configuration.getIndexPath() ) );\r
+            discovererScheduler.setSchedule( configuration.getDiscoveryCronExpression() );\r
         }\r
         catch ( Exception e )\r
         {\r
index b80ab60137fdeda02038db8235af1e005ee120e5..a0927b660d4c57d639271951f5ad8a45e5b2d584 100644 (file)
@@ -19,16 +19,18 @@ package org.apache.maven.repository.manager.web.action;
 import com.opensymphony.xwork.Action;\r
 import org.apache.maven.artifact.repository.ArtifactRepository;\r
 import org.apache.maven.artifact.repository.ArtifactRepositoryFactory;\r
+import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout;\r
+import org.apache.maven.repository.configuration.Configuration;\r
 import org.apache.maven.repository.indexing.ArtifactRepositoryIndex;\r
 import org.apache.maven.repository.indexing.RepositoryIndexException;\r
 import org.apache.maven.repository.indexing.RepositoryIndexSearchException;\r
 import org.apache.maven.repository.indexing.RepositoryIndexSearchLayer;\r
 import org.apache.maven.repository.indexing.RepositoryIndexingFactory;\r
-import org.apache.maven.repository.manager.web.job.Configuration;\r
 \r
 import java.io.File;\r
 import java.net.MalformedURLException;\r
 import java.util.List;\r
+import java.util.Map;\r
 \r
 /**\r
  * Searches for searchString in all indexed fields.\r
@@ -58,24 +60,26 @@ public class GeneralSearchAction
     private ArtifactRepositoryFactory repositoryFactory;\r
 \r
     /**\r
-     * @plexus.requirement\r
+     * @plexus.requirement role="org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout"\r
      */\r
-    private Configuration configuration;\r
+    private Map repositoryLayouts;\r
 \r
     public String execute()\r
         throws MalformedURLException, RepositoryIndexException, RepositoryIndexSearchException\r
     {\r
         if ( searchString != null && searchString.length() != 0 )\r
         {\r
-            String indexPath = configuration.getIndexDirectory();\r
-\r
-            // TODO: reduce the amount of lookup?\r
+            Configuration configuration = new Configuration(); // TODO!\r
+            File indexPath = new File( configuration.getIndexPath() );\r
 \r
+            // TODO: [!] repository should only have been instantiated once\r
             File repositoryDirectory = new File( configuration.getRepositoryDirectory() );\r
             String repoDir = repositoryDirectory.toURL().toString();\r
 \r
+            ArtifactRepositoryLayout layout =\r
+                (ArtifactRepositoryLayout) repositoryLayouts.get( configuration.getRepositoryLayout() );\r
             ArtifactRepository repository =\r
-                repositoryFactory.createArtifactRepository( "test", repoDir, configuration.getLayout(), null, null );\r
+                repositoryFactory.createArtifactRepository( "test", repoDir, layout, null, null );\r
 \r
             ArtifactRepositoryIndex index = factory.createArtifactRepositoryIndex( indexPath, repository );\r
 \r
index 543b451438cde2269e622a28047ec24fb5f4da36..cbd28f1e030bddcc55b8812704aed5b75038b664 100644 (file)
@@ -19,6 +19,8 @@ package org.apache.maven.repository.manager.web.action;
 import com.opensymphony.xwork.Action;
 import org.apache.maven.artifact.repository.ArtifactRepository;
 import org.apache.maven.artifact.repository.ArtifactRepositoryFactory;
+import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout;
+import org.apache.maven.repository.configuration.Configuration;
 import org.apache.maven.repository.indexing.ArtifactRepositoryIndex;
 import org.apache.maven.repository.indexing.RepositoryIndex;
 import org.apache.maven.repository.indexing.RepositoryIndexException;
@@ -26,11 +28,11 @@ import org.apache.maven.repository.indexing.RepositoryIndexSearchException;
 import org.apache.maven.repository.indexing.RepositoryIndexSearchLayer;
 import org.apache.maven.repository.indexing.RepositoryIndexingFactory;
 import org.apache.maven.repository.indexing.query.SinglePhraseQuery;
-import org.apache.maven.repository.manager.web.job.Configuration;
 
 import java.io.File;
 import java.net.MalformedURLException;
 import java.util.List;
+import java.util.Map;
 
 /**
  * Search by package name.
@@ -53,19 +55,19 @@ public class PackageSearchAction
     private RepositoryIndexingFactory factory;
 
     /**
-     * @plexus.requirement
+     * @plexus.requirement role="org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout"
      */
-    private ArtifactRepositoryFactory repositoryFactory;
+    private Map repositoryLayouts;
 
     /**
      * @plexus.requirement
      */
-    private RepositoryIndexSearchLayer searchLayer;
+    private ArtifactRepositoryFactory repositoryFactory;
 
     /**
      * @plexus.requirement
      */
-    private Configuration configuration;
+    private RepositoryIndexSearchLayer searchLayer;
 
     public String execute()
         throws MalformedURLException, RepositoryIndexException, RepositoryIndexSearchException
@@ -87,15 +89,17 @@ public class PackageSearchAction
             return ERROR;
         }
 
-        // TODO: better config [!]
-        String indexPath = configuration.getIndexDirectory();
+        // TODO: better config - share with general [!]
+        Configuration configuration = new Configuration();
+        File indexPath = new File( configuration.getIndexPath() );
 
-        // TODO: reduce the amount of lookup?
         File repositoryDirectory = new File( configuration.getRepositoryDirectory() );
         String repoDir = repositoryDirectory.toURL().toString();
 
+        ArtifactRepositoryLayout layout =
+            (ArtifactRepositoryLayout) repositoryLayouts.get( configuration.getRepositoryLayout() );
         ArtifactRepository repository =
-            repositoryFactory.createArtifactRepository( "repository", repoDir, configuration.getLayout(), null, null );
+            repositoryFactory.createArtifactRepository( "repository", repoDir, layout, null, null );
 
         ArtifactRepositoryIndex index = factory.createArtifactRepositoryIndex( indexPath, repository );
 
index 1c056e69d677a1ba86b1ceed3f165b46be484864..4e1dfbff21308f48946980df8760cc27e2d8341d 100644 (file)
@@ -24,6 +24,7 @@ import org.apache.maven.artifact.repository.DefaultArtifactRepositoryFactory;
 import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout;
 import org.apache.maven.artifact.repository.metadata.RepositoryMetadata;
 import org.apache.maven.model.Model;
+import org.apache.maven.repository.configuration.Configuration;
 import org.apache.maven.repository.discovery.ArtifactDiscoverer;
 import org.apache.maven.repository.discovery.MetadataDiscoverer;
 import org.apache.maven.repository.indexing.ArtifactRepositoryIndex;
@@ -31,7 +32,6 @@ import org.apache.maven.repository.indexing.MetadataRepositoryIndex;
 import org.apache.maven.repository.indexing.PomRepositoryIndex;
 import org.apache.maven.repository.indexing.RepositoryIndexException;
 import org.apache.maven.repository.indexing.RepositoryIndexingFactory;
-import org.apache.maven.repository.manager.web.job.Configuration;
 import org.codehaus.plexus.logging.AbstractLogEnabled;
 
 import java.io.File;
@@ -39,7 +39,6 @@ import java.net.MalformedURLException;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
-import java.util.Properties;
 
 /**
  * This is the class that executes the discoverer and indexer.
@@ -50,10 +49,6 @@ import java.util.Properties;
 public class DiscovererExecution
     extends AbstractLogEnabled
 {
-    /**
-     * @plexus.requirement
-     */
-    private Configuration config;
 
     /**
      * @plexus.requirement role="org.apache.maven.repository.discovery.ArtifactDiscoverer"
@@ -75,19 +70,21 @@ public class DiscovererExecution
      */
     private ArtifactRepositoryFactory repoFactory;
 
+    /**
+     * @plexus.requirement role="org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout"
+     */
+    private Map repositoryLayouts;
+
     /**
      * Executes discoverer and indexer if an index does not exist yet
      *
+     * @param indexDir
      * @throws MalformedURLException
      * @throws RepositoryIndexException
      */
-    public void executeDiscovererIfIndexDoesNotExist()
+    public void executeDiscovererIfIndexDoesNotExist( File indexDir )
         throws MalformedURLException, RepositoryIndexException
     {
-        Properties props = config.getProperties();
-        String indexPath = props.getProperty( "index.path" );
-
-        File indexDir = new File( indexPath );
         boolean isExisting = false;
 
         if ( IndexReader.indexExists( indexDir ) )
@@ -107,27 +104,26 @@ public class DiscovererExecution
     public void executeDiscoverer()
         throws MalformedURLException, RepositoryIndexException
     {
-        Properties props = config.getProperties();
-        String indexPath = props.getProperty( "index.path" );
-        String blacklistedPatterns = props.getProperty( "blacklist.patterns" );
-        boolean includeSnapshots = Boolean.valueOf( props.getProperty( "include.snapshots" ) ).booleanValue();
-        boolean convertSnapshots = Boolean.valueOf( props.getProperty( "convert.snapshots" ) ).booleanValue();
+        Configuration configuration = new Configuration(); // TODO!
+        File indexPath = new File( configuration.getIndexPath() );
+        String blacklistedPatterns = configuration.getDiscoveryBlackListPatterns();
+        boolean includeSnapshots = configuration.isDiscoverSnapshots();
 
-        ArtifactRepository defaultRepository = getDefaultRepository();
+        ArtifactRepository defaultRepository = getDefaultRepository( configuration );
 
         getLogger().info( "[DiscovererExecution] Started discovery and indexing.." );
-        String layoutProperty = props.getProperty( "layout" );
+        String layoutProperty = configuration.getRepositoryLayout();
         ArtifactDiscoverer discoverer = (ArtifactDiscoverer) artifactDiscoverers.get( layoutProperty );
         List artifacts = discoverer.discoverArtifacts( defaultRepository, blacklistedPatterns, includeSnapshots );
         indexArtifact( artifacts, indexPath, defaultRepository );
 
-        List models = discoverer.discoverStandalonePoms( defaultRepository, blacklistedPatterns, convertSnapshots );
+        List models = discoverer.discoverStandalonePoms( defaultRepository, blacklistedPatterns, includeSnapshots );
         indexPom( models, indexPath, defaultRepository );
 
         MetadataDiscoverer metadataDiscoverer = (MetadataDiscoverer) metadataDiscoverers.get( layoutProperty );
         List metadataList =
             metadataDiscoverer.discoverMetadata( new File( defaultRepository.getBasedir() ), blacklistedPatterns );
-        indexMetadata( metadataList, indexPath, new File( defaultRepository.getBasedir() ), config.getLayout() );
+        indexMetadata( metadataList, indexPath, defaultRepository );
         getLogger().info( "[DiscovererExecution] Finished discovery and indexing." );
     }
 
@@ -138,7 +134,7 @@ public class DiscovererExecution
      * @param indexPath  the path to the index file
      * @param repository the repository where the artifacts are located
      */
-    protected void indexArtifact( List artifacts, String indexPath, ArtifactRepository repository )
+    protected void indexArtifact( List artifacts, File indexPath, ArtifactRepository repository )
         throws RepositoryIndexException
     {
         ArtifactRepositoryIndex artifactIndex = indexFactory.createArtifactRepositoryIndex( indexPath, repository );
@@ -158,18 +154,12 @@ public class DiscovererExecution
     /**
      * Index the metadata in the list
      *
-     * @param metadataList   the metadata to be indexed
-     * @param indexPath      the path to the index file
-     * @param repositoryBase the repository where the metadata are located
+     * @param metadataList the metadata to be indexed
+     * @param indexPath    the path to the index file
      */
-    protected void indexMetadata( List metadataList, String indexPath, File repositoryBase,
-                                  ArtifactRepositoryLayout layout )
+    protected void indexMetadata( List metadataList, File indexPath, ArtifactRepository repository )
         throws RepositoryIndexException, MalformedURLException
     {
-        String repoDir = repositoryBase.toURL().toString();
-        ArtifactRepository repository =
-            repoFactory.createArtifactRepository( "repository", repoDir, layout, null, null );
-
         MetadataRepositoryIndex metadataIndex = indexFactory.createMetadataRepositoryIndex( indexPath, repository );
         for ( Iterator iter = metadataList.iterator(); iter.hasNext(); )
         {
@@ -191,7 +181,7 @@ public class DiscovererExecution
      * @param indexPath  the path to the index
      * @param repository the artifact repository where the poms were discovered
      */
-    protected void indexPom( List models, String indexPath, ArtifactRepository repository )
+    protected void indexPom( List models, File indexPath, ArtifactRepository repository )
         throws RepositoryIndexException
     {
         PomRepositoryIndex pomIndex = indexFactory.createPomRepositoryIndex( indexPath, repository );
@@ -214,33 +204,16 @@ public class DiscovererExecution
      * @return an ArtifactRepository instance
      * @throws java.net.MalformedURLException
      */
-    protected ArtifactRepository getDefaultRepository()
+    protected ArtifactRepository getDefaultRepository( Configuration configuration )
         throws MalformedURLException
     {
-        File repositoryDirectory = new File( config.getRepositoryDirectory() );
+        // TODO! share with general search action, should only instantiate once
+        File repositoryDirectory = new File( configuration.getRepositoryDirectory() );
         String repoDir = repositoryDirectory.toURL().toString();
         ArtifactRepositoryFactory repoFactory = new DefaultArtifactRepositoryFactory();
 
-        return repoFactory.createArtifactRepository( "test", repoDir, config.getLayout(), null, null );
-    }
-
-    /**
-     * Method that sets the configuration object
-     *
-     * @param config
-     */
-    public void setConfiguration( Configuration config )
-    {
-        this.config = config;
-    }
-
-    /**
-     * Returns the cofiguration
-     *
-     * @return a Configuration object that contains the configuration values
-     */
-    public Configuration getConfiguration()
-    {
-        return config;
+        ArtifactRepositoryLayout layout =
+            (ArtifactRepositoryLayout) repositoryLayouts.get( configuration.getRepositoryLayout() );
+        return repoFactory.createArtifactRepository( "test", repoDir, layout, null, null );
     }
 }
diff --git a/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/job/Configuration.java b/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/job/Configuration.java
deleted file mode 100644 (file)
index 0da8440..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-package org.apache.maven.repository.manager.web.job;\r
-\r
-/*\r
- * Copyright 2005-2006 The Apache Software Foundation.\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- *      http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-\r
-import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout;\r
-import org.apache.maven.artifact.repository.layout.DefaultRepositoryLayout;\r
-import org.apache.maven.artifact.repository.layout.LegacyRepositoryLayout;\r
-import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable;\r
-import org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException;\r
-\r
-import java.util.Properties;\r
-\r
-/**\r
- * This class contains the configuration values to be used by the scheduler\r
- *\r
- * @todo should not need to be initializable [!] Should have individual configuration items, and they could well be configured on the job itself, not in this class\r
- */\r
-public class Configuration\r
-    implements Initializable\r
-{\r
-\r
-    private Properties props;\r
-\r
-    /**\r
-     * @throws InitializationException\r
-     */\r
-    public void initialize()\r
-        throws InitializationException\r
-    {\r
-    }\r
-\r
-    /**\r
-     * Set the properties object\r
-     *\r
-     * @param properties\r
-     */\r
-    public void setProperties( Properties properties )\r
-    {\r
-        this.props = properties;\r
-    }\r
-\r
-    /**\r
-     * Returns the properties object\r
-     *\r
-     * @return a Properties object that contains the configuration values\r
-     */\r
-    public Properties getProperties()\r
-    {\r
-        return props;\r
-    }\r
-\r
-    public ArtifactRepositoryLayout getLayout()\r
-    {\r
-        // TODO: lookup from map [!]\r
-        ArtifactRepositoryLayout layout;\r
-        if ( "legacy".equals( props.getProperty( "layout" ) ) )\r
-        {\r
-            layout = new LegacyRepositoryLayout();\r
-        }\r
-        else\r
-        {\r
-            layout = new DefaultRepositoryLayout();\r
-        }\r
-        return layout;\r
-    }\r
-\r
-    public String getIndexDirectory()\r
-    {\r
-        return props.getProperty( "index.path" );\r
-    }\r
-\r
-    public String getRepositoryDirectory()\r
-    {\r
-        String repositoryDir = "";\r
-        if ( "default".equals( props.getProperty( "layout" ) ) )\r
-        {\r
-            repositoryDir = props.getProperty( "default.repository.dir" );\r
-        }\r
-        else if ( "legacy".equals( props.getProperty( "layout" ) ) )\r
-        {\r
-            repositoryDir = props.getProperty( "legacy.repository.dir" );\r
-        }\r
-        return repositoryDir;\r
-    }\r
-}\r
index 8d66dfe0d5012a0b8a9218a51f554cd6efbcf3df..bad9471a2da2d7561a8c89174464ebc2fcfa8f90 100644 (file)
@@ -26,7 +26,6 @@ import org.quartz.JobDetail;
 import org.quartz.SchedulerException;\r
 \r
 import java.text.ParseException;\r
-import java.util.Properties;\r
 \r
 /**\r
  * This class sets the job to be executed in the plexus-quartz scheduler\r
@@ -36,11 +35,6 @@ import java.util.Properties;
 public class DiscovererScheduler\r
     extends AbstractLogEnabled\r
 {\r
-    /**\r
-     * @plexus.requirement\r
-     */\r
-    private Configuration config;\r
-\r
     /**\r
      * @plexus.requirement\r
      */\r
@@ -54,43 +48,20 @@ public class DiscovererScheduler
     /**\r
      * Method that sets the schedule in the plexus-quartz scheduler\r
      *\r
+     * @param cronExpression\r
      * @throws ParseException\r
      * @throws SchedulerException\r
      */\r
-    public void setSchedule()\r
+    public void setSchedule( String cronExpression )\r
         throws ParseException, SchedulerException\r
     {\r
-        Properties props = config.getProperties();\r
         JobDetail jobDetail = new JobDetail( "discovererJob", "DISCOVERER", DiscovererJob.class );\r
         JobDataMap dataMap = new JobDataMap();\r
         dataMap.put( AbstractJob.LOGGER, getLogger() );\r
         dataMap.put( DiscovererJob.MAP_DISCOVERER_EXECUTION, execution );\r
         jobDetail.setJobDataMap( dataMap );\r
 \r
-        CronTrigger trigger =\r
-            new CronTrigger( "DiscovererTrigger", "DISCOVERER", props.getProperty( "cron.expression" ) );\r
+        CronTrigger trigger = new CronTrigger( "DiscovererTrigger", "DISCOVERER", cronExpression );\r
         scheduler.scheduleJob( jobDetail, trigger );\r
     }\r
-\r
-    /**\r
-     * Method that sets the configuration object\r
-     *\r
-     * @param config\r
-     */\r
-    public void setConfiguration( Configuration config )\r
-    {\r
-        this.config = config;\r
-    }\r
-\r
-    /**\r
-     * Returns the cofiguration\r
-     *\r
-     * @return a Configuration object that contains the configuration values\r
-     */\r
-    public Configuration getConfiguration()\r
-    {\r
-        return config;\r
-    }\r
-\r
-\r
 }\r
index d34d3cd0d30aab5d232d248d3e21c8e0fff653a0..852ec21dd21c4fc2143132df3301f098f415cd57 100644 (file)
       <implementation>org.codehaus.plexus.xwork.PlexusObjectFactory</implementation>
     </component>
 
-    <component>
-      <role>org.apache.maven.repository.manager.web.job.Configuration</role>
-      <implementation>org.apache.maven.repository.manager.web.job.Configuration</implementation>
-      <configuration>
-        <properties>
-          <property>
-            <name>layout</name>
-            <value>default</value>
-          </property>
-          <property>
-            <name>default.repository.dir</name>
-            <value>C:/TEST_REPOS/.m2/repository/</value>
-          </property>
-          <property>
-            <name>legacy.repository.dir</name>
-            <value>C:/TEST_REPOS/.maven/repository/</value>
-          </property>
-          <property>
-            <name>index.path</name>
-            <value>C:/INDEX</value>
-          </property>
-          <property>
-            <name>cron.expression</name>
-            <value>0 0 8 * * ?</value>
-          </property>
-          <property>
-            <name>blacklist.patterns</name>
-            <value>null</value>
-          </property>
-          <property>
-            <name>include.snapshots</name>
-            <value>true</value>
-          </property>
-          <property>
-            <name>convert.snapshots</name>
-            <value>true</value>
-          </property>
-        </properties>
-      </configuration>
-    </component>
-
     <!--
      | Logger manager
      -->
diff --git a/pom.xml b/pom.xml
index 42afaad7715cf5b583979a258ac086c7039b88f8..1e5231bd431f14d060e79616f83d86d98dc6229b 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -14,9 +14,7 @@
   ~ See the License for the specific language governing permissions and
   ~ limitations under the License.
   -->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
   <modelVersion>4.0.0</modelVersion>
   <parent>
     <groupId>org.apache.maven</groupId>
     <module>maven-repository-webapp</module>
     <module>maven-repository-proxy</module>
     <module>maven-repository-manager-site</module>
+    <module>maven-repository-core</module>
+    <module>maven-repository-configuration</module>
   </modules>
   <dependencies>
     <dependency>
         <artifactId>maven-repository-artifact-applet</artifactId>
         <version>${pom.version}</version>
       </dependency>
+      <dependency>
+        <groupId>org.apache.maven.repository</groupId>
+        <artifactId>maven-repository-configuration</artifactId>
+        <version>${pom.version}</version>
+      </dependency>
     </dependencies>
   </dependencyManagement>
   <reporting>
       </build>
     </profile>
   </profiles>
-</project>
+</project>
\ No newline at end of file