You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by jv...@apache.org on 2005/04/11 04:22:18 UTC
svn commit: r160813 [5/10] - in maven/continuum: ./ continuum-core/
continuum-core/src/ continuum-core/src/main/ continuum-core/src/main/java/
continuum-core/src/main/java/org/ continuum-core/src/main/java/org/apache/
continuum-core/src/main/java/org/apache/maven/
continuum-core/src/main/java/org/apache/maven/continuum/
continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/
continuum-core/src/main/java/org/apache/maven/continuum/builder/
continuum-core/src/main/java/org/apache/maven/continuum/builder/ant/
continuum-core/src/main/java/org/apache/maven/continuum/builder/manager/
continuum-core/src/main/java/org/apache/maven/continuum/builder/maven/
continuum-core/src/main/java/org/apache/maven/continuum/builder/maven/m1/
continuum-core/src/main/java/org/apache/maven/continuum/builder/maven/m2/
continuum-core/src/main/java/org/apache/maven/continuum/builder/shell/
continuum-core/src/main/java/org/apache/maven/continuum/buildqueue/
continuum-core/src/main/java/org/apache/maven/continuum/buildqueue/evaluator/
continuum-core/src/main/java/org/apache/maven/continuum/network/
continuum-core/src/main/java/org/apache/maven/continuum/notification/
continuum-core/src/main/java/org/apache/maven/continuum/notification/console/
continuum-core/src/main/java/org/apache/maven/continuum/notification/mail/
continuum-core/src/main/java/org/apache/maven/continuum/project/
continuum-core/src/main/java/org/apache/maven/continuum/registration/
continuum-core/src/main/java/org/apache/maven/continuum/registration/socket/
continuum-core/src/main/java/org/apache/maven/continuum/scm/
continuum-core/src/main/java/org/apache/maven/continuum/socket/
continuum-core/src/main/java/org/apache/maven/continuum/store/
continuum-core/src/main/java/org/apache/maven/continuum/trigger/
continuum-core/src/main/java/org/apache/maven/continuum/trigger/alarmclock/
continuum-core/src/main/java/org/apache/maven/continuum/trigger/socket/
continuum-core/src/main/java/org/apache/maven/continuum/utils/
continuum-core/src/main/resources/
continuum-core/src/main/resources/META-INF/
continuum-core/src/main/resources/META-INF/plexus/
continuum-core/src/main/resources/org/
continuum-core/src/main/resources/org/apache/
continuum-core/src/main/resources/org/apache/maven/
continuum-core/src/main/resources/org/apache/maven/continuum/
continuum-core/src/main/resources/org/apache/maven/continuum/notification/
continuum-core/src/main/resources/org/apache/maven/continuum/notification/mail/
continuum-core/src/main/resources/org/apache/maven/continuum/notification/mail/templates/
continuum-core/src/main/resources/org/apache/maven/continuum/notification/mail/templates/ant/
continuum-core/src/main/resources/org/apache/maven/continuum/notification/mail/templates/maven-1/
continuum-core/src/main/resources/org/apache/maven/continuum/notification/mail/templates/maven2/
continuum-core/src/main/resources/org/apache/maven/continuum/notification/mail/templates/shell/
continuum-core/src/test-file-storage/
continuum-core/src/test-file-storage/inamo/
continuum-core/src/test-file-storage/plexus/ continuum-core/src/test-input/
continuum-core/src/test-input/src/ continuum-core/src/test-input/src/main/
continuum-core/src/test-input/src/main/java/
continuum-core/src/test-projects/ continuum-core/src/test-projects/project1/
continuum-core/src/test-projects/project1/src/
continuum-core/src/test-projects/project1/src/main/
continuum-core/src/test-projects/project1/src/main/java/
continuum-core/src/test-projects/project1/src/main/java/org/
continuum-core/src/test-projects/project1/src/main/java/org/codehaus/
continuum-core/src/test-projects/project1/src/main/java/org/codehaus/continuum/
continuum-core/src/test-projects/project1/src/main/java/org/codehaus/continuum/project1/
continuum-core/src/test-projects/project2/
continuum-core/src/test-projects/project2/src/
continuum-core/src/test-projects/project2/src/main/
continuum-core/src/test-projects/project2/src/main/java/
continuum-core/src/test-projects/project2/src/main/java/org/
continuum-core/src/test-projects/project2/src/main/java/org/codehaus/
continuum-core/src/test-projects/project2/src/main/java/org/codehaus/continuum/
continuum-core/src/test-projects/project2/src/main/java/org/codehaus/continuum/project2/
continuum-core/src/test/ continuum-core/src/test/java/
continuum-core/src/test/java/org/ continuum-core/src/test/java/org/apache/
continuum-core/src/test/java/org/apache/maven/
continuum-core/src/test/java/org/apache/maven/continuum/
continuum-core/src/test/java/org/apache/maven/continuum/builder/
continuum-core/src/test/java/org/apache/maven/continuum/builder/maven/
continuum-core/src/test/java/org/apache/maven/continuum/builder/maven/m1/
continuum-core/src/test/java/org/apache/maven/continuum/builder/maven/m2/
continuum-core/src/test/java/org/apache/maven/continuum/buildqueue/
continuum-core/src/test/java/org/apache/maven/continuum/network/
continuum-core/src/test/java/org/apache/maven/continuum/notification/
continuum-core/src/test/java/org/apache/maven/continuum/notification/mail/
continuum-core/src/test/java/org/apache/maven/continuum/scm/
continuum-core/src/test/java/org/apache/maven/continuum/store/
continuum-core/src/test/repository/
continuum-core/src/test/repository/console-notifier/
continuum-core/src/test/resources/ continuum-core/src/test/resources/org/
continuum-core/src/test/resources/org/apache/
continuum-core/src/test/resources/org/apache/maven/
continuum-core/src/test/resources/org/apache/maven/continuum/
continuum-core/src/test/resources/org/apache/maven/continuum/buildqueue/
continuum-core/src/test/resources/org/apache/maven/continuum/network/
continuum-core/src/test/resources/org/apache/maven/continuum/notification/
continuum-core/src/test/resources/org/apache/maven/continuum/notification/mail/
continuum-core/src/test/resources/org/apache/maven/continuum/store/
continuum-core/src/test/resources/projects/ continuum-model/
continuum-model/src/ continuum-model/src/main/
continuum-model/src/main/resources/ continuum-plexus-application/
continuum-plexus-application/src/ continuum-plexus-application/src/assembly/
continuum-plexus-application/src/conf/ continuum-plexus-application/src/test/
continuum-plexus-application/src/test/conf/ continuum-runtime/
continuum-runtime/src/ continuum-runtime/src/conf/ continuum-site/
continuum-site/src/ continuum-site/src/site/ continuum-site/src/site/apt/
continuum-site/src/site/apt/developer-info/
continuum-site/src/site/apt/releases/
continuum-site/src/site/apt/releases/1-0-alpha-1/
continuum-site/src/site/xdoc/ continuum-web/ continuum-web/src/
continuum-web/src/main/ continuum-web/src/main/java/
continuum-web/src/main/java/org/ continuum-web/src/main/java/org/codehaus/
continuum-web/src/main/java/org/codehaus/continuum/
continuum-web/src/main/java/org/codehaus/continuum/web/
continuum-web/src/main/java/org/codehaus/continuum/web/action/
continuum-web/src/main/java/org/codehaus/continuum/web/context/
continuum-web/src/main/java/org/codehaus/continuum/web/pipeline/
continuum-web/src/main/java/org/codehaus/continuum/web/pipeline/valve/
continuum-web/src/main/java/org/codehaus/continuum/web/tool/
continuum-web/src/main/java/org/codehaus/continuum/web/validation/
continuum-web/src/main/resources/ continuum-web/src/main/resources/META-INF/
continuum-web/src/main/resources/META-INF/plexus/
continuum-web/src/main/resources/WEB-INF/
continuum-web/src/main/resources/css/ continuum-web/src/main/resources/forms/
continuum-web/src/main/resources/images/
continuum-web/src/main/resources/localization/
continuum-web/src/main/resources/scripts/
continuum-web/src/main/resources/templates/
continuum-web/src/main/resources/templates/layouts/
continuum-web/src/main/resources/templates/navigations/
continuum-web/src/main/resources/templates/screens/ continuum-xmlrpc/
continuum-xmlrpc/src/ continuum-xmlrpc/src/main/
continuum-xmlrpc/src/main/java/ continuum-xmlrpc/src/main/java/org/
continuum-xmlrpc/src/main/java/org/apache/
continuum-xmlrpc/src/main/java/org/apache/maven/
continuum-xmlrpc/src/main/java/org/apache/maven/continuum/
continuum-xmlrpc/src/main/java/org/apache/maven/continuum/xmlrpc/
continuum-xmlrpc/src/main/resources/
continuum-xmlrpc/src/main/resources/META-INF/
continuum-xmlrpc/src/main/resources/META-INF/plexus/
continuum-xmlrpc/src/test/ continuum-xmlrpc/src/test/java/
continuum-xmlrpc/src/test/java/org/
continuum-xmlrpc/src/test/java/org/apache/
continuum-xmlrpc/src/test/java/org/apache/maven/
continuum-xmlrpc/src/test/java/org/apache/maven/continuum/
continuum-xmlrpc/src/test/java/org/apache/maven/continuum/xmlrpc/
Added: maven/continuum/continuum-core/src/main/java/org/apache/maven/continuum/registration/ContinuumRegistrar.java
URL: http://svn.apache.org/viewcvs/maven/continuum/continuum-core/src/main/java/org/apache/maven/continuum/registration/ContinuumRegistrar.java?view=auto&rev=160813
==============================================================================
--- maven/continuum/continuum-core/src/main/java/org/apache/maven/continuum/registration/ContinuumRegistrar.java (added)
+++ maven/continuum/continuum-core/src/main/java/org/apache/maven/continuum/registration/ContinuumRegistrar.java Sun Apr 10 19:21:34 2005
@@ -0,0 +1,26 @@
+package org.apache.maven.continuum.registration;
+
+/*
+ * Copyright 2004-2005 The Apache Software Foundation.
+ *
+ * Licensed 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:jason@maven.org">Jason van Zyl</a>
+ * @version $Id: ContinuumRegistrar.java,v 1.1.1.1 2005/03/29 20:42:02 trygvis Exp $
+ */
+public interface ContinuumRegistrar
+{
+ static String ROLE = ContinuumRegistrar.class.getName();
+}
Added: maven/continuum/continuum-core/src/main/java/org/apache/maven/continuum/registration/socket/UrlSocketRegistrar.java
URL: http://svn.apache.org/viewcvs/maven/continuum/continuum-core/src/main/java/org/apache/maven/continuum/registration/socket/UrlSocketRegistrar.java?view=auto&rev=160813
==============================================================================
--- maven/continuum/continuum-core/src/main/java/org/apache/maven/continuum/registration/socket/UrlSocketRegistrar.java (added)
+++ maven/continuum/continuum-core/src/main/java/org/apache/maven/continuum/registration/socket/UrlSocketRegistrar.java Sun Apr 10 19:21:34 2005
@@ -0,0 +1,69 @@
+package org.apache.maven.continuum.registration.socket;
+
+/*
+ * Copyright 2004-2005 The Apache Software Foundation.
+ *
+ * Licensed 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.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.URL;
+
+import org.apache.maven.continuum.network.ConnectionConsumer;
+import org.apache.maven.continuum.registration.AbstractContinuumRegistrar;
+import org.apache.maven.continuum.socket.SimpleSocket;
+import org.apache.maven.continuum.utils.ContinuumUtils;
+
+/**
+ * @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
+ * @version $Id: UrlSocketRegistrar.java,v 1.1.1.1 2005/03/29 20:42:02 trygvis Exp $
+ */
+public class UrlSocketRegistrar
+ extends AbstractContinuumRegistrar
+ implements ConnectionConsumer
+{
+ // ----------------------------------------------------------------------
+ // ConnectionConsumer Implementation
+ // ----------------------------------------------------------------------
+
+ public void consumeConnection( InputStream input, OutputStream output )
+ throws IOException
+ {
+ SimpleSocket socket = new SimpleSocket( input, output );
+
+ try
+ {
+ String url = socket.readLine();
+
+ URL u = new URL( url );
+
+ String projectId = getContinuum().addProjectFromUrl( u, "maven2" );
+
+ socket.writeLine( "OK" );
+
+ socket.writeLine( "id=" + projectId );
+ }
+ catch( Exception ex )
+ {
+ socket.writeLine( "ERROR" );
+
+ String stackTrace = ContinuumUtils.getExceptionStackTrace( ex );
+
+ socket.writeLine( "Exception while adding the project." );
+
+ socket.writeLine( stackTrace );
+ }
+ }
+}
Added: maven/continuum/continuum-core/src/main/java/org/apache/maven/continuum/scm/ContinuumScm.java
URL: http://svn.apache.org/viewcvs/maven/continuum/continuum-core/src/main/java/org/apache/maven/continuum/scm/ContinuumScm.java?view=auto&rev=160813
==============================================================================
--- maven/continuum/continuum-core/src/main/java/org/apache/maven/continuum/scm/ContinuumScm.java (added)
+++ maven/continuum/continuum-core/src/main/java/org/apache/maven/continuum/scm/ContinuumScm.java Sun Apr 10 19:21:34 2005
@@ -0,0 +1,40 @@
+package org.apache.maven.continuum.scm;
+
+/*
+ * Copyright 2004-2005 The Apache Software Foundation.
+ *
+ * Licensed 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.project.ContinuumProject;
+import org.apache.maven.scm.command.update.UpdateScmResult;
+
+/**
+ * @author <a href="mailto:trygvis@inamo.no">Trygve Laugstøl</a>
+ * @version $Id: ContinuumScm.java,v 1.2 2005/03/31 00:01:44 trygvis Exp $
+ */
+public interface ContinuumScm
+{
+ String ROLE = ContinuumScm.class.getName();
+
+ void checkOut( ContinuumProject project, File workingDirectory )
+ throws ContinuumScmException;
+
+ void checkOutProject( ContinuumProject project )
+ throws ContinuumScmException;
+
+ UpdateScmResult updateProject( ContinuumProject project )
+ throws ContinuumScmException;
+}
Added: maven/continuum/continuum-core/src/main/java/org/apache/maven/continuum/scm/ContinuumScmException.java
URL: http://svn.apache.org/viewcvs/maven/continuum/continuum-core/src/main/java/org/apache/maven/continuum/scm/ContinuumScmException.java?view=auto&rev=160813
==============================================================================
--- maven/continuum/continuum-core/src/main/java/org/apache/maven/continuum/scm/ContinuumScmException.java (added)
+++ maven/continuum/continuum-core/src/main/java/org/apache/maven/continuum/scm/ContinuumScmException.java Sun Apr 10 19:21:34 2005
@@ -0,0 +1,51 @@
+package org.apache.maven.continuum.scm;
+
+/*
+ * Copyright 2004-2005 The Apache Software Foundation.
+ *
+ * Licensed 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 org.apache.maven.scm.ScmResult;
+
+/**
+ * @author <a href="mailto:trygvis@inamo.no">Trygve Laugstøl</a>
+ * @version $Id: ContinuumScmException.java,v 1.1.1.1 2005/03/29 20:42:02 trygvis Exp $
+ */
+public class ContinuumScmException
+ extends Exception
+{
+ private ScmResult result;
+
+ public ContinuumScmException( String message )
+ {
+ super( message );
+ }
+
+ public ContinuumScmException( String message, Throwable cause )
+ {
+ super( message, cause );
+ }
+
+ public ContinuumScmException( String message, ScmResult result )
+ {
+ super( message );
+
+ this.result = result;
+ }
+
+ public ScmResult getResult()
+ {
+ return result;
+ }
+}
Added: maven/continuum/continuum-core/src/main/java/org/apache/maven/continuum/scm/DefaultContinuumScm.java
URL: http://svn.apache.org/viewcvs/maven/continuum/continuum-core/src/main/java/org/apache/maven/continuum/scm/DefaultContinuumScm.java?view=auto&rev=160813
==============================================================================
--- maven/continuum/continuum-core/src/main/java/org/apache/maven/continuum/scm/DefaultContinuumScm.java (added)
+++ maven/continuum/continuum-core/src/main/java/org/apache/maven/continuum/scm/DefaultContinuumScm.java Sun Apr 10 19:21:34 2005
@@ -0,0 +1,166 @@
+package org.apache.maven.continuum.scm;
+
+/*
+ * Copyright 2004-2005 The Apache Software Foundation.
+ *
+ * Licensed 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.project.ContinuumProject;
+import org.apache.maven.scm.ScmException;
+import org.apache.maven.scm.ScmFileSet;
+import org.apache.maven.scm.command.checkout.CheckOutScmResult;
+import org.apache.maven.scm.command.update.UpdateScmResult;
+import org.apache.maven.scm.manager.ScmManager;
+import org.apache.maven.scm.repository.ScmRepository;
+import org.apache.maven.scm.repository.ScmRepositoryException;
+
+import org.codehaus.plexus.logging.AbstractLogEnabled;
+
+/**
+ * @author <a href="mailto:trygvis@inamo.no">Trygve Laugstøl</a>
+ * @version $Id: DefaultContinuumScm.java,v 1.2 2005/03/31 00:01:44 trygvis Exp $
+ */
+public class DefaultContinuumScm
+ extends AbstractLogEnabled
+ implements ContinuumScm
+{
+ /** @requirement */
+ private ScmManager scmManager;
+
+ // ----------------------------------------------------------------------
+ // ContinuumScm implementation
+ // ----------------------------------------------------------------------
+
+ public void checkOut( ContinuumProject project, File workingDirectory )
+ throws ContinuumScmException
+ {
+ try
+ {
+ getLogger().info( "Checking out project: '" + project.getName() + "', " +
+ "id: '" + project.getId() + "' " +
+ "to '" + workingDirectory + "'." );
+
+ ScmRepository repository = scmManager.makeScmRepository( project.getScmUrl() );
+
+ CheckOutScmResult result;
+
+ synchronized ( this )
+ {
+ if ( !workingDirectory.exists() )
+ {
+ if ( !workingDirectory.mkdirs() )
+ {
+ throw new ContinuumScmException( "Could not make directory: " + workingDirectory.getAbsolutePath() );
+ }
+ }
+
+ String tag = null;
+
+ ScmFileSet fileSet = new ScmFileSet( workingDirectory );
+
+ result = scmManager.checkOut( repository, fileSet, tag );
+ }
+
+ if ( !result.isSuccess() )
+ {
+ getLogger().warn( "Error while checking out the code for project: '" + project.getName() + "', id: '" + project.getId() + "' to '" + workingDirectory.getAbsolutePath() + "'." );
+
+ getLogger().warn( "Command output: " + result.getCommandOutput() );
+
+ getLogger().warn( "Provider message: " + result.getProviderMessage());
+
+ throw new ContinuumScmException( "Error while checking out the project.", result );
+ }
+ }
+ catch ( ScmRepositoryException e )
+ {
+ throw new ContinuumScmException( "Cannot checkout sources.", e );
+ }
+ catch ( ScmException e )
+ {
+ throw new ContinuumScmException( "Cannot checkout sources.", e );
+ }
+ }
+
+ /**
+ * Checks out the sources to the specified directory.
+ *
+ * @param project The project to check out.
+ * @throws ContinuumScmException Thrown in case of a exception while checking out the sources.
+ */
+ public void checkOutProject( ContinuumProject project )
+ throws ContinuumScmException
+ {
+ String workingDirectory = project.getWorkingDirectory();
+
+ if ( workingDirectory == null )
+ {
+ throw new ContinuumScmException( "The working directory for the project has to be set. Project: '" + project.getName() + "', id: '" + project.getId() + "'.");
+ }
+
+ checkOut( project, new File( workingDirectory ) );
+ }
+
+ public UpdateScmResult updateProject( ContinuumProject project )
+ throws ContinuumScmException
+ {
+ try
+ {
+ getLogger().info( "Updating project: id: '" + project.getId() + "', name '" + project.getName() + "'." );
+
+ File workingDirectory = new File( project.getWorkingDirectory() );
+
+ if ( !workingDirectory.exists() )
+ {
+ throw new ContinuumScmException( "The working directory for the project doesn't exist (" + project.getWorkingDirectory() + ")." );
+ }
+
+ ScmRepository repository = scmManager.makeScmRepository( project.getScmUrl() );
+
+ String tag = null;
+
+ UpdateScmResult result;
+
+ ScmFileSet fileSet = new ScmFileSet( workingDirectory );
+
+ synchronized ( this )
+ {
+ result = scmManager.update( repository, fileSet, tag );
+ }
+
+ if ( !result.isSuccess() )
+ {
+ getLogger().warn( "Error while updating the code for project: '" + project.getName() + "', id: '" + project.getId() + "' to '" + workingDirectory.getAbsolutePath() + "'." );
+
+ getLogger().warn( "Command output: " + result.getCommandOutput() );
+
+ getLogger().warn( "Provider message: " + result.getProviderMessage() );
+
+ throw new ContinuumScmException( "Error while checking out the project.", result );
+ }
+
+ return result;
+ }
+ catch ( ScmRepositoryException ex )
+ {
+ throw new ContinuumScmException( "Error while update sources.", ex );
+ }
+ catch ( ScmException ex )
+ {
+ throw new ContinuumScmException( "Error while update sources.", ex );
+ }
+ }
+}
Added: maven/continuum/continuum-core/src/main/java/org/apache/maven/continuum/socket/SimpleSocket.java
URL: http://svn.apache.org/viewcvs/maven/continuum/continuum-core/src/main/java/org/apache/maven/continuum/socket/SimpleSocket.java?view=auto&rev=160813
==============================================================================
--- maven/continuum/continuum-core/src/main/java/org/apache/maven/continuum/socket/SimpleSocket.java (added)
+++ maven/continuum/continuum-core/src/main/java/org/apache/maven/continuum/socket/SimpleSocket.java Sun Apr 10 19:21:34 2005
@@ -0,0 +1,126 @@
+package org.apache.maven.continuum.socket;
+
+/*
+ * Copyright 2004-2005 The Apache Software Foundation.
+ *
+ * Licensed 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.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.OutputStream;
+import java.io.OutputStreamWriter;
+import java.io.PrintWriter;
+import java.net.Socket;
+import java.net.UnknownHostException;
+
+import org.codehaus.plexus.util.IOUtil;
+
+/**
+ * @author <a href="mailto:trygvis@inamo.no">Trygve Laugstøl</a>
+ * @version $Id: SimpleSocket.java,v 1.1.1.1 2005/03/29 20:42:02 trygvis Exp $
+ */
+public class SimpleSocket
+{
+ private Socket socket;
+
+ private InputStream input;
+
+ private BufferedReader reader;
+
+ private OutputStream output;
+
+ private PrintWriter writer;
+
+ public SimpleSocket( String host, int port )
+ throws UnknownHostException, IOException
+ {
+ socket = new Socket( host, port );
+
+ setup( socket.getInputStream(), socket.getOutputStream() );
+ }
+
+ public SimpleSocket( InputStream input, OutputStream output )
+ throws IOException
+ {
+ if ( input == null )
+ {
+ throw new IllegalArgumentException( "input cannot be null" );
+ }
+
+ if ( output == null )
+ {
+ throw new IllegalArgumentException( "output cannot be null" );
+ }
+
+ setup( input, output );
+ }
+
+ // ----------------------------------------------------------------------
+ //
+ // ----------------------------------------------------------------------
+
+ public String readLine()
+ throws IOException
+ {
+ return reader.readLine();
+ }
+
+ public void writeLine( String line )
+ throws IOException
+ {
+ writer.println( line );
+
+ writer.flush();
+
+ output.flush();
+ }
+
+ public void close()
+ {
+ IOUtil.close( reader );
+ IOUtil.close( writer );
+ IOUtil.close( input );
+ IOUtil.close( output );
+
+ if ( socket != null )
+ {
+ try
+ {
+ socket.close();
+ }
+ catch ( IOException e )
+ {
+ // ignore
+ }
+ }
+ }
+
+ // ----------------------------------------------------------------------
+ //
+ // ----------------------------------------------------------------------
+
+ private void setup( InputStream input, OutputStream output )
+ throws IOException
+ {
+ this.input = input;
+
+ this.output = output;
+
+ reader = new BufferedReader( new InputStreamReader( input ) );
+
+ writer = new PrintWriter( new OutputStreamWriter( output ) );
+ }
+}
Added: maven/continuum/continuum-core/src/main/java/org/apache/maven/continuum/store/AbstractContinuumStore.java
URL: http://svn.apache.org/viewcvs/maven/continuum/continuum-core/src/main/java/org/apache/maven/continuum/store/AbstractContinuumStore.java?view=auto&rev=160813
==============================================================================
--- maven/continuum/continuum-core/src/main/java/org/apache/maven/continuum/store/AbstractContinuumStore.java (added)
+++ maven/continuum/continuum-core/src/main/java/org/apache/maven/continuum/store/AbstractContinuumStore.java Sun Apr 10 19:21:34 2005
@@ -0,0 +1,49 @@
+package org.apache.maven.continuum.store;
+
+/*
+ * Copyright 2004-2005 The Apache Software Foundation.
+ *
+ * Licensed 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.PrintWriter;
+import java.io.StringWriter;
+
+import org.codehaus.plexus.logging.AbstractLogEnabled;
+
+/**
+ * @author <a href="mailto:trygvis@inamo.no">Trygve Laugstøl</a>
+ * @version $Id: AbstractContinuumStore.java,v 1.1.1.1 2005/03/29 20:42:02 trygvis Exp $
+ */
+public abstract class AbstractContinuumStore
+ extends AbstractLogEnabled
+ implements ContinuumStore
+{
+ public static String throwableToString( Throwable error )
+ {
+ if ( error == null )
+ {
+ return "";
+ }
+
+ StringWriter writer = new StringWriter();
+
+ PrintWriter printer = new PrintWriter( writer );
+
+ error.printStackTrace( printer );
+
+ printer.flush();
+
+ return writer.getBuffer().toString();
+ }
+ }
Added: maven/continuum/continuum-core/src/main/java/org/apache/maven/continuum/store/ContinuumStore.java
URL: http://svn.apache.org/viewcvs/maven/continuum/continuum-core/src/main/java/org/apache/maven/continuum/store/ContinuumStore.java?view=auto&rev=160813
==============================================================================
--- maven/continuum/continuum-core/src/main/java/org/apache/maven/continuum/store/ContinuumStore.java (added)
+++ maven/continuum/continuum-core/src/main/java/org/apache/maven/continuum/store/ContinuumStore.java Sun Apr 10 19:21:34 2005
@@ -0,0 +1,96 @@
+package org.apache.maven.continuum.store;
+
+/*
+ * Copyright 2004-2005 The Apache Software Foundation.
+ *
+ * Licensed 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.util.Iterator;
+import java.util.Properties;
+
+import org.apache.maven.continuum.project.ContinuumBuild;
+import org.apache.maven.continuum.project.ContinuumBuildResult;
+import org.apache.maven.continuum.project.ContinuumProject;
+
+/**
+ * @author <a href="mailto:trygvis@inamo.no">Trygve Laugstøl</a>
+ * @version $Id: ContinuumStore.java,v 1.2 2005/04/03 21:31:33 trygvis Exp $
+ */
+public interface ContinuumStore
+{
+ String ROLE = ContinuumStore.class.getName();
+
+ // ----------------------------------------------------------------------
+ // Database methods
+ // ----------------------------------------------------------------------
+
+ void createDatabase()
+ throws ContinuumStoreException;
+
+ void deleteDatabase()
+ throws ContinuumStoreException;
+
+ // ----------------------------------------------------------------------
+ // ContinuumProject
+ // ----------------------------------------------------------------------
+
+ String addProject( String name, String scmUrl, String nagEmailAddress, String version, String builderId, String workingDirectory, Properties properties )
+ throws ContinuumStoreException;
+
+ void removeProject( String projectId )
+ throws ContinuumStoreException;
+
+ void setWorkingDirectory( String projectId, String workingDirectory )
+ throws ContinuumStoreException;
+
+ void updateProject( String projectId, String name, String scmUrl, String nagEmailAddress, String version )
+ throws ContinuumStoreException;
+
+ void updateProjectConfiguration( String projectId, Properties configuration )
+ throws ContinuumStoreException;
+
+ Iterator getAllProjects()
+ throws ContinuumStoreException;
+
+ Iterator findProjectsByName( String nameSearchPattern )
+ throws ContinuumStoreException;
+
+ ContinuumProject getProject( String projectId )
+ throws ContinuumStoreException;
+
+ ContinuumProject getProjectByBuild( String buildId )
+ throws ContinuumStoreException;
+
+ // ----------------------------------------------------------------------
+ // Build
+ // ----------------------------------------------------------------------
+
+ String createBuild( String projectId )
+ throws ContinuumStoreException;
+
+ void setBuildResult( String buildId, int state, ContinuumBuildResult result, Throwable error )
+ throws ContinuumStoreException;
+
+ ContinuumBuild getBuild( String buildId )
+ throws ContinuumStoreException;
+
+ ContinuumBuild getLatestBuildForProject( String projectId )
+ throws ContinuumStoreException;
+
+ Iterator getBuildsForProject( String projectId, int start, int end )
+ throws ContinuumStoreException;
+
+ ContinuumBuildResult getBuildResultForBuild( String buildId )
+ throws ContinuumStoreException;
+}
Added: maven/continuum/continuum-core/src/main/java/org/apache/maven/continuum/store/ContinuumStoreException.java
URL: http://svn.apache.org/viewcvs/maven/continuum/continuum-core/src/main/java/org/apache/maven/continuum/store/ContinuumStoreException.java?view=auto&rev=160813
==============================================================================
--- maven/continuum/continuum-core/src/main/java/org/apache/maven/continuum/store/ContinuumStoreException.java (added)
+++ maven/continuum/continuum-core/src/main/java/org/apache/maven/continuum/store/ContinuumStoreException.java Sun Apr 10 19:21:34 2005
@@ -0,0 +1,34 @@
+package org.apache.maven.continuum.store;
+
+/*
+ * Copyright 2004-2005 The Apache Software Foundation.
+ *
+ * Licensed 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:trygvis@inamo.no">Trygve Laugstøl</a>
+ * @version $Id: ContinuumStoreException.java,v 1.1.1.1 2005/03/29 20:42:02 trygvis Exp $
+ */
+public class ContinuumStoreException extends Exception
+{
+ public ContinuumStoreException( String msg )
+ {
+ super( msg );
+ }
+
+ public ContinuumStoreException( String msg, Exception ex )
+ {
+ super( msg, ex );
+ }
+}
Added: maven/continuum/continuum-core/src/main/java/org/apache/maven/continuum/store/ModelloJPoxContinuumStore.java
URL: http://svn.apache.org/viewcvs/maven/continuum/continuum-core/src/main/java/org/apache/maven/continuum/store/ModelloJPoxContinuumStore.java?view=auto&rev=160813
==============================================================================
--- maven/continuum/continuum-core/src/main/java/org/apache/maven/continuum/store/ModelloJPoxContinuumStore.java (added)
+++ maven/continuum/continuum-core/src/main/java/org/apache/maven/continuum/store/ModelloJPoxContinuumStore.java Sun Apr 10 19:21:34 2005
@@ -0,0 +1,449 @@
+package org.apache.maven.continuum.store;
+
+/*
+ * Copyright 2004-2005 The Apache Software Foundation.
+ *
+ * Licensed 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.util.ArrayList;
+import java.util.Collection;
+import java.util.Date;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Properties;
+
+import javax.jdo.JDOHelper;
+
+import org.apache.maven.continuum.project.ContinuumBuild;
+import org.apache.maven.continuum.project.ContinuumBuildResult;
+import org.apache.maven.continuum.project.ContinuumJPoxStore;
+import org.apache.maven.continuum.project.ContinuumProject;
+import org.apache.maven.continuum.project.ContinuumProjectState;
+
+import org.codehaus.plexus.jdo.JdoFactory;
+import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable;
+
+/**
+ * @author <a href="mailto:trygvis@inamo.no">Trygve Laugstøl</a>
+ * @version $Id: ModelloJPoxContinuumStore.java,v 1.2 2005/04/03 21:31:33 trygvis Exp $
+ */
+public class ModelloJPoxContinuumStore
+ extends AbstractContinuumStore
+ implements ContinuumStore, Initializable
+{
+ /** @requirement */
+ private JdoFactory jdoFactory;
+
+ private ContinuumJPoxStore store;
+
+ // ----------------------------------------------------------------------
+ // Component Lifecycle
+ // ----------------------------------------------------------------------
+
+ public void initialize()
+ {
+ store = new ContinuumJPoxStore( jdoFactory.getPersistenceManagerFactory() );
+ }
+
+ // ----------------------------------------------------------------------
+ // ContinuumStore Implementation
+ // ----------------------------------------------------------------------
+
+ // ----------------------------------------------------------------------
+ // Database methods
+ // ----------------------------------------------------------------------
+
+ public void createDatabase()
+ throws ContinuumStoreException
+ {
+ }
+
+ public void deleteDatabase()
+ throws ContinuumStoreException
+ {
+ }
+
+ // ----------------------------------------------------------------------
+ // ContinuumProject
+ // ----------------------------------------------------------------------
+
+ public String addProject( String name, String scmUrl, String nagEmailAddress, String version, String builderId,
+ String workingDirectory, Properties configuration )
+ throws ContinuumStoreException
+ {
+ ContinuumProject project = new ContinuumProject();
+
+ project.setName( name );
+ project.setScmUrl( scmUrl );
+ project.setNagEmailAddress( nagEmailAddress );
+ project.setVersion( version );
+ project.setBuilderId( builderId );
+ project.setWorkingDirectory( workingDirectory );
+ project.setState( ContinuumProjectState.NEW );
+ project.setConfiguration( configuration );
+
+ try
+ {
+ Object id = store.addContinuumProject( project );
+
+ project = store.getContinuumProjectByJdoId( id, true );
+ }
+ catch ( Exception e )
+ {
+ throw new ContinuumStoreException( "Error while adding a project.", e );
+ }
+
+ return project.getId();
+ }
+
+ public void removeProject( String projectId )
+ throws ContinuumStoreException
+ {
+ try
+ {
+ store.deleteContinuumProject( projectId );
+ }
+ catch ( Exception e )
+ {
+ throw new ContinuumStoreException( "Error while removing project with id '" + projectId + "'.", e );
+ }
+ }
+
+ public void setWorkingDirectory( String projectId, String workingDirectory )
+ throws ContinuumStoreException
+ {
+ try
+ {
+ store.begin();
+
+ ContinuumProject project = store.getContinuumProject( projectId, false );
+
+ project.setWorkingDirectory( workingDirectory );
+
+ store.commit();
+ }
+ catch ( Exception e )
+ {
+ rollback( store );
+
+ throw new ContinuumStoreException( "Error while setting the working directory.", e );
+ }
+ }
+
+ public void updateProject( String projectId, String name, String scmUrl, String nagEmailAddress, String version )
+ throws ContinuumStoreException
+ {
+ try
+ {
+ store.begin();
+
+ ContinuumProject project = store.getContinuumProject( projectId, false );
+
+ project.setName( name );
+ project.setScmUrl( scmUrl );
+ project.setNagEmailAddress( nagEmailAddress );
+ project.setVersion( version );
+
+ store.commit();
+ }
+ catch ( Exception e )
+ {
+ rollback( store );
+
+ throw new ContinuumStoreException( "Error while updating project.", e );
+ }
+ }
+
+ public void updateProjectConfiguration( String projectId, Properties configuration )
+ throws ContinuumStoreException
+ {
+ try
+ {
+ store.begin();
+
+ ContinuumProject project = store.getContinuumProject( projectId, false );
+
+ project.setConfiguration( configuration );
+
+ store.commit();
+ }
+ catch ( Exception e )
+ {
+ rollback( store );
+
+ throw new ContinuumStoreException( "Error while updating project configuration.", e );
+ }
+ }
+
+ public Iterator getAllProjects()
+ throws ContinuumStoreException
+ {
+ try
+ {
+ Collection projects = store.getContinuumProjectCollection( true, null, "name ascending" );
+
+ return projects.iterator();
+ }
+ catch ( Exception e )
+ {
+ throw new ContinuumStoreException( "Error while loading project set", e );
+ }
+ }
+
+ public Iterator findProjectsByName( String nameSearchPattern )
+ throws ContinuumStoreException
+ {
+ Iterator it = getAllProjects();
+
+ List hits = new ArrayList();
+
+ while ( it.hasNext() )
+ {
+ ContinuumProject continuumProject = (ContinuumProject) it.next();
+
+ if ( continuumProject.getName().toLowerCase().indexOf( nameSearchPattern.toLowerCase() ) != -1 )
+ {
+ hits.add( continuumProject );
+ }
+ }
+
+ return hits.iterator();
+ }
+
+ public ContinuumProject getProject( String projectId )
+ throws ContinuumStoreException
+ {
+ try
+ {
+ ContinuumProject project = store.getContinuumProject( projectId, true );
+
+ return project;
+ }
+ catch ( Exception e )
+ {
+ throw new ContinuumStoreException( "Error while loading project.", e );
+ }
+ }
+
+ public ContinuumProject getProjectByBuild( String buildId )
+ throws ContinuumStoreException
+ {
+ try
+ {
+ store.begin();
+
+ ContinuumBuild build = store.getContinuumBuild( buildId, false );
+
+ Object id = JDOHelper.getObjectId( build.getProject() );
+
+ store.commit();
+
+ return store.getContinuumProjectByJdoId( id, true );
+ }
+ catch ( Exception e )
+ {
+ rollback( store );
+
+ throw new ContinuumStoreException( "Error while loading project.", e );
+ }
+ }
+
+ // ----------------------------------------------------------------------
+ // Build
+ // ----------------------------------------------------------------------
+
+ public String createBuild( String projectId )
+ throws ContinuumStoreException
+ {
+ try
+ {
+ store.begin();
+
+ ContinuumProject project = store.getContinuumProject( projectId, false );
+
+ project.setState( ContinuumProjectState.BUILD_SIGNALED );
+
+ ContinuumBuild build = new ContinuumBuild();
+
+ build.setStartTime( System.currentTimeMillis() );
+
+ build.setState( ContinuumProjectState.BUILD_SIGNALED );
+
+ build.setProject( project );
+
+ Object id = store.addContinuumBuild( build );
+
+ store.commit();
+
+ build = store.getContinuumBuildByJdoId( id, true );
+
+ return build.getId();
+ }
+ catch ( Exception e )
+ {
+ rollback( store );
+
+ throw new ContinuumStoreException( "Error while creating continuum build for project: '" + projectId + "'.", e );
+ }
+ }
+
+ public void setBuildResult( String buildId, int state, ContinuumBuildResult result, Throwable error )
+ throws ContinuumStoreException
+ {
+ try
+ {
+ store.begin();
+
+ ContinuumBuild build = store.getContinuumBuild( buildId, false );
+
+ ContinuumProject project = build.getProject();
+
+ project.setState( state );
+
+ build.setState( state );
+
+ build.setEndTime( new Date().getTime() );
+
+ build.setError( throwableToString( error ) );
+
+ store.commit();
+
+ // ----------------------------------------------------------------------
+ // This double commit seems to be needed for some reason. Not having it
+ // seems to result in some foreign key constraint violation.
+ // ----------------------------------------------------------------------
+
+ store.begin();
+
+ build = store.getContinuumBuild( buildId, false );
+
+ build.setBuildResult( result );
+
+ store.commit();
+ }
+ catch ( Exception e )
+ {
+ rollback( store );
+
+ throw new ContinuumStoreException( "Error while setting build result for build: '" + buildId + "'.", e );
+ }
+ }
+
+ public ContinuumBuild getBuild( String buildId )
+ throws ContinuumStoreException
+ {
+ try
+ {
+ return store.getContinuumBuild( buildId, true );
+ }
+ catch ( Exception e )
+ {
+ throw new ContinuumStoreException( "Error while loading build id: '" + buildId + "'.", e );
+ }
+ }
+
+ public ContinuumBuild getLatestBuildForProject( String projectId )
+ throws ContinuumStoreException
+ {
+ try
+ {
+ List builds = store.getContinuumProject( projectId, true ).getBuilds();
+
+ if ( builds.size() == 0 )
+ {
+ return null;
+ }
+
+ return (ContinuumBuild) builds.get( builds.size() - 1 );
+ }
+ catch ( Exception e )
+ {
+ throw new ContinuumStoreException( "Error while loading last build for project id: '" + projectId + "'.", e );
+ }
+ }
+
+ public Iterator getBuildsForProject( String projectId, int start, int end )
+ throws ContinuumStoreException
+ {
+ try
+ {
+ Collection builds = store.getContinuumBuildCollection( true, "this.project.id == \"" + projectId + "\"", "startTime descending" );
+
+ return builds.iterator();
+ }
+ catch ( Exception e )
+ {
+ throw new ContinuumStoreException( "Error while getting builds for project id: '" + projectId + "'.", e );
+ }
+ }
+
+ public ContinuumBuildResult getBuildResultForBuild( String buildId )
+ throws ContinuumStoreException
+ {
+ try
+ {
+ store.begin();
+
+ ContinuumBuild build = store.getContinuumBuild( buildId, false );
+
+ if ( build.getBuildResult() == null )
+ {
+ store.commit();
+
+ return null;
+ }
+
+ Object id = JDOHelper.getObjectId( build.getBuildResult() );
+
+ store.commit();
+
+ ContinuumBuildResult result = store.getContinuumBuildResultByJdoId( id, true );
+
+ return result;
+ }
+ catch ( Exception e )
+ {
+ rollback( store );
+
+ throw new ContinuumStoreException( "Error while getting build result.", e );
+ }
+ }
+
+ // ----------------------------------------------------------------------
+ //
+ // ----------------------------------------------------------------------
+
+ public ContinuumJPoxStore getStore()
+ {
+ return store;
+ }
+
+ // ----------------------------------------------------------------------
+ //
+ // ----------------------------------------------------------------------
+
+ private void rollback( ContinuumJPoxStore store )
+ {
+ try
+ {
+ getLogger().warn( "Rolling back transaction." );
+
+ store.rollback();
+ }
+ catch ( Exception e )
+ {
+ getLogger().error( "Error while rolling back tx.", e );
+ }
+ }
+}
Added: maven/continuum/continuum-core/src/main/java/org/apache/maven/continuum/trigger/AbstractContinuumTrigger.java
URL: http://svn.apache.org/viewcvs/maven/continuum/continuum-core/src/main/java/org/apache/maven/continuum/trigger/AbstractContinuumTrigger.java?view=auto&rev=160813
==============================================================================
--- maven/continuum/continuum-core/src/main/java/org/apache/maven/continuum/trigger/AbstractContinuumTrigger.java (added)
+++ maven/continuum/continuum-core/src/main/java/org/apache/maven/continuum/trigger/AbstractContinuumTrigger.java Sun Apr 10 19:21:34 2005
@@ -0,0 +1,38 @@
+package org.apache.maven.continuum.trigger;
+
+/*
+ * Copyright 2004-2005 The Apache Software Foundation.
+ *
+ * Licensed 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 org.apache.maven.continuum.Continuum;
+
+import org.codehaus.plexus.logging.AbstractLogEnabled;
+
+/**
+ * @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
+ * @version $Id: AbstractContinuumTrigger.java,v 1.1.1.1 2005/03/29 20:42:03 trygvis Exp $
+ */
+public class AbstractContinuumTrigger
+ extends AbstractLogEnabled
+ implements ContinuumTrigger
+{
+ /** @requirement */
+ private Continuum continuum;
+
+ public Continuum getContinuum()
+ {
+ return continuum;
+ }
+}
Added: maven/continuum/continuum-core/src/main/java/org/apache/maven/continuum/trigger/ContinuumTrigger.java
URL: http://svn.apache.org/viewcvs/maven/continuum/continuum-core/src/main/java/org/apache/maven/continuum/trigger/ContinuumTrigger.java?view=auto&rev=160813
==============================================================================
--- maven/continuum/continuum-core/src/main/java/org/apache/maven/continuum/trigger/ContinuumTrigger.java (added)
+++ maven/continuum/continuum-core/src/main/java/org/apache/maven/continuum/trigger/ContinuumTrigger.java Sun Apr 10 19:21:34 2005
@@ -0,0 +1,26 @@
+package org.apache.maven.continuum.trigger;
+
+/*
+ * Copyright 2004-2005 The Apache Software Foundation.
+ *
+ * Licensed 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:jason@maven.org">Jason van Zyl</a>
+ * @version $Id: ContinuumTrigger.java,v 1.1.1.1 2005/03/29 20:42:03 trygvis Exp $
+ */
+public interface ContinuumTrigger
+{
+ static String ROLE = ContinuumTrigger.class.getName();
+}
Added: maven/continuum/continuum-core/src/main/java/org/apache/maven/continuum/trigger/alarmclock/AlarmClockTrigger.java
URL: http://svn.apache.org/viewcvs/maven/continuum/continuum-core/src/main/java/org/apache/maven/continuum/trigger/alarmclock/AlarmClockTrigger.java?view=auto&rev=160813
==============================================================================
--- maven/continuum/continuum-core/src/main/java/org/apache/maven/continuum/trigger/alarmclock/AlarmClockTrigger.java (added)
+++ maven/continuum/continuum-core/src/main/java/org/apache/maven/continuum/trigger/alarmclock/AlarmClockTrigger.java Sun Apr 10 19:21:34 2005
@@ -0,0 +1,132 @@
+package org.apache.maven.continuum.trigger.alarmclock;
+
+/*
+ * Copyright 2004-2005 The Apache Software Foundation.
+ *
+ * Licensed 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.util.Iterator;
+import java.util.Timer;
+import java.util.TimerTask;
+
+import org.apache.maven.continuum.ContinuumException;
+import org.apache.maven.continuum.project.ContinuumProject;
+import org.apache.maven.continuum.trigger.AbstractContinuumTrigger;
+
+import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable;
+import org.codehaus.plexus.personality.plexus.lifecycle.phase.Startable;
+
+/**
+ * @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
+ * @author <a href="mailto:trygvis@inamo.no">Trygve Laugstøl</a>
+ * @version $Id: AlarmClockTrigger.java,v 1.1.1.1 2005/03/29 20:42:03 trygvis Exp $
+ */
+public class AlarmClockTrigger
+ extends AbstractContinuumTrigger
+ implements Initializable, Startable
+{
+ /** @configuration */
+ private int interval;
+
+ /** @configuration */
+ private int delay;
+
+ private Timer timer;
+
+ // ----------------------------------------------------------------------
+ // Plexus Component Implementation
+ // ----------------------------------------------------------------------
+
+ public void initialize()
+ throws Exception
+ {
+ if ( interval <= 0 )
+ {
+ throw new ContinuumException( "Invalid value for 'interval': the interval must be bigger that 0." );
+ }
+
+ if ( delay <= 0 )
+ {
+ throw new ContinuumException( "Invalid value for 'delay': the delay must be bigger that 0." );
+ }
+
+ timer = new Timer();
+ }
+
+ public void start()
+ throws Exception
+ {
+ getLogger().info( "Build interval: " + interval + "s" );
+ getLogger().info( "Will schedule the first build in: " + delay + "s" );
+
+ timer.schedule( new BuildTask(), delay * 1000, interval * 1000 );
+ }
+
+ public void stop()
+ {
+ timer.cancel();
+ }
+
+ // ----------------------------------------------------------------------
+ //
+ // ----------------------------------------------------------------------
+
+ public void onTimer()
+ {
+ Iterator it;
+
+ getLogger().info( "Scheduling projects." );
+
+ try
+ {
+ it = getContinuum().getAllProjects( 0, 0 );
+ }
+ catch ( Exception e )
+ {
+ getLogger().error( "Error while getting the project list.", e );
+
+ return;
+ }
+
+ while ( it.hasNext() )
+ {
+ ContinuumProject project = (ContinuumProject) it.next();
+
+ try
+ {
+ getContinuum().buildProject( project.getId() );
+ }
+ catch ( ContinuumException ex )
+ {
+ getLogger().error( "Could not enqueue project: " + project.getId() +
+ " ('" + project.getName() + "').", ex );
+
+ continue;
+ }
+ }
+ }
+
+ // ----------------------------------------------------------------------
+ //
+ // ----------------------------------------------------------------------
+
+ private class BuildTask
+ extends TimerTask
+ {
+ public void run()
+ {
+ onTimer();
+ }
+ }
+}
Added: maven/continuum/continuum-core/src/main/java/org/apache/maven/continuum/trigger/socket/SimpleSocketTrigger.java
URL: http://svn.apache.org/viewcvs/maven/continuum/continuum-core/src/main/java/org/apache/maven/continuum/trigger/socket/SimpleSocketTrigger.java?view=auto&rev=160813
==============================================================================
--- maven/continuum/continuum-core/src/main/java/org/apache/maven/continuum/trigger/socket/SimpleSocketTrigger.java (added)
+++ maven/continuum/continuum-core/src/main/java/org/apache/maven/continuum/trigger/socket/SimpleSocketTrigger.java Sun Apr 10 19:21:34 2005
@@ -0,0 +1,105 @@
+package org.apache.maven.continuum.trigger.socket;
+
+/*
+ * Copyright 2004-2005 The Apache Software Foundation.
+ *
+ * Licensed 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.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.OutputStream;
+import java.io.PrintWriter;
+
+import org.apache.maven.continuum.ContinuumException;
+import org.apache.maven.continuum.network.ConnectionConsumer;
+import org.apache.maven.continuum.trigger.AbstractContinuumTrigger;
+
+import org.codehaus.plexus.util.IOUtil;
+
+/**
+ * This trigger listens on a specified port and takes one line
+ * of input which contains the the groupId and artifactId of the
+ * project to build or the special word "all" to indicate building
+ * all the projects.
+ *
+ * @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
+ * @version $Id: SimpleSocketTrigger.java,v 1.1.1.1 2005/03/29 20:42:03 trygvis Exp $
+ */
+public class SimpleSocketTrigger
+ extends AbstractContinuumTrigger
+ implements ConnectionConsumer
+{
+ // ----------------------------------------------------------------------
+ // ConnectionConsumer Implementation
+ // ----------------------------------------------------------------------
+
+ public void consumeConnection( InputStream input, OutputStream output )
+ throws IOException
+ {
+ PrintWriter printer = new PrintWriter( output );
+
+ BufferedReader reader = new BufferedReader( new InputStreamReader( input ) );
+
+ String id;
+
+ try
+ {
+ id = reader.readLine();
+
+ if ( id.length() == 0 )
+ {
+ out( printer, "ERROR" );
+
+ out( printer, "Error in input, expected format: id." );
+
+ return;
+ }
+
+ String buildId = getContinuum().buildProject( id );
+
+ out( printer, "OK" );
+
+ out( printer, "id=" + buildId );
+
+ out( printer, "Build of " + id + " scheduled." );
+ }
+ catch ( ContinuumException ex )
+ {
+ out( printer, "ERROR" );
+
+ ex.printStackTrace( printer );
+ }
+ finally
+ {
+ printer.flush();
+
+ IOUtil.close( printer );
+ }
+ }
+
+ // ----------------------------------------------------------------------
+ //
+ // ----------------------------------------------------------------------
+
+ private void out( PrintWriter printer, String line )
+ {
+ printer.println( line );
+
+ printer.flush();
+
+ getLogger().info( line );
+ }
+}
Added: maven/continuum/continuum-core/src/main/java/org/apache/maven/continuum/utils/ContinuumUtils.java
URL: http://svn.apache.org/viewcvs/maven/continuum/continuum-core/src/main/java/org/apache/maven/continuum/utils/ContinuumUtils.java?view=auto&rev=160813
==============================================================================
--- maven/continuum/continuum-core/src/main/java/org/apache/maven/continuum/utils/ContinuumUtils.java (added)
+++ maven/continuum/continuum-core/src/main/java/org/apache/maven/continuum/utils/ContinuumUtils.java Sun Apr 10 19:21:34 2005
@@ -0,0 +1,40 @@
+package org.apache.maven.continuum.utils;
+
+/*
+ * Copyright 2004-2005 The Apache Software Foundation.
+ *
+ * Licensed 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.PrintWriter;
+import java.io.StringWriter;
+
+/**
+ * @author <a href="mailto:trygvis@inamo.no">Trygve Laugstøl</a>
+ * @version $Id: ContinuumUtils.java,v 1.1.1.1 2005/03/29 20:42:03 trygvis Exp $
+ */
+public class ContinuumUtils
+{
+ public static String getExceptionStackTrace( Throwable ex )
+ {
+ StringWriter string = new StringWriter();
+
+ PrintWriter writer = new PrintWriter( string );
+
+ ex.printStackTrace( writer );
+
+ writer.flush();
+
+ return string.getBuffer().toString();
+ }
+}
Added: maven/continuum/continuum-core/src/main/java/org/apache/maven/continuum/utils/PlexusUtils.java
URL: http://svn.apache.org/viewcvs/maven/continuum/continuum-core/src/main/java/org/apache/maven/continuum/utils/PlexusUtils.java?view=auto&rev=160813
==============================================================================
--- maven/continuum/continuum-core/src/main/java/org/apache/maven/continuum/utils/PlexusUtils.java (added)
+++ maven/continuum/continuum-core/src/main/java/org/apache/maven/continuum/utils/PlexusUtils.java Sun Apr 10 19:21:34 2005
@@ -0,0 +1,58 @@
+package org.apache.maven.continuum.utils;
+
+/*
+ * Copyright 2004-2005 The Apache Software Foundation.
+ *
+ * Licensed 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 org.codehaus.plexus.configuration.PlexusConfigurationException;
+
+/**
+ * @author <a href="mailto:trygvis@inamo.no">Trygve Laugstøl</a>
+ * @version $Id: PlexusUtils.java,v 1.1.1.1 2005/03/29 20:42:03 trygvis Exp $
+ */
+public class PlexusUtils
+{
+ private PlexusUtils()
+ {
+ }
+
+ public static void assertConfiguration( Object configuration, String name )
+ throws PlexusConfigurationException
+ {
+ if ( configuration == null )
+ {
+ throw new PlexusConfigurationException( "Missing configuration element: '" + name + "'." );
+ }
+
+ if ( configuration instanceof String )
+ {
+ String str = (String) configuration;
+
+ if ( str.trim().length() == 0 )
+ {
+ throw new PlexusConfigurationException( "Misconfigured element '" + name + "': Element cannot be empty." );
+ }
+ }
+ }
+
+ public static void assertRequirement( Object requirement, String role )
+ throws PlexusConfigurationException
+ {
+ if ( requirement == null )
+ {
+ throw new PlexusConfigurationException( "Missing requirement '" + role + "'." );
+ }
+ }
+}
Added: maven/continuum/continuum-core/src/main/resources/META-INF/plexus/components.xml
URL: http://svn.apache.org/viewcvs/maven/continuum/continuum-core/src/main/resources/META-INF/plexus/components.xml?view=auto&rev=160813
==============================================================================
--- maven/continuum/continuum-core/src/main/resources/META-INF/plexus/components.xml (added)
+++ maven/continuum/continuum-core/src/main/resources/META-INF/plexus/components.xml Sun Apr 10 19:21:34 2005
@@ -0,0 +1,370 @@
+<component-set>
+ <components>
+ <component>
+ <role>org.apache.maven.continuum.Continuum</role>
+ <implementation>org.apache.maven.continuum.DefaultContinuum</implementation>
+ <requirements>
+ <requirement>
+ <role>org.apache.maven.continuum.builder.manager.BuilderManager</role>
+ </requirement>
+ <requirement>
+ <role>org.apache.maven.continuum.buildcontroller.BuildController</role>
+ </requirement>
+ <requirement>
+ <role>org.apache.maven.continuum.buildqueue.BuildQueue</role>
+ </requirement>
+ <requirement>
+ <role>org.apache.maven.continuum.store.ContinuumStore</role>
+ </requirement>
+ <requirement>
+ <role>org.apache.maven.continuum.scm.ContinuumScm</role>
+ </requirement>
+ </requirements>
+ <configuration>
+ <app-home>${plexus.home}</app-home>
+ <working-directory>${plexus.home}/temp</working-directory>
+ </configuration>
+ </component>
+
+ <component>
+ <role>org.apache.maven.continuum.builder.manager.BuilderManager</role>
+ <implementation>org.apache.maven.continuum.builder.manager.DefaultBuilderManager</implementation>
+ <requirements>
+ <requirement>
+ <role>org.apache.maven.continuum.builder.ContinuumBuilder</role>
+ <field-name>builders</field-name>
+ </requirement>
+ </requirements>
+ </component>
+
+ <component>
+ <role>org.apache.maven.continuum.buildcontroller.BuildController</role>
+ <implementation>org.apache.maven.continuum.buildcontroller.DefaultBuildController</implementation>
+ <requirements>
+ <requirement>
+ <role>org.apache.maven.continuum.builder.manager.BuilderManager</role>
+ </requirement>
+ <requirement>
+ <role>org.apache.maven.continuum.store.ContinuumStore</role>
+ </requirement>
+ <requirement>
+ <role>org.apache.maven.continuum.notification.ContinuumNotificationDispatcher</role>
+ </requirement>
+ <requirement>
+ <role>org.apache.maven.continuum.scm.ContinuumScm</role>
+ </requirement>
+ </requirements>
+ </component>
+
+ <component>
+ <role>org.apache.maven.continuum.notification.ContinuumNotificationDispatcher</role>
+ <implementation>org.apache.maven.continuum.notification.DefaultContinuumNotificationDispatcher</implementation>
+ <requirements>
+ <requirement>
+ <role>org.codehaus.plexus.notification.NotificationDispatcher</role>
+ </requirement>
+ <requirement>
+ <role>org.apache.maven.continuum.store.ContinuumStore</role>
+ </requirement>
+ </requirements>
+ </component>
+
+ <component>
+ <role>org.apache.maven.continuum.scm.ContinuumScm</role>
+ <implementation>org.apache.maven.continuum.scm.DefaultContinuumScm</implementation>
+ <requirements>
+ <requirement>
+ <role>org.apache.maven.scm.manager.ScmManager</role>
+ </requirement>
+ </requirements>
+ </component>
+
+ <component>
+ <role>org.apache.maven.continuum.buildqueue.BuildQueue</role>
+ <implementation>org.apache.maven.continuum.buildqueue.DefaultBuildQueue</implementation>
+ <requirements>
+ <requirement>
+ <role>org.codehaus.plexus.taskqueue.TaskQueue</role>
+ </requirement>
+ </requirements>
+ </component>
+
+ <component>
+ <role>org.apache.maven.continuum.store.ContinuumStore</role>
+ <implementation>org.apache.maven.continuum.store.ModelloJPoxContinuumStore</implementation>
+ <requirements>
+ <requirement>
+ <role>org.codehaus.plexus.jdo.JdoFactory</role>
+ </requirement>
+ </requirements>
+ </component>
+
+ <!-- Triggers -->
+
+ <component>
+ <role>org.apache.maven.continuum.trigger.ContinuumTrigger</role>
+ <role-hint>alarm-clock</role-hint>
+ <implementation>org.apache.maven.continuum.trigger.alarmclock.AlarmClockTrigger</implementation>
+ <requirements>
+ <requirement>
+ <role>org.apache.maven.continuum.Continuum</role>
+ </requirement>
+ <requirement>
+ <role>org.apache.maven.continuum.store.tx.StoreTransactionManager</role>
+ </requirement>
+ </requirements>
+ <configuration>
+ <interval>60000</interval>
+ <delay>3000</delay>
+ </configuration>
+ </component>
+
+ <!-- Connection factory -->
+
+ <component>
+ <role>org.apache.maven.continuum.network.ConnectionFactory</role>
+ <role-hint>simple-socket-trigger-server</role-hint>
+ <implementation>org.apache.maven.continuum.network.SimpleServerSocketConnectionFactory</implementation>
+ <requirements>
+ <requirement>
+ <role>org.apache.maven.continuum.network.ConnectionConsumer</role>
+ <role-hint>simple-socket-trigger</role-hint>
+ </requirement>
+ </requirements>
+ <configuration>
+ <port>6770</port>
+ </configuration>
+ </component>
+
+ <component>
+ <role>org.apache.maven.continuum.network.ConnectionFactory</role>
+ <role-hint>url-registrar-server</role-hint>
+ <implementation>org.apache.maven.continuum.network.SimpleServerSocketConnectionFactory</implementation>
+ <requirements>
+ <requirement>
+ <role>org.apache.maven.continuum.network.ConnectionConsumer</role>
+ <role-hint>url-registrar</role-hint>
+ </requirement>
+ </requirements>
+ <configuration>
+ <port>6771</port>
+ </configuration>
+ </component>
+
+ <!-- ConnectionConsumer -->
+ <component>
+ <role>org.apache.maven.continuum.network.ConnectionConsumer</role>
+ <role-hint>simple-socket-trigger</role-hint>
+ <implementation>org.apache.maven.continuum.trigger.socket.SimpleSocketTrigger</implementation>
+ <requirements>
+ <requirement>
+ <role>org.apache.maven.continuum.Continuum</role>
+ </requirement>
+ </requirements>
+ </component>
+
+ <component>
+ <role>org.apache.maven.continuum.network.ConnectionConsumer</role>
+ <role-hint>url-registrar</role-hint>
+ <implementation>org.apache.maven.continuum.registration.socket.UrlSocketRegistrar</implementation>
+ <requirements>
+ <requirement>
+ <role>org.apache.maven.continuum.Continuum</role>
+ </requirement>
+ </requirements>
+ </component>
+
+ <!-- Notifier -->
+
+ <component>
+ <role>org.codehaus.plexus.notification.notifier.Notifier</role>
+ <role-hint>console</role-hint>
+ <implementation>org.apache.maven.continuum.notification.console.ConsoleNotifier</implementation>
+ </component>
+
+ <!-- Builder -->
+
+ <component>
+ <role>org.apache.maven.continuum.builder.ContinuumBuilder</role>
+ <role-hint>maven2</role-hint>
+ <implementation>org.apache.maven.continuum.builder.maven.m2.MavenShellBuilder</implementation>
+ <configuration>
+ <executable>m2</executable>
+ <arguments>-N</arguments>
+ </configuration>
+ <requirements>
+ <requirement>
+ <role>org.apache.maven.continuum.builder.shell.ShellCommandHelper</role>
+ </requirement>
+ <requirement>
+ <role>org.apache.maven.continuum.builder.maven.m2.MavenBuilderHelper</role>
+ </requirement>
+ </requirements>
+ </component>
+
+ <component>
+ <role>org.apache.maven.continuum.builder.maven.m2.MavenBuilderHelper</role>
+ <implementation>org.apache.maven.continuum.builder.maven.m2.DefaultMavenBuilderHelper</implementation>
+ <requirements>
+ <requirement>
+ <role>org.apache.maven.project.MavenProjectBuilder</role>
+ </requirement>
+ <requirement>
+ <role>org.apache.maven.artifact.repository.ArtifactRepositoryFactory</role>
+ </requirement>
+ <requirement>
+ <role>org.apache.maven.settings.MavenSettingsBuilder</role>
+ </requirement>
+ <requirement>
+ <role>org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout</role>
+ <role-hint>legacy</role-hint>
+ </requirement>
+ </requirements>
+ <configuration>
+ <local-repository>${plexus.home}/local-repository</local-repository>
+ </configuration>
+ </component>
+
+ <component>
+ <role>org.apache.maven.settings.MavenSettingsBuilder</role>
+ <implementation>org.apache.maven.settings.DefaultMavenSettingsBuilder</implementation>
+ <configuration>
+ <settings-path>${plexus.home}/conf/maven-settings.xml</settings-path>
+ </configuration>
+ </component>
+
+ <component>
+ <role>org.apache.maven.continuum.builder.ContinuumBuilder</role>
+ <role-hint>maven-1</role-hint>
+ <implementation>org.apache.maven.continuum.builder.maven.m1.Maven1Builder</implementation>
+ <configuration>
+ <maven-command>maven</maven-command>
+ </configuration>
+ <requirements>
+ <requirement>
+ <role>org.apache.maven.continuum.builder.shell.ShellCommandHelper</role>
+ </requirement>
+ </requirements>
+ </component>
+
+ <component>
+ <role>org.apache.maven.continuum.builder.shell.ShellCommandHelper</role>
+ <implementation>org.apache.maven.continuum.builder.shell.DefaultShellCommandHelper</implementation>
+ </component>
+
+ <component>
+ <role>org.apache.maven.continuum.builder.ContinuumBuilder</role>
+ <role-hint>ant</role-hint>
+ <implementation>org.apache.maven.continuum.builder.ant.AntBuilder</implementation>
+ <requirements>
+ <requirement>
+ <role>org.apache.maven.continuum.builder.shell.ShellCommandHelper</role>
+ </requirement>
+ </requirements>
+ </component>
+
+ <component>
+ <role>org.apache.maven.continuum.builder.ContinuumBuilder</role>
+ <role-hint>shell</role-hint>
+ <implementation>org.apache.maven.continuum.builder.shell.ShellBuilder</implementation>
+ <requirements>
+ <requirement>
+ <role>org.apache.maven.continuum.builder.shell.ShellCommandHelper</role>
+ </requirement>
+ </requirements>
+ </component>
+
+ <!--
+ |
+ | Task Queue
+ |
+ |-->
+
+ <component>
+ <role>org.codehaus.plexus.taskqueue.TaskQueue</role>
+ <implementation>org.codehaus.plexus.taskqueue.DefaultTaskQueue</implementation>
+ <lifecycle-handler>plexus-configurable</lifecycle-handler>
+ <configuration>
+ <task-entry-evaluators>
+ </task-entry-evaluators>
+ <task-exit-evaluators>
+ </task-exit-evaluators>
+ <task-viability-evaluators>
+ <task-viability-evaluator>build-project</task-viability-evaluator>
+ </task-viability-evaluators>
+ </configuration>
+ </component>
+
+ <component>
+ <role>org.codehaus.plexus.taskqueue.TaskViabilityEvaluator</role>
+ <role-hint>build-project</role-hint>
+ <implementation>org.apache.maven.continuum.buildqueue.evaluator.BuildProjectTaskViabilityEvaluator</implementation>
+ <configuration>
+ <required-buildInterval>1000</required-buildInterval>
+ </configuration>
+ </component>
+
+ <component>
+ <role>org.codehaus.plexus.jdo.JdoFactory</role>
+ <implementation>org.codehaus.plexus.jdo.DefaultJdoFactory</implementation>
+ <configuration>
+ <properties>
+ <property>
+ <name>javax.jdo.PersistenceManagerFactoryClass</name>
+ <value>org.jpox.PersistenceManagerFactoryImpl</value>
+ </property>
+ <property>
+ <name>javax.jdo.option.ConnectionDriverName</name>
+ <value>org.hsqldb.jdbcDriver</value>
+ </property>
+ <property>
+ <name>javax.jdo.option.ConnectionURL</name>
+ <value>jdbc:hsqldb:${plexus.home}/database</value>
+ </property>
+ <property>
+ <name>javax.jdo.option.ConnectionUserName</name>
+ <value>sa</value>
+ </property>
+ <property>
+ <name>javax.jdo.option.ConnectionPassword</name>
+ <value></value>
+ </property>
+ <property>
+ <name>org.jpox.autoCreateSchema</name>
+ <value>true</value>
+ </property>
+ <property>
+ <name>org.jpox.autoStartMechanism</name>
+ <value>SchemaTable</value>
+ </property>
+ <property>
+ <name>org.jpox.autoStartMechanismMode</name>
+ <value>Quiet</value>
+ </property>
+ </properties>
+ </configuration>
+ </component>
+
+ <component>
+ <role>org.codehaus.plexus.velocity.VelocityComponent</role>
+ <implementation>org.codehaus.plexus.velocity.DefaultVelocityComponent</implementation>
+ <configuration>
+ <properties>
+ <property>
+ <name>resource.loader</name>
+ <value>threadContext</value>
+ </property>
+ <property>
+ <name>threadContext.resource.loader.class</name>
+ <value>org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader</value>
+ </property>
+ <property>
+ <name>velocimacro.library</name>
+ <value>/org/apache/maven/continuum/notification/mail/templates/common.vm</value>
+ </property>
+ </properties>
+ </configuration>
+ </component>
+
+ </components>
+</component-set>
Added: maven/continuum/continuum-core/src/main/resources/org/apache/maven/continuum/notification/mail/templates/ant/BuildComplete.vm
URL: http://svn.apache.org/viewcvs/maven/continuum/continuum-core/src/main/resources/org/apache/maven/continuum/notification/mail/templates/ant/BuildComplete.vm?view=auto&rev=160813
==============================================================================
--- maven/continuum/continuum-core/src/main/resources/org/apache/maven/continuum/notification/mail/templates/ant/BuildComplete.vm (added)
+++ maven/continuum/continuum-core/src/main/resources/org/apache/maven/continuum/notification/mail/templates/ant/BuildComplete.vm Sun Apr 10 19:21:34 2005
@@ -0,0 +1,15 @@
+#*
+ * Copyright 2004-2005 The Apache Software Foundation.
+ *
+ * Licensed 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.
+ *##shellBuildResult()
\ No newline at end of file
Added: maven/continuum/continuum-core/src/main/resources/org/apache/maven/continuum/notification/mail/templates/common.vm
URL: http://svn.apache.org/viewcvs/maven/continuum/continuum-core/src/main/resources/org/apache/maven/continuum/notification/mail/templates/common.vm?view=auto&rev=160813
==============================================================================
--- maven/continuum/continuum-core/src/main/resources/org/apache/maven/continuum/notification/mail/templates/common.vm (added)
+++ maven/continuum/continuum-core/src/main/resources/org/apache/maven/continuum/notification/mail/templates/common.vm Sun Apr 10 19:21:34 2005
@@ -0,0 +1,41 @@
+#*
+ * Copyright 2004-2005 The Apache Software Foundation.
+ *
+ * Licensed 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.
+ *#
+#macro( shellBuildResult )
+****************************************************************************
+Build statistics:
+ State: $formatter.formatProjectState( $build.state )
+#if ( $previousBuild )
+ Previous State: $formatter.formatProjectState( $previousBuild.state )
+#else
+ Previous build: No previous build.
+#end
+ Started at: $formatter.formatTimestamp( $build.startTime )
+ Finished at: $formatter.formatTimestamp( $build.endTime )
+ Total time: $formatter.formatInterval( $build.startTime, $build.endTime )
+ Building machine hostname: $buildHost
+****************************************************************************
+
+****************************************************************************
+Standard output:
+****************************************************************************
+$buildResult.standardOutput
+****************************************************************************
+
+****************************************************************************
+Standard error:
+****************************************************************************
+$buildResult.standardError
+****************************************************************************#end
\ No newline at end of file
Added: maven/continuum/continuum-core/src/main/resources/org/apache/maven/continuum/notification/mail/templates/maven-1/BuildComplete.vm
URL: http://svn.apache.org/viewcvs/maven/continuum/continuum-core/src/main/resources/org/apache/maven/continuum/notification/mail/templates/maven-1/BuildComplete.vm?view=auto&rev=160813
==============================================================================
--- maven/continuum/continuum-core/src/main/resources/org/apache/maven/continuum/notification/mail/templates/maven-1/BuildComplete.vm (added)
+++ maven/continuum/continuum-core/src/main/resources/org/apache/maven/continuum/notification/mail/templates/maven-1/BuildComplete.vm Sun Apr 10 19:21:34 2005
@@ -0,0 +1,15 @@
+#*
+ * Copyright 2004-2005 The Apache Software Foundation.
+ *
+ * Licensed 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.
+ *##shellBuildResult()
\ No newline at end of file
Added: maven/continuum/continuum-core/src/main/resources/org/apache/maven/continuum/notification/mail/templates/maven2/BuildComplete.vm
URL: http://svn.apache.org/viewcvs/maven/continuum/continuum-core/src/main/resources/org/apache/maven/continuum/notification/mail/templates/maven2/BuildComplete.vm?view=auto&rev=160813
==============================================================================
--- maven/continuum/continuum-core/src/main/resources/org/apache/maven/continuum/notification/mail/templates/maven2/BuildComplete.vm (added)
+++ maven/continuum/continuum-core/src/main/resources/org/apache/maven/continuum/notification/mail/templates/maven2/BuildComplete.vm Sun Apr 10 19:21:34 2005
@@ -0,0 +1,15 @@
+#*
+ * Copyright 2004-2005 The Apache Software Foundation.
+ *
+ * Licensed 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.
+ *##shellBuildResult()
\ No newline at end of file
Added: maven/continuum/continuum-core/src/main/resources/org/apache/maven/continuum/notification/mail/templates/shell/BuildComplete.vm
URL: http://svn.apache.org/viewcvs/maven/continuum/continuum-core/src/main/resources/org/apache/maven/continuum/notification/mail/templates/shell/BuildComplete.vm?view=auto&rev=160813
==============================================================================
--- maven/continuum/continuum-core/src/main/resources/org/apache/maven/continuum/notification/mail/templates/shell/BuildComplete.vm (added)
+++ maven/continuum/continuum-core/src/main/resources/org/apache/maven/continuum/notification/mail/templates/shell/BuildComplete.vm Sun Apr 10 19:21:34 2005
@@ -0,0 +1,15 @@
+#*
+ * Copyright 2004-2005 The Apache Software Foundation.
+ *
+ * Licensed 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.
+ *##shellBuildResult()
\ No newline at end of file
Added: maven/continuum/continuum-core/src/test-file-storage/inamo/accountmanager.pom
URL: http://svn.apache.org/viewcvs/maven/continuum/continuum-core/src/test-file-storage/inamo/accountmanager.pom?view=auto&rev=160813
==============================================================================
--- maven/continuum/continuum-core/src/test-file-storage/inamo/accountmanager.pom (added)
+++ maven/continuum/continuum-core/src/test-file-storage/inamo/accountmanager.pom Sun Apr 10 19:21:34 2005
@@ -0,0 +1,221 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<project>
+ <pomVersion>3</pomVersion>
+ <artifactId>accountmanager</artifactId>
+ <name>inamo.no accountmanager</name>
+ <groupId>inamo</groupId>
+ <currentVersion>0.1.0-SNAPSHOT</currentVersion>
+ <organization>
+ <name>inamo</name>
+ <url>http://www.inamo.no</url>
+ <logo>http://www.inamo.no/local/img/logo.png</logo>
+ </organization>
+ <inceptionYear>2003</inceptionYear>
+ <package>no.inamo</package>
+ <logo>http://inamo-tools.inamo.no/images/logo.png</logo>
+ <shortDescription>
+ This is a accountmanager with ldap and inmemory implementations.
+ </shortDescription>
+ <url>http://home.inamo.no/~trygvis/inamo-tools/projects/accountmanager</url>
+ <issueTrackingUrl>http://jira.inamo.no</issueTrackingUrl>
+ <!--
+ <siteAddress>inamo-tools.inamo.no</siteAddress>
+ <siteDirectory>/var/local/projects/inamo-tools</siteDirectory>
+ -->
+ <siteAddress>home.inamo.no</siteAddress>
+ <siteDirectory>/home/users/t/trygvis/public_html/inamo-tools/projects/accountmanager</siteDirectory>
+ <distributionSite>dist.inamo.no</distributionSite>
+ <distributionDirectory>/var/local/projects/dist</distributionDirectory>
+ <repository>
+ <connection>scm:cvs:pserver:anoncvs@cvs.inamo.no:/var/local/cvs/inamo-tools:accountmanager</connection>
+ <developerConnection>scm:cvs:ext:user@cvs.inamo.no:/var/local/cvs/inamo-tools:accountmanager</developerConnection>
+ <url>http://cvs.inamo.no/viewcvs.cgi/accountmanager?cvsroot=Inamo+tools</url>
+ </repository>
+
+ <mailingLists>
+ <mailingList>
+ <name>inamo developers list</name>
+ <subscribe>http://lists.inamo.no/mailman/listinfo/inamo-tools-dev</subscribe>
+ <unsubscribe>http://lists.inamo.no/mailman/listinfo/inamo-tools-dev</unsubscribe>
+ <archive>http://lists.inamo.no/pipermail/inamo-tools-dev/</archive>
+ </mailingList>
+ <mailingList>
+ <name>inamo cvs commit list</name>
+ <subscribe>http://lists.inamo.no/mailman/listinfo/inamo-tools-cvs</subscribe>
+ <unsubscribe>http://lists.inamo.no/mailman/listinfo/inamo-tools-cvs</unsubscribe>
+ <archive>http://lists.inamo.no/pipermail/inamo-tools-cvs/</archive>
+ </mailingList>
+ </mailingLists>
+
+ <developers>
+ <developer>
+ <name>Trygve Laugstøl</name>
+ <id>trygvis</id>
+ <email>trygvela@ifi.uio.no</email>
+ <organization>Laugstøl consulting</organization>
+ <roles>
+ <role>Developer</role>
+ </roles>
+ <timezone>+1</timezone>
+ </developer>
+ </developers>
+
+ <licenses>
+ <license>
+ <name>The Apache Software License, Version 1.1</name>
+ <url>http://cvs.inamo.no/viewcvs.cgi/accountmanager/LICENSE.txt?cvsroot=Inamo+tools</url>
+ <distribution>repo</distribution>
+ </license>
+ </licenses>
+
+ <dependencies>
+ <dependency>
+ <artifactId>commons-lang</artifactId>
+ <groupId>commons-lang</groupId>
+ <version>2.0</version>
+ </dependency>
+ <dependency>
+ <artifactId>log4j</artifactId>
+ <groupId>log4j</groupId>
+ <version>1.2.7</version>
+ </dependency>
+
+ <dependency>
+ <artifactId>utils</artifactId>
+ <groupId>inamo</groupId>
+ <version>SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <artifactId>ldap-utils</artifactId>
+ <groupId>inamo</groupId>
+ <version>SNAPSHOT</version>
+ </dependency>
+
+ <!-- ASPECT STUFF -->
+ <dependency>
+ <artifactId>maven-aspectj-plugin</artifactId>
+ <groupId>maven</groupId>
+ <version>1.1</version>
+ <type>plugin</type>
+ </dependency>
+
+ <!-- ADAPTERS : XWORK -->
+ <dependency>
+ <artifactId>xwork</artifactId>
+ <groupId>xwork</groupId>
+ <version>1.0</version>
+ </dependency>
+
+ <!-- ADAPTERS : PLEXUS -->
+ <dependency>
+ <artifactId>plexus</artifactId>
+ <groupId>plexus</groupId>
+ <version>0.10</version>
+ <!--
+ <version>0.13</version>
+ -->
+ </dependency>
+ <dependency>
+ <artifactId>avalon-framework</artifactId>
+ <groupId>avalon</groupId>
+ <version>4.1.4</version>
+ </dependency>
+ <dependency>
+ <artifactId>classworlds</artifactId>
+ <groupId>classworlds</groupId>
+ <version>1.0</version>
+ </dependency>
+ <dependency>
+ <artifactId>classworlds</artifactId>
+ <groupId>classworlds</groupId>
+ <version>1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>xstream</groupId>
+ <artifactId>xstream</artifactId>
+ <version>0.3</version>
+ </dependency>
+ <dependency>
+ <groupId>xpp3</groupId>
+ <artifactId>xpp3</artifactId>
+ <version>1.1.2a</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-graph</groupId>
+ <artifactId>commons-graph</artifactId>
+ <version>0.8.1</version>
+ </dependency>
+ <dependency>
+ <groupId>asm</groupId>
+ <artifactId>asm</artifactId>
+ <version>1.3.4</version>
+ </dependency>
+
+ <!-- TESTING -->
+ <dependency>
+ <artifactId>junit</artifactId>
+ <groupId>junit</groupId>
+ <version>3.8.1</version>
+ </dependency>
+ <dependency>
+ <artifactId>plexus-ldapserver</artifactId>
+ <groupId>plexus</groupId>
+ <version>SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>xerces</groupId>
+ <artifactId>xerces</artifactId>
+ <version>1.4.0</version>
+ </dependency>
+
+ <dependency>
+ <groupId>inamo</groupId>
+ <artifactId>checkstyle</artifactId>
+ <version>1.0</version>
+ <type>xml</type>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <nagEmailAddress>inamo-tools-dev@lists.inamo.no</nagEmailAddress>
+ <sourceDirectory>src/main/java</sourceDirectory>
+ <aspectSourceDirectory>src/main/aspects</aspectSourceDirectory>
+ <unitTestSourceDirectory>src/test/java</unitTestSourceDirectory>
+ <unitTest>
+ <!--
+ A general Abstract* exclude doesn't work as there are
+ test that should be run that matches the pattern.
+ -->
+ <excludes>
+ <exclude>**/accountmanager/AbstractAccountManagerTest.java</exclude>
+ </excludes>
+ <includes>
+ <include>**/*Test.java</include>
+ </includes>
+ <resources>
+ <resource>
+ <directory>src/test/resources</directory>
+ <include>*.xml</include>
+ <include>*.properties</include>
+ <include>*.prop</include>
+ </resource>
+ </resources>
+ </unitTest>
+ </build>
+
+ <reports>
+ <report>maven-changelog-plugin</report>
+ <report>maven-changes-plugin</report>
+ <report>maven-checkstyle-plugin</report>
+ <report>maven-developer-activity-plugin</report>
+ <report>maven-file-activity-plugin</report>
+ <report>maven-javadoc-plugin</report>
+ <report>maven-jdepend-plugin</report>
+ <report>maven-junit-report-plugin</report>
+ <report>maven-jxr-plugin</report>
+ <report>maven-license-plugin</report>
+ <report>maven-linkcheck-plugin</report>
+ <report>maven-clover-plugin</report>
+ </reports>
+</project>
Added: maven/continuum/continuum-core/src/test-file-storage/plexus/bayesian.pom
URL: http://svn.apache.org/viewcvs/maven/continuum/continuum-core/src/test-file-storage/plexus/bayesian.pom?view=auto&rev=160813
==============================================================================
--- maven/continuum/continuum-core/src/test-file-storage/plexus/bayesian.pom (added)
+++ maven/continuum/continuum-core/src/test-file-storage/plexus/bayesian.pom Sun Apr 10 19:21:34 2005
@@ -0,0 +1,20 @@
+<?xml version="1.0"?>
+
+<project>
+ <artifactId>plexus-bayesian</artifactId>
+ <name>Plexus Bayesian Component</name>
+ <currentVersion>1.0-alpha-1</currentVersion>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>javamail</groupId>
+ <artifactId>javamail</artifactId>
+ <version>1.3.1</version>
+ <url>http://java.sun.com/products/javamail</url>
+ </dependency>
+
+ </dependencies>
+
+</project>
+
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org