continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r672050 - in /continuum/trunk: ./ continuum-api/ continuum-api/src/main/java/org/apache/maven/continuum/configuration/ continuum-base/continuum-scm/ continuum-commons/src/main/java/org/apache/maven/continuum/utils/ continuum-configuration/ ...
Date Thu, 26 Jun 2008 22:53:17 GMT
Author: olamy
Date: Thu Jun 26 15:53:16 2008
New Revision: 672050

URL: http://svn.apache.org/viewvc?rev=672050&view=rev
Log:
[CONTINUUM-1252] General Configuration should be pre-configurable in XML

start some job in continuum-configuration for review.


Added:
    continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/configuration/ContinuumConfiguration.java   (with props)
    continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/configuration/GeneralConfiguration.java   (with props)
    continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/configuration/ProxyConfiguration.java   (with props)
    continuum/trunk/continuum-configuration/src/main/java/org/apache/continuum/
      - copied from r667668, continuum/trunk/continuum-configuration/src/main/java/org/apache/maven/continuum/
    continuum/trunk/continuum-configuration/src/main/java/org/apache/continuum/configuration/
      - copied from r672022, continuum/trunk/continuum-configuration/src/main/java/org/apache/maven/continuum/configuration/
    continuum/trunk/continuum-configuration/src/main/java/org/apache/continuum/configuration/DefaultContinuumConfiguration.java   (with props)
    continuum/trunk/continuum-configuration/src/main/resources/
    continuum/trunk/continuum-configuration/src/main/resources/META-INF/
    continuum/trunk/continuum-configuration/src/main/resources/META-INF/continuum/
    continuum/trunk/continuum-configuration/src/main/resources/META-INF/continuum/continuum-configuration.xml   (with props)
    continuum/trunk/continuum-configuration/src/main/resources/META-INF/spring-context.xml   (with props)
    continuum/trunk/continuum-configuration/src/test/
    continuum/trunk/continuum-configuration/src/test/java/
    continuum/trunk/continuum-configuration/src/test/java/org/
    continuum/trunk/continuum-configuration/src/test/java/org/apache/
    continuum/trunk/continuum-configuration/src/test/java/org/apache/continuum/
    continuum/trunk/continuum-configuration/src/test/java/org/apache/continuum/configuration/
    continuum/trunk/continuum-configuration/src/test/java/org/apache/continuum/configuration/TestDefaultContinuumConfiguration.java   (with props)
    continuum/trunk/continuum-configuration/src/test/resources/
    continuum/trunk/continuum-configuration/src/test/resources/conf/
    continuum/trunk/continuum-configuration/src/test/resources/conf/continuum.xml   (with props)
    continuum/trunk/continuum-configuration/src/test/resources/log4j.xml   (with props)
Removed:
    continuum/trunk/continuum-configuration/src/main/java/org/apache/maven/
Modified:
    continuum/trunk/continuum-api/pom.xml
    continuum/trunk/continuum-base/continuum-scm/pom.xml
    continuum/trunk/continuum-commons/src/main/java/org/apache/maven/continuum/utils/ContinuumUrlValidator.java
    continuum/trunk/continuum-configuration/pom.xml
    continuum/trunk/continuum-configuration/src/main/mdo/configuration.mdo
    continuum/trunk/continuum-core/pom.xml
    continuum/trunk/continuum-core/src/test/resources/log4j.xml
    continuum/trunk/continuum-webapp/pom.xml
    continuum/trunk/pom.xml

Modified: continuum/trunk/continuum-api/pom.xml
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-api/pom.xml?rev=672050&r1=672049&r2=672050&view=diff
==============================================================================
--- continuum/trunk/continuum-api/pom.xml (original)
+++ continuum/trunk/continuum-api/pom.xml Thu Jun 26 15:53:16 2008
@@ -48,6 +48,10 @@
       <artifactId>plexus-taskqueue</artifactId>
     </dependency>
     <dependency>
+      <groupId>commons-lang</groupId>
+      <artifactId>commons-lang</artifactId>
+    </dependency>    
+    <dependency>
       <groupId>org.apache.maven</groupId>
       <artifactId>maven-artifact</artifactId>
     </dependency>

Added: continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/configuration/ContinuumConfiguration.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/configuration/ContinuumConfiguration.java?rev=672050&view=auto
==============================================================================
--- continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/configuration/ContinuumConfiguration.java (added)
+++ continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/configuration/ContinuumConfiguration.java Thu Jun 26 15:53:16 2008
@@ -0,0 +1,40 @@
+package org.apache.maven.continuum.configuration;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * @author <a href="mailto:olamy@apache.org">olamy</a>
+ * @since 17 juin 2008
+ * @version $Id$
+ */
+public interface ContinuumConfiguration
+{
+    GeneralConfiguration getGeneralConfiguration()
+        throws ConfigurationException;
+
+     void setGeneralConfiguration( GeneralConfiguration generalConfiguration )
+        throws ConfigurationException;
+    
+    void save()
+        throws ConfigurationException;
+
+    void reload()
+        throws ConfigurationException;
+}

Propchange: continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/configuration/ContinuumConfiguration.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/configuration/ContinuumConfiguration.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/configuration/ContinuumConfiguration.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Revision Id

Added: continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/configuration/GeneralConfiguration.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/configuration/GeneralConfiguration.java?rev=672050&view=auto
==============================================================================
--- continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/configuration/GeneralConfiguration.java (added)
+++ continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/configuration/GeneralConfiguration.java Thu Jun 26 15:53:16 2008
@@ -0,0 +1,108 @@
+package org.apache.maven.continuum.configuration;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.io.File;
+
+import org.apache.commons.lang.builder.ReflectionToStringBuilder;
+
+
+
+/**
+ * @author <a href="mailto:olamy@apache.org">olamy</a>
+ * @since 17 juin 2008
+ * @version $Id$
+ */
+public class GeneralConfiguration
+{
+
+    private File workingDirectory;
+
+    private File buildOutputDirectory;
+    
+    private File deploymentRepositoryDirectory;
+    
+    private String baseUrl;    
+    
+    private ProxyConfiguration proxyConfiguration;
+    
+    public GeneralConfiguration()
+    {
+        // nothing here
+    }
+    
+    public File getWorkingDirectory()
+    {
+        return workingDirectory;
+    }
+
+    public void setWorkingDirectory( File workingDirectory )
+    {
+        this.workingDirectory = workingDirectory;
+    }
+
+    public File getBuildOutputDirectory()
+    {
+        return buildOutputDirectory;
+    }
+
+    public void setBuildOutputDirectory( File buildOutputDirectory )
+    {
+        this.buildOutputDirectory = buildOutputDirectory;
+    }
+
+    public File getDeploymentRepositoryDirectory()
+    {
+        return deploymentRepositoryDirectory;
+    }
+
+    public void setDeploymentRepositoryDirectory( File deploymentRepositoryDirectory )
+    {
+        this.deploymentRepositoryDirectory = deploymentRepositoryDirectory;
+    }
+
+    public String getBaseUrl()
+    {
+        return baseUrl;
+    }
+
+    public void setBaseUrl( String baseUrl )
+    {
+        this.baseUrl = baseUrl;
+    }
+
+    public ProxyConfiguration getProxyConfiguration()
+    {
+        return proxyConfiguration;
+    }
+
+    public void setProxyConfiguration( ProxyConfiguration proxyConfiguration )
+    {
+        this.proxyConfiguration = proxyConfiguration;
+    }
+
+    @Override
+    public String toString()
+    {
+        return ReflectionToStringBuilder.toString( this );
+    }
+
+    
+}

Propchange: continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/configuration/GeneralConfiguration.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/configuration/GeneralConfiguration.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/configuration/GeneralConfiguration.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Revision Id

Added: continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/configuration/ProxyConfiguration.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/configuration/ProxyConfiguration.java?rev=672050&view=auto
==============================================================================
--- continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/configuration/ProxyConfiguration.java (added)
+++ continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/configuration/ProxyConfiguration.java Thu Jun 26 15:53:16 2008
@@ -0,0 +1,89 @@
+package org.apache.maven.continuum.configuration;
+
+import org.apache.commons.lang.builder.ReflectionToStringBuilder;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * @author <a href="mailto:olamy@apache.org">olamy</a>
+ * @since 24 juin 2008
+ * @version $Id$
+ */
+public class ProxyConfiguration
+{
+    private String proxyHost;
+
+    private int proxyPort;
+    
+    private String proxyUser;
+    
+    private String proxyPassword;
+    
+    public ProxyConfiguration()
+    {
+        // nothing here
+    }
+
+    public String getProxyHost()
+    {
+        return proxyHost;
+    }
+
+    public void setProxyHost( String proxyHost )
+    {
+        this.proxyHost = proxyHost;
+    }
+
+    public int getProxyPort()
+    {
+        return proxyPort;
+    }
+
+    public void setProxyPort( int proxyPort )
+    {
+        this.proxyPort = proxyPort;
+    }
+
+    public String getProxyUser()
+    {
+        return proxyUser;
+    }
+
+    public void setProxyUser( String proxyUser )
+    {
+        this.proxyUser = proxyUser;
+    }
+
+    public String getProxyPassword()
+    {
+        return proxyPassword;
+    }
+
+    public void setProxyPassword( String proxyPassword )
+    {
+        this.proxyPassword = proxyPassword;
+    }
+    
+    @Override
+    public String toString()
+    {
+        return ReflectionToStringBuilder.toString( this );
+    }    
+}

Propchange: continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/configuration/ProxyConfiguration.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/configuration/ProxyConfiguration.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/configuration/ProxyConfiguration.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Revision Id

Modified: continuum/trunk/continuum-base/continuum-scm/pom.xml
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-base/continuum-scm/pom.xml?rev=672050&r1=672049&r2=672050&view=diff
==============================================================================
--- continuum/trunk/continuum-base/continuum-scm/pom.xml (original)
+++ continuum/trunk/continuum-base/continuum-scm/pom.xml Thu Jun 26 15:53:16 2008
@@ -58,12 +58,10 @@
     <dependency>
       <groupId>commons-io</groupId>
       <artifactId>commons-io</artifactId>
-      <version>1.4</version>
     </dependency>
     <dependency>
       <groupId>commons-lang</groupId>
       <artifactId>commons-lang</artifactId>
-      <version>2.1</version>
     </dependency>
   </dependencies>
 </project>

Modified: continuum/trunk/continuum-commons/src/main/java/org/apache/maven/continuum/utils/ContinuumUrlValidator.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-commons/src/main/java/org/apache/maven/continuum/utils/ContinuumUrlValidator.java?rev=672050&r1=672049&r2=672050&view=diff
==============================================================================
--- continuum/trunk/continuum-commons/src/main/java/org/apache/maven/continuum/utils/ContinuumUrlValidator.java (original)
+++ continuum/trunk/continuum-commons/src/main/java/org/apache/maven/continuum/utils/ContinuumUrlValidator.java Thu Jun 26 15:53:16 2008
@@ -1,3 +1,5 @@
+package org.apache.maven.continuum.utils;
+
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -16,7 +18,6 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.maven.continuum.utils;
 
 import java.util.Arrays;
 import java.util.HashSet;

Modified: continuum/trunk/continuum-configuration/pom.xml
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-configuration/pom.xml?rev=672050&r1=672049&r2=672050&view=diff
==============================================================================
--- continuum/trunk/continuum-configuration/pom.xml (original)
+++ continuum/trunk/continuum-configuration/pom.xml Thu Jun 26 15:53:16 2008
@@ -29,7 +29,7 @@
   <name>Continuum Configuration</name>
   <build>
     <plugins>
-      <plugin>
+      <!--plugin>
         <groupId>org.codehaus.modello</groupId>
         <artifactId>modello-maven-plugin</artifactId>
         <executions>
@@ -42,22 +42,60 @@
           </execution>
         </executions>
         <configuration>
-          <version>1.1.0</version>
+          <version>1.2.0</version>
           <model>src/main/mdo/configuration.mdo</model>
         </configuration>
-      </plugin>
+      </plugin-->
       <plugin>
-        <groupId>org.codehaus.plexus</groupId>
-        <artifactId>plexus-maven-plugin</artifactId>
-        <executions>
-          <execution>
-            <id>generate</id>
-            <goals>
-              <goal>descriptor</goal>
-            </goals>
-          </execution>
-        </executions>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-surefire-plugin</artifactId>
+        <configuration>
+          <systemProperties>
+            <property>
+              <name>appserver.base</name>
+              <value>${project.build.directory}/test-classes/</value>    
+            </property>
+          </systemProperties>
+        </configuration>
       </plugin>
     </plugins>
   </build>
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.continuum</groupId>
+      <artifactId>continuum-api</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>commons-configuration</groupId>
+      <artifactId>commons-configuration</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>commons-lang</groupId>
+      <artifactId>commons-lang</artifactId>
+    </dependency>    
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>slf4j-api</artifactId>
+    </dependency>      
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>slf4j-log4j12</artifactId>
+      <scope>test</scope>
+    </dependency>   
+    <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>spring-core</artifactId>
+      <version>${spring.version}</version>
+    </dependency>       
+    <dependency>
+      <groupId>org.codehaus.plexus</groupId>
+      <artifactId>plexus-spring</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.continuum</groupId>
+      <artifactId>continuum-test</artifactId>
+      <scope>test</scope>
+    </dependency>        
+  </dependencies>
 </project>

Added: continuum/trunk/continuum-configuration/src/main/java/org/apache/continuum/configuration/DefaultContinuumConfiguration.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-configuration/src/main/java/org/apache/continuum/configuration/DefaultContinuumConfiguration.java?rev=672050&view=auto
==============================================================================
--- continuum/trunk/continuum-configuration/src/main/java/org/apache/continuum/configuration/DefaultContinuumConfiguration.java (added)
+++ continuum/trunk/continuum-configuration/src/main/java/org/apache/continuum/configuration/DefaultContinuumConfiguration.java Thu Jun 26 15:53:16 2008
@@ -0,0 +1,207 @@
+package org.apache.continuum.configuration;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.io.File;
+import java.io.IOException;
+
+import org.apache.commons.configuration.CombinedConfiguration;
+import org.apache.commons.configuration.Configuration;
+import org.apache.commons.configuration.DefaultConfigurationBuilder;
+import org.apache.commons.configuration.FileConfiguration;
+import org.apache.maven.continuum.configuration.ConfigurationException;
+import org.apache.maven.continuum.configuration.ContinuumConfiguration;
+import org.apache.maven.continuum.configuration.GeneralConfiguration;
+import org.apache.maven.continuum.configuration.ProxyConfiguration;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.core.io.ClassPathResource;
+
+/**
+ * @author <a href="mailto:olamy@apache.org">olamy</a>
+ * @since 17 juin 2008
+ * @version $Id$
+ */
+public class DefaultContinuumConfiguration
+    implements ContinuumConfiguration
+{
+
+    private Logger log = LoggerFactory.getLogger( getClass() );
+
+    private ClassPathResource classPathResource;
+    
+    private Configuration configuration;
+    
+    private GeneralConfiguration generalConfiguration;
+    
+    public static final String BASE_URL_KEY = "continuum.baseUrl";
+    
+    public static final String BUILDOUTPUT_DIR_KEY = "continuum.buildOutputDirectory";
+    
+    public static final String DEPLOYMENT_REPOSITORY_DIR_KEY = "continuum.deploymentRepositoryDirectory";
+    
+    public static final String WORKING_DIR_KEY = "continuum.workingDirectory";
+    
+    public static final String PROXY_HOST_KEY = "continuum.proxyHost";
+    
+    public static final String PROXY_PORT_KEY = "continuum.proxyPort";
+    
+    public static final String PROXY_USER_KEY = "continuum.proxyUser";
+    
+    public static final String PROXY_PASSWORD_KEY = "continuum.proxyPassword";
+
+
+    //----------------------------------------------------
+    //  Initialize method configured in the Spring xml 
+    //   configuration file
+    //----------------------------------------------------
+    protected void initialize()
+    {
+        if ( log.isDebugEnabled() )
+        {
+            log.debug( "classPathResource null " + ( classPathResource == null ) );
+        }
+
+        try
+        {
+            DefaultConfigurationBuilder defaultConfigurationBuilder = new DefaultConfigurationBuilder(classPathResource.getURL());
+            defaultConfigurationBuilder.load( classPathResource.getInputStream() );
+             
+            CombinedConfiguration combinedConfiguration = defaultConfigurationBuilder.getConfiguration( false );
+            configuration = combinedConfiguration.getConfiguration( "org.apache.continuum" );
+            
+            
+            this.generalConfiguration = new GeneralConfiguration();
+            this.generalConfiguration.setBaseUrl( configuration.getString( BASE_URL_KEY ) );
+            // TODO check if files exists ?
+            String buildOutputDirectory = configuration.getString( BUILDOUTPUT_DIR_KEY );
+            if ( buildOutputDirectory != null )
+            {
+                this.generalConfiguration.setBuildOutputDirectory( new File( buildOutputDirectory ) );
+            }
+            String deploymentRepositoryDirectory = configuration.getString( DEPLOYMENT_REPOSITORY_DIR_KEY );
+            if ( deploymentRepositoryDirectory != null )
+            {
+                this.generalConfiguration.setDeploymentRepositoryDirectory( new File( deploymentRepositoryDirectory ) );
+            }
+            String workingDirectory = configuration.getString( WORKING_DIR_KEY );
+            if ( workingDirectory != null )
+            {
+                this.generalConfiguration.setWorkingDirectory( new File( workingDirectory ) );
+            }
+            
+            this.generalConfiguration.setProxyConfiguration( new ProxyConfiguration() );
+            this.generalConfiguration.getProxyConfiguration().setProxyHost( configuration.getString( PROXY_HOST_KEY ) );
+            this.generalConfiguration.getProxyConfiguration().setProxyPort( configuration.getInt( PROXY_PORT_KEY, 0 ) );
+            this.generalConfiguration.getProxyConfiguration().setProxyUser( configuration.getString( PROXY_USER_KEY ) );
+            this.generalConfiguration.getProxyConfiguration().setProxyPassword(
+                                                                                configuration
+                                                                                    .getString( PROXY_PASSWORD_KEY ) );
+        }
+        catch ( org.apache.commons.configuration.ConfigurationException e )
+        {
+            log.error( e.getMessage(), e );
+            throw new RuntimeException( e.getMessage(), e );
+        }catch (IOException e)
+        {
+            log.error( e.getMessage(), e );
+            throw new RuntimeException( e.getMessage(), e );
+        }
+
+    }
+
+
+    public void reload()
+        throws ConfigurationException
+    {
+        this.initialize();
+    }
+
+    public void save()
+        throws ConfigurationException
+    {
+        FileConfiguration fileConfiguration = (FileConfiguration) configuration;
+        try
+        {
+            fileConfiguration.save();
+        }
+        catch ( org.apache.commons.configuration.ConfigurationException e )
+        {
+            throw new ConfigurationException( e.getMessage(), e );
+        }
+    }
+
+
+
+
+    /** 
+     * @see org.apache.maven.continuum.configuration.ContinuumConfiguration#getGeneralConfiguration()
+     */
+    public GeneralConfiguration getGeneralConfiguration()
+        throws ConfigurationException
+    {
+        return this.generalConfiguration;
+    }
+    
+    public void setGeneralConfiguration( GeneralConfiguration generalConfiguration )
+        throws ConfigurationException
+    {
+        this.generalConfiguration = generalConfiguration;
+        this.configuration.setProperty( BASE_URL_KEY, generalConfiguration.getBaseUrl() );
+        if ( generalConfiguration.getBuildOutputDirectory() != null )
+        {
+            this.configuration.setProperty( BUILDOUTPUT_DIR_KEY, generalConfiguration.getBuildOutputDirectory()
+                .getPath() );
+        }
+        if ( generalConfiguration.getDeploymentRepositoryDirectory() != null )
+        {
+            this.configuration.setProperty( DEPLOYMENT_REPOSITORY_DIR_KEY, generalConfiguration
+                .getDeploymentRepositoryDirectory().getPath() );
+        }
+        if ( generalConfiguration.getWorkingDirectory() != null )
+        {
+            this.configuration.setProperty( WORKING_DIR_KEY, generalConfiguration.getWorkingDirectory().getPath() );
+        }
+        ProxyConfiguration proxyConfiguration = this.generalConfiguration.getProxyConfiguration();
+        if ( proxyConfiguration != null )
+        {
+            this.configuration.setProperty( PROXY_HOST_KEY, proxyConfiguration.getProxyHost() );
+            this.configuration.setProperty( PROXY_PORT_KEY, proxyConfiguration.getProxyPort() );
+            this.configuration.setProperty( PROXY_USER_KEY, proxyConfiguration.getProxyUser() );
+            this.configuration.setProperty( PROXY_PASSWORD_KEY, proxyConfiguration.getProxyPassword() );
+        }
+    }
+
+    // ----------------------------------------
+    //  Spring injection
+    // ----------------------------------------
+    
+    public ClassPathResource getClassPathResource()
+    {
+        return classPathResource;
+    }
+
+
+    public void setClassPathResource( ClassPathResource classPathResource )
+    {
+        this.classPathResource = classPathResource;
+    }    
+    
+}

Propchange: continuum/trunk/continuum-configuration/src/main/java/org/apache/continuum/configuration/DefaultContinuumConfiguration.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: continuum/trunk/continuum-configuration/src/main/java/org/apache/continuum/configuration/DefaultContinuumConfiguration.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: continuum/trunk/continuum-configuration/src/main/java/org/apache/continuum/configuration/DefaultContinuumConfiguration.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Revision Id

Modified: continuum/trunk/continuum-configuration/src/main/mdo/configuration.mdo
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-configuration/src/main/mdo/configuration.mdo?rev=672050&r1=672049&r2=672050&view=diff
==============================================================================
--- continuum/trunk/continuum-configuration/src/main/mdo/configuration.mdo (original)
+++ continuum/trunk/continuum-configuration/src/main/mdo/configuration.mdo Thu Jun 26 15:53:16 2008
@@ -26,15 +26,57 @@
   <defaults>
     <default>
       <key>package</key>
-      <value>org.apache.maven.continuum.configuration</value>
+      <value>org.apache.continuum.configuration</value>
     </default>
   </defaults>
   <classes>
     <class rootElement="true" xml.tagName="configuration">
       <name>Configuration</name>
-      <version>1.1.0+</version>
+      <version>1.2.0+</version>
       <fields>
-        <!-- Reserved for future configuration -->
+        <field>
+          <name>generalConfiguration</name>
+          <version>1.2.0+</version>
+          <required>false</required>
+          <association>
+            <type>GeneralConfiguration</type>
+            <multiplicity>1</multiplicity>
+          </association>          
+        </field>
+      </fields>
+    </class>
+    <class>
+      <name>GeneralConfiguration</name>
+      <version>1.2.0+</version>
+      <fields>
+        <field>
+          <name>workingDirectory</name>
+          <type>String</type>
+          <required>false</required>
+          <version>1.2.0+</version>
+          <description>Directory where continuum will checkout projects.</description>
+        </field>      
+        <field>
+          <name>buildOutputDirectory</name>
+          <type>String</type>
+          <required>false</required>
+          <version>1.2.0+</version>
+          <description>Directory where continuum will build results projects (console output, junit results ..).</description>
+        </field> 
+        <field>
+          <name>deploymentRepositoryDirectory</name>
+          <type>String</type>
+          <required>false</required>
+          <version>1.2.0+</version>
+          <description>Directory where continuum will maven2 artifacts.</description>
+        </field> 
+        <field>
+          <name>baseUrl</name>
+          <type>String</type>
+          <required>false</required>
+          <version>1.2.0+</version>
+          <description>base url of the continuum instance.</description>
+        </field>                      
       </fields>
     </class>
   </classes>

Added: continuum/trunk/continuum-configuration/src/main/resources/META-INF/continuum/continuum-configuration.xml
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-configuration/src/main/resources/META-INF/continuum/continuum-configuration.xml?rev=672050&view=auto
==============================================================================
--- continuum/trunk/continuum-configuration/src/main/resources/META-INF/continuum/continuum-configuration.xml (added)
+++ continuum/trunk/continuum-configuration/src/main/resources/META-INF/continuum/continuum-configuration.xml Thu Jun 26 15:53:16 2008
@@ -0,0 +1,29 @@
+<?xml version="1.0"?>
+
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  -->
+
+<configuration>
+  <system/>
+  <jndi prefix="java:comp/env" config-optional="true"/>  
+  <xml fileName="${appserver.base}/conf/continuum.xml" config-optional="true"
+       config-forceCreate="true" config-name="org.apache.continuum"/>
+  <xml fileName="${user.home}/.m2/continuum.xml" config-optional="true"
+       config-forceCreate="true" config-name="org.apache.continuum.user"/>  
+</configuration>
\ No newline at end of file

Propchange: continuum/trunk/continuum-configuration/src/main/resources/META-INF/continuum/continuum-configuration.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: continuum/trunk/continuum-configuration/src/main/resources/META-INF/continuum/continuum-configuration.xml
------------------------------------------------------------------------------
    svn:executable = *

Propchange: continuum/trunk/continuum-configuration/src/main/resources/META-INF/continuum/continuum-configuration.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: continuum/trunk/continuum-configuration/src/main/resources/META-INF/spring-context.xml
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-configuration/src/main/resources/META-INF/spring-context.xml?rev=672050&view=auto
==============================================================================
--- continuum/trunk/continuum-configuration/src/main/resources/META-INF/spring-context.xml (added)
+++ continuum/trunk/continuum-configuration/src/main/resources/META-INF/spring-context.xml Thu Jun 26 15:53:16 2008
@@ -0,0 +1,30 @@
+<?xml version="1.0"?>
+
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  -->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+           http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
+
+  <bean id="continuumConfiguration" class="org.apache.continuum.configuration.DefaultContinuumConfiguration"
+        init-method="initialize">
+    <property name="classPathResource" value="classpath:META-INF/continuum/continuum-configuration.xml"/>
+  </bean>
+</beans>
\ No newline at end of file

Propchange: continuum/trunk/continuum-configuration/src/main/resources/META-INF/spring-context.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: continuum/trunk/continuum-configuration/src/main/resources/META-INF/spring-context.xml
------------------------------------------------------------------------------
    svn:executable = *

Propchange: continuum/trunk/continuum-configuration/src/main/resources/META-INF/spring-context.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: continuum/trunk/continuum-configuration/src/test/java/org/apache/continuum/configuration/TestDefaultContinuumConfiguration.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-configuration/src/test/java/org/apache/continuum/configuration/TestDefaultContinuumConfiguration.java?rev=672050&view=auto
==============================================================================
--- continuum/trunk/continuum-configuration/src/test/java/org/apache/continuum/configuration/TestDefaultContinuumConfiguration.java (added)
+++ continuum/trunk/continuum-configuration/src/test/java/org/apache/continuum/configuration/TestDefaultContinuumConfiguration.java Thu Jun 26 15:53:16 2008
@@ -0,0 +1,98 @@
+package org.apache.continuum.configuration;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.io.File;
+
+import org.apache.maven.continuum.configuration.ContinuumConfiguration;
+import org.apache.maven.continuum.configuration.GeneralConfiguration;
+import org.apache.maven.continuum.configuration.ProxyConfiguration;
+import org.codehaus.plexus.spring.PlexusInSpringTestCase;
+import org.codehaus.plexus.util.FileUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * @author <a href="mailto:olamy@apache.org">olamy</a>
+ * @since 17 juin 2008
+ * @version $Id$
+ */
+public class TestDefaultContinuumConfiguration
+    extends PlexusInSpringTestCase
+{
+
+    private Logger log = LoggerFactory.getLogger( getClass() );
+    
+    @Override
+    protected void setUp()
+        throws Exception
+    {
+        File originalConf = new File( getBasedir(), "src/test/resources/conf/continuum.xml" );
+
+        File confUsed = new File( getBasedir(), "target/test-classes/conf/continuum.xml" );
+        if ( confUsed.exists() )
+        {
+            confUsed.delete();
+        }
+        FileUtils.copyFile( originalConf, confUsed );
+        super.setUp();
+    }
+
+    public void testLoad()
+        throws Exception
+    {
+
+        
+        
+        
+        ContinuumConfiguration configuration = (ContinuumConfiguration) lookup( ContinuumConfiguration.class, "default" );
+        assertNotNull( configuration );
+        GeneralConfiguration generalConfiguration = configuration.getGeneralConfiguration();
+        assertNotNull( generalConfiguration );
+        assertNotNull( generalConfiguration.getBaseUrl() );
+        assertEquals( "http://test", generalConfiguration.getBaseUrl() );
+    }
+    
+    public void testDefaultConfiguration()
+        throws Exception
+    {
+        File conf = new File( getBasedir(), "target/test-classes/conf/continuum.xml" );
+        if ( conf.exists() )
+        {
+            conf.delete();
+        }
+        ContinuumConfiguration configuration = (ContinuumConfiguration) lookup( ContinuumConfiguration.class, "default" );
+        assertNotNull( configuration );
+        GeneralConfiguration generalConfiguration = new GeneralConfiguration();
+        generalConfiguration.setBaseUrl( "http://test/zloug" );
+        generalConfiguration.setProxyConfiguration( new ProxyConfiguration() );
+        generalConfiguration.getProxyConfiguration().setProxyHost( "localhost" );
+        generalConfiguration.getProxyConfiguration().setProxyPort( 8080 );
+        configuration.setGeneralConfiguration( generalConfiguration );
+        configuration.save();
+
+        configuration.reload();
+        assertEquals( "http://test/zloug", configuration.getGeneralConfiguration().getBaseUrl() );
+        assertEquals( "localhost", configuration.getGeneralConfiguration().getProxyConfiguration().getProxyHost() );
+        assertEquals( 8080, configuration.getGeneralConfiguration().getProxyConfiguration().getProxyPort() );
+        log.info( "generalConfiguration " + configuration.getGeneralConfiguration().toString() );
+    }
+   
+}

Propchange: continuum/trunk/continuum-configuration/src/test/java/org/apache/continuum/configuration/TestDefaultContinuumConfiguration.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: continuum/trunk/continuum-configuration/src/test/java/org/apache/continuum/configuration/TestDefaultContinuumConfiguration.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: continuum/trunk/continuum-configuration/src/test/java/org/apache/continuum/configuration/TestDefaultContinuumConfiguration.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Revision Id

Added: continuum/trunk/continuum-configuration/src/test/resources/conf/continuum.xml
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-configuration/src/test/resources/conf/continuum.xml?rev=672050&view=auto
==============================================================================
--- continuum/trunk/continuum-configuration/src/test/resources/conf/continuum.xml (added)
+++ continuum/trunk/continuum-configuration/src/test/resources/conf/continuum.xml Thu Jun 26 15:53:16 2008
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration>
+  <continuum>
+    <baseUrl>http://test</baseUrl>
+  </continuum>
+</configuration>
\ No newline at end of file

Propchange: continuum/trunk/continuum-configuration/src/test/resources/conf/continuum.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: continuum/trunk/continuum-configuration/src/test/resources/conf/continuum.xml
------------------------------------------------------------------------------
    svn:executable = *

Propchange: continuum/trunk/continuum-configuration/src/test/resources/conf/continuum.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: continuum/trunk/continuum-configuration/src/test/resources/log4j.xml
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-configuration/src/test/resources/log4j.xml?rev=672050&view=auto
==============================================================================
--- continuum/trunk/continuum-configuration/src/test/resources/log4j.xml (added)
+++ continuum/trunk/continuum-configuration/src/test/resources/log4j.xml Thu Jun 26 15:53:16 2008
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+<!-- ===================================================================== -->
+<!-- Log4j Configuration -->
+<!-- ===================================================================== -->
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"
+  debug="false">
+
+  <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
+    <param name="Target" value="System.out"/>
+    <layout class="org.apache.log4j.PatternLayout">
+      <param name="ConversionPattern" value="%d %-5p [%c{1}.%M](%L) %m%n"/>
+    </layout>
+  </appender>
+
+  <!-- quiet spring loading :-) -->
+  <category name="org.springframework">
+    <priority value="ERROR"/>
+  </category>
+  <category name="org.codehaus.plexus">
+    <priority value="ERROR"/>
+  </category>
+  <category name="org.apache.continuum.configuration">
+    <priority value="DEBUG"/>
+  </category>
+  
+  <category name="org.apache.commons">
+    <priority value="ERROR"/>
+  </category>    
+
+  <!-- JPOX -->
+  <category name="JPOX">
+    <priority value="WARN"/>
+  </category>
+  <category name="JPOX.RDBMS">
+    <priority value="ERROR"/>
+  </category>
+
+  <root>
+    <priority value="INFO"/>
+    <appender-ref ref="CONSOLE"/>
+  </root>
+
+</log4j:configuration>
\ No newline at end of file

Propchange: continuum/trunk/continuum-configuration/src/test/resources/log4j.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: continuum/trunk/continuum-configuration/src/test/resources/log4j.xml
------------------------------------------------------------------------------
    svn:executable = *

Propchange: continuum/trunk/continuum-configuration/src/test/resources/log4j.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Modified: continuum/trunk/continuum-core/pom.xml
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/pom.xml?rev=672050&r1=672049&r2=672050&view=diff
==============================================================================
--- continuum/trunk/continuum-core/pom.xml (original)
+++ continuum/trunk/continuum-core/pom.xml Thu Jun 26 15:53:16 2008
@@ -154,7 +154,6 @@
     <dependency>
       <groupId>org.apache.continuum</groupId>
       <artifactId>continuum-configuration</artifactId>
-      <scope>test</scope>
     </dependency>
     <dependency>
       <groupId>org.apache.maven.scm</groupId>
@@ -212,7 +211,12 @@
       <groupId>org.slf4j</groupId>
       <artifactId>slf4j-log4j12</artifactId>
       <scope>test</scope>
-    </dependency>          
+    </dependency>  
+    <dependency>
+      <groupId>commons-collections</groupId>
+      <artifactId>commons-collections</artifactId>
+      <scope>test</scope>
+    </dependency>            
   </dependencies>
   <build>
     <plugins>

Modified: continuum/trunk/continuum-core/src/test/resources/log4j.xml
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/test/resources/log4j.xml?rev=672050&r1=672049&r2=672050&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/test/resources/log4j.xml (original)
+++ continuum/trunk/continuum-core/src/test/resources/log4j.xml Thu Jun 26 15:53:16 2008
@@ -21,6 +21,10 @@
   <category name="org.codehaus.plexus">
     <priority value="ERROR"/>
   </category>
+  
+  <category name="org.apache.commons">
+    <priority value="ERROR"/>
+  </category>  
 
   <!-- JPOX -->
   <category name="JPOX">

Modified: continuum/trunk/continuum-webapp/pom.xml
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/pom.xml?rev=672050&r1=672049&r2=672050&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/pom.xml (original)
+++ continuum/trunk/continuum-webapp/pom.xml Thu Jun 26 15:53:16 2008
@@ -337,7 +337,6 @@
     <dependency>
       <groupId>commons-io</groupId>
       <artifactId>commons-io</artifactId>
-      <version>1.4</version>
     </dependency>
     <dependency>
       <groupId>commons-fileupload</groupId>
@@ -507,7 +506,6 @@
     <dependency>
       <groupId>commons-lang</groupId>
       <artifactId>commons-lang</artifactId>
-      <version>2.2</version>
     </dependency>
     <!-- 3.2 is required by plexus-registry -->
     <dependency>
@@ -528,6 +526,10 @@
       <artifactId>spring-web</artifactId>
     </dependency>
     <dependency>
+      <groupId>commons-configuration</groupId>
+      <artifactId>commons-configuration</artifactId>
+    </dependency>    
+    <dependency>
       <groupId>javax.mail</groupId>
       <artifactId>mail</artifactId>
       <version>1.4</version>

Modified: continuum/trunk/pom.xml
URL: http://svn.apache.org/viewvc/continuum/trunk/pom.xml?rev=672050&r1=672049&r2=672050&view=diff
==============================================================================
--- continuum/trunk/pom.xml (original)
+++ continuum/trunk/pom.xml Thu Jun 26 15:53:16 2008
@@ -113,7 +113,7 @@
         <plugin>
           <groupId>org.codehaus.modello</groupId>
           <artifactId>modello-maven-plugin</artifactId>
-          <version>1.0-alpha-15</version>
+          <version>1.0-alpha-18</version>
         </plugin>
       </plugins>
     </pluginManagement>
@@ -744,6 +744,26 @@
           </exclusion>
         </exclusions>
       </dependency>
+      <dependency>
+        <groupId>commons-configuration</groupId>
+        <artifactId>commons-configuration</artifactId>
+        <version>1.5</version>
+      </dependency>
+      <dependency>
+        <groupId>commons-lang</groupId>
+        <artifactId>commons-lang</artifactId>
+        <version>2.4</version>
+      </dependency>      
+      <dependency>
+        <groupId>commons-collections</groupId>
+        <artifactId>commons-collections</artifactId>
+        <version>3.2.1</version>
+      </dependency>      
+      <dependency>
+        <groupId>commons-io</groupId>
+        <artifactId>commons-io</artifactId>
+        <version>1.4</version>
+      </dependency>      
       <!--
         Plexus Redback Dependencies
         -->



Mime
View raw message