From continuum-commits-returnrachel17@example.net Mon Nov 05 23:15:22 2007 Return-Path: <continuum-commits-returnrachel17@example.net> Delivered-To: rachel17@example.net Received: (qmail 21646 invoked from network); 5 Nov 2007 23:15:22 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 5 Nov 2007 23:15:22 -0000 Received: (qmail 67183 invoked by uid 500); 5 Nov 2007 23:15:10 -0000 Delivered-To: rachel17@example.net Received: (qmail 67136 invoked by uid 500); 5 Nov 2007 23:15:10 -0000 Mailing-List: contact rachel17@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:rachel17@example.net> List-Unsubscribe: <mailto:rachel17@example.net> List-Post: <mailto:rachel17@example.net> List-Id: <continuum-commits.maven.apache.org> Reply-To: rachel17@example.net Delivered-To: mailing list rachel17@example.net Received: (qmail 67123 invoked by uid 99); 5 Nov 2007 23:15:09 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Nov 2007 15:15:09 -0800 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Nov 2007 23:15:21 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 0CC7E1A9832; Mon, 5 Nov 2007 15:15:01 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r592180 - in /maven/continuum/trunk/continuum-notifiers: continuum-notifier-api/src/main/java/org/apache/maven/continuum/notification/ continuum-notifier-irc/src/main/java/org/apache/maven/continuum/notification/irc/ Date: Mon, 05 Nov 2007 23:15:00 -0000 To: rachel17@example.net From: rachel17@example.net X-Mailer: svnmailer-1.0.8 Message-Id: <rachel17@example.net> X-Virus-Checked: Checked by ClamAV on apache.org Author: olamy Date: Mon Nov 5 15:14:59 2007 New Revision: 592180 URL: http://svn.apache.org/viewvc?rev=592180&view=rev Log: [CONTINUUM-1548] fix NPE in IRC Notifier Modified: maven/continuum/trunk/continuum-notifiers/continuum-notifier-api/src/main/java/org/apache/maven/continuum/notification/AbstractContinuumNotifier.java maven/continuum/trunk/continuum-notifiers/continuum-notifier-irc/src/main/java/org/apache/maven/continuum/notification/irc/IrcContinuumNotifier.java Modified: maven/continuum/trunk/continuum-notifiers/continuum-notifier-api/src/main/java/org/apache/maven/continuum/notification/AbstractContinuumNotifier.java URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-notifiers/continuum-notifier-api/src/main/java/org/apache/maven/continuum/notification/AbstractContinuumNotifier.java?rev=592180&r1=592179&r2=592180&view=diff ============================================================================== --- maven/continuum/trunk/continuum-notifiers/continuum-notifier-api/src/main/java/org/apache/maven/continuum/notification/AbstractContinuumNotifier.java (original) +++ maven/continuum/trunk/continuum-notifiers/continuum-notifier-api/src/main/java/org/apache/maven/continuum/notification/AbstractContinuumNotifier.java Mon Nov 5 15:14:59 2007 @@ -190,7 +190,7 @@ { if ( buildDef != null ) { - builds = store.getBuildResultsByBuildDefinition( project.getId(), buildDef.getId(), 0, 2 ); + builds = getContinuumStore().getBuildResultsByBuildDefinition( project.getId(), buildDef.getId(), 0, 2 ); if ( builds.size() < 2 ) { @@ -214,7 +214,7 @@ //Normally, it isn't possible, buildDef should be != null if ( project.getId() > 0 ) { - project = store.getProjectWithBuilds( project.getId() ); + project = getContinuumStore().getProjectWithBuilds( project.getId() ); } builds = project.getBuildResults(); @@ -241,4 +241,8 @@ } } + protected ContinuumStore getContinuumStore() + { + return this.store; + } } Modified: maven/continuum/trunk/continuum-notifiers/continuum-notifier-irc/src/main/java/org/apache/maven/continuum/notification/irc/IrcContinuumNotifier.java URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-notifiers/continuum-notifier-irc/src/main/java/org/apache/maven/continuum/notification/irc/IrcContinuumNotifier.java?rev=592180&r1=592179&r2=592180&view=diff ============================================================================== --- maven/continuum/trunk/continuum-notifiers/continuum-notifier-irc/src/main/java/org/apache/maven/continuum/notification/irc/IrcContinuumNotifier.java (original) +++ maven/continuum/trunk/continuum-notifiers/continuum-notifier-irc/src/main/java/org/apache/maven/continuum/notification/irc/IrcContinuumNotifier.java Mon Nov 5 15:14:59 2007 @@ -28,6 +28,7 @@ import org.apache.maven.continuum.notification.AbstractContinuumNotifier; import org.apache.maven.continuum.notification.ContinuumNotificationDispatcher; import org.apache.maven.continuum.project.ContinuumProjectState; +import org.apache.maven.continuum.store.ContinuumStore; import org.codehaus.plexus.notification.NotificationException; import org.codehaus.plexus.personality.plexus.lifecycle.phase.Disposable; import org.codehaus.plexus.util.StringUtils; @@ -64,6 +65,11 @@ // ---------------------------------------------------------------------- /** + * @plexus.requirement role-hint="jdo" + */ + private ContinuumStore store; + + /** * @plexus.requirement */ private ConfigurationService configurationService; @@ -506,4 +512,8 @@ } } + protected ContinuumStore getContinuumStore() + { + return this.store; + } } From continuum-commits-returnrachel17@example.net Mon Nov 05 23:31:45 2007 Return-Path: <continuum-commits-returnrachel17@example.net> Delivered-To: rachel17@example.net Received: (qmail 28373 invoked from network); 5 Nov 2007 23:31:45 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 5 Nov 2007 23:31:45 -0000 Received: (qmail 74031 invoked by uid 500); 5 Nov 2007 23:31:33 -0000 Delivered-To: rachel17@example.net Received: (qmail 74006 invoked by uid 500); 5 Nov 2007 23:31:33 -0000 Mailing-List: contact rachel17@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:rachel17@example.net> List-Unsubscribe: <mailto:rachel17@example.net> List-Post: <mailto:rachel17@example.net> List-Id: <continuum-commits.maven.apache.org> Reply-To: rachel17@example.net Delivered-To: mailing list rachel17@example.net Received: (qmail 73993 invoked by uid 99); 5 Nov 2007 23:31:33 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Nov 2007 15:31:33 -0800 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Nov 2007 23:31:45 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id F1F771A9832; Mon, 5 Nov 2007 15:31:24 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r592183 - /maven/continuum/trunk/pom.xml Date: Mon, 05 Nov 2007 23:31:24 -0000 To: rachel17@example.net From: rachel17@example.net X-Mailer: svnmailer-1.0.8 Message-Id: <rachel17@example.net> X-Virus-Checked: Checked by ClamAV on apache.org Author: olamy Date: Mon Nov 5 15:31:20 2007 New Revision: 592183 URL: http://svn.apache.org/viewvc?rev=592183&view=rev Log: upgrade to last maven parent (remove duplicate maven-remote-resources-plugin declaration) Modified: maven/continuum/trunk/pom.xml Modified: maven/continuum/trunk/pom.xml URL: http://svn.apache.org/viewvc/maven/continuum/trunk/pom.xml?rev=592183&r1=592182&r2=592183&view=diff ============================================================================== --- maven/continuum/trunk/pom.xml (original) +++ maven/continuum/trunk/pom.xml Mon Nov 5 15:31:20 2007 @@ -22,7 +22,7 @@ <parent> <groupId>org.apache.maven</groupId> <artifactId>maven-parent</artifactId> - <version>6</version> + <version>7</version> <relativePath>../pom/maven/pom.xml</relativePath> </parent> <groupId>org.apache.maven.continuum</groupId> @@ -158,25 +158,6 @@ </plugin> </plugins> </pluginManagement> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-remote-resources-plugin</artifactId> - <version>1.0-alpha-6</version> - <executions> - <execution> - <goals> - <goal>process</goal> - </goals> - <configuration> - <resourceBundles> - <resourceBundle>org.apache:apache-jar-resource-bundle:1.3</resourceBundle> - </resourceBundles> - </configuration> - </execution> - </executions> - </plugin> - </plugins> </build> <modules> <module>continuum-api</module> From continuum-commits-returnrachel17@example.net Wed Nov 07 14:01:19 2007 Return-Path: <continuum-commits-returnrachel17@example.net> Delivered-To: rachel17@example.net Received: (qmail 6296 invoked from network); 7 Nov 2007 14:01:19 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 7 Nov 2007 14:01:19 -0000 Received: (qmail 67416 invoked by uid 500); 7 Nov 2007 14:01:07 -0000 Delivered-To: rachel17@example.net Received: (qmail 67366 invoked by uid 500); 7 Nov 2007 14:01:07 -0000 Mailing-List: contact rachel17@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:rachel17@example.net> List-Unsubscribe: <mailto:rachel17@example.net> List-Post: <mailto:rachel17@example.net> List-Id: <continuum-commits.maven.apache.org> Reply-To: rachel17@example.net Delivered-To: mailing list rachel17@example.net Received: (qmail 67353 invoked by uid 99); 7 Nov 2007 14:01:06 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Nov 2007 06:01:06 -0800 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Nov 2007 14:01:18 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id C66DD1A9832; Wed, 7 Nov 2007 06:00:56 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r592752 - /maven/continuum/trunk/continuum-store/src/main/java/org/apache/maven/continuum/store/JdoContinuumStore.java Date: Wed, 07 Nov 2007 14:00:55 -0000 To: rachel17@example.net From: rachel17@example.net X-Mailer: svnmailer-1.0.8 Message-Id: <rachel17@example.net> X-Virus-Checked: Checked by ClamAV on apache.org Author: evenisse Date: Wed Nov 7 06:00:55 2007 New Revision: 592752 URL: http://svn.apache.org/viewvc?rev=592752&view=rev Log: [CONTINUUM-1540] Fix eraseDatabase method for datamanagement-cli Modified: maven/continuum/trunk/continuum-store/src/main/java/org/apache/maven/continuum/store/JdoContinuumStore.java Modified: maven/continuum/trunk/continuum-store/src/main/java/org/apache/maven/continuum/store/JdoContinuumStore.java URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-store/src/main/java/org/apache/maven/continuum/store/JdoContinuumStore.java?rev=592752&r1=592751&r2=592752&view=diff ============================================================================== --- maven/continuum/trunk/continuum-store/src/main/java/org/apache/maven/continuum/store/JdoContinuumStore.java (original) +++ maven/continuum/trunk/continuum-store/src/main/java/org/apache/maven/continuum/store/JdoContinuumStore.java Wed Nov 7 06:00:55 2007 @@ -1958,21 +1958,21 @@ public void eraseDatabase() { + PlexusJdoUtils.removeAll( getPersistenceManager(), BuildDefinitionTemplate.class ); + PlexusJdoUtils.removeAll( getPersistenceManager(), BuildResult.class ); PlexusJdoUtils.removeAll( getPersistenceManager(), ProjectGroup.class ); PlexusJdoUtils.removeAll( getPersistenceManager(), Project.class ); + PlexusJdoUtils.removeAll( getPersistenceManager(), BuildDefinition.class ); PlexusJdoUtils.removeAll( getPersistenceManager(), Schedule.class ); PlexusJdoUtils.removeAll( getPersistenceManager(), Profile.class ); PlexusJdoUtils.removeAll( getPersistenceManager(), Installation.class ); PlexusJdoUtils.removeAll( getPersistenceManager(), ScmResult.class ); - PlexusJdoUtils.removeAll( getPersistenceManager(), BuildResult.class ); PlexusJdoUtils.removeAll( getPersistenceManager(), SystemConfiguration.class ); PlexusJdoUtils.removeAll( getPersistenceManager(), ProjectNotifier.class ); PlexusJdoUtils.removeAll( getPersistenceManager(), ProjectDeveloper.class ); PlexusJdoUtils.removeAll( getPersistenceManager(), ProjectDependency.class ); PlexusJdoUtils.removeAll( getPersistenceManager(), ChangeSet.class ); PlexusJdoUtils.removeAll( getPersistenceManager(), ChangeFile.class ); - PlexusJdoUtils.removeAll( getPersistenceManager(), BuildDefinitionTemplate.class ); - PlexusJdoUtils.removeAll( getPersistenceManager(), BuildDefinition.class ); } /** From continuum-commits-returnrachel17@example.net Wed Nov 07 14:52:09 2007 Return-Path: <continuum-commits-returnrachel17@example.net> Delivered-To: rachel17@example.net Received: (qmail 18878 invoked from network); 7 Nov 2007 14:52:09 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 7 Nov 2007 14:52:09 -0000 Received: (qmail 50244 invoked by uid 500); 7 Nov 2007 14:51:57 -0000 Delivered-To: rachel17@example.net Received: (qmail 50220 invoked by uid 500); 7 Nov 2007 14:51:57 -0000 Mailing-List: contact rachel17@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:rachel17@example.net> List-Unsubscribe: <mailto:rachel17@example.net> List-Post: <mailto:rachel17@example.net> List-Id: <continuum-commits.maven.apache.org> Reply-To: rachel17@example.net Delivered-To: mailing list rachel17@example.net Received: (qmail 50207 invoked by uid 99); 7 Nov 2007 14:51:56 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Nov 2007 06:51:56 -0800 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Nov 2007 14:52:08 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 185081A9832; Wed, 7 Nov 2007 06:51:48 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r592766 - /maven/continuum/trunk/continuum-data-management/data-management-cli/src/main/java/org/apache/maven/continuum/management/DataManagementCli.java Date: Wed, 07 Nov 2007 14:51:47 -0000 To: rachel17@example.net From: rachel17@example.net X-Mailer: svnmailer-1.0.8 Message-Id: <rachel17@example.net> X-Virus-Checked: Checked by ClamAV on apache.org Author: evenisse Date: Wed Nov 7 06:51:47 2007 New Revision: 592766 URL: http://svn.apache.org/viewvc?rev=592766&view=rev Log: [CONTINUUM-1492] Read proxy from settings.xml Modified: maven/continuum/trunk/continuum-data-management/data-management-cli/src/main/java/org/apache/maven/continuum/management/DataManagementCli.java Modified: maven/continuum/trunk/continuum-data-management/data-management-cli/src/main/java/org/apache/maven/continuum/management/DataManagementCli.java URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-data-management/data-management-cli/src/main/java/org/apache/maven/continuum/management/DataManagementCli.java?rev=592766&r1=592765&r2=592766&view=diff ============================================================================== --- maven/continuum/trunk/continuum-data-management/data-management-cli/src/main/java/org/apache/maven/continuum/management/DataManagementCli.java (original) +++ maven/continuum/trunk/continuum-data-management/data-management-cli/src/main/java/org/apache/maven/continuum/management/DataManagementCli.java Wed Nov 7 06:51:47 2007 @@ -26,6 +26,7 @@ import org.apache.log4j.Logger; import org.apache.maven.artifact.Artifact; import org.apache.maven.artifact.factory.ArtifactFactory; +import org.apache.maven.artifact.manager.WagonManager; import org.apache.maven.artifact.metadata.ArtifactMetadataSource; import org.apache.maven.artifact.repository.ArtifactRepository; import org.apache.maven.artifact.repository.ArtifactRepositoryFactory; @@ -38,12 +39,18 @@ import org.apache.maven.artifact.resolver.filter.ArtifactFilter; import org.apache.maven.artifact.resolver.filter.ExcludesArtifactFilter; import org.apache.maven.settings.MavenSettingsBuilder; +import org.apache.maven.settings.Mirror; +import org.apache.maven.settings.Proxy; +import org.apache.maven.settings.Server; import org.apache.maven.settings.Settings; +import org.apache.maven.wagon.repository.RepositoryPermissions; import org.codehaus.plexus.DefaultPlexusContainer; import org.codehaus.plexus.PlexusContainer; import org.codehaus.plexus.PlexusContainerException; import org.codehaus.plexus.classworlds.realm.ClassRealm; +import org.codehaus.plexus.component.repository.exception.ComponentLifecycleException; import org.codehaus.plexus.component.repository.exception.ComponentLookupException; +import org.codehaus.plexus.util.xml.Xpp3Dom; import org.codehaus.plexus.util.xml.pull.XmlPullParserException; import java.io.File; @@ -53,6 +60,7 @@ import java.util.ArrayList; import java.util.Collection; import java.util.Collections; +import java.util.Iterator; import java.util.List; import java.util.Properties; @@ -170,8 +178,8 @@ private static void processDatabase( SupportedDatabase databaseType, DatabaseFormat databaseFormat, OperationMode mode, String jdbcUrl, File directory, String toolRoleHint, String managementArtifactId, String configRoleHint ) - throws PlexusContainerException, ComponentLookupException, ArtifactNotFoundException, - ArtifactResolutionException, IOException + throws PlexusContainerException, ComponentLookupException, ComponentLifecycleException, + ArtifactNotFoundException, ArtifactResolutionException, IOException { String applicationVersion = getVersion(); @@ -179,6 +187,9 @@ params.setUrl( jdbcUrl ); DefaultPlexusContainer container = new DefaultPlexusContainer(); + + initializeWagon( container ); + List<Artifact> artifacts = new ArrayList<Artifact>(); artifacts.addAll( downloadArtifact( container, params.getGroupId(), params.getArtifactId(), params.getVersion() ) ); @@ -257,6 +268,66 @@ container.setLookupRealm( oldRealm ); Thread.currentThread().setContextClassLoader( oldLoader ); + } + + private static void initializeWagon( DefaultPlexusContainer container ) + throws ComponentLookupException, ComponentLifecycleException, IOException + { + WagonManager wagonManager = (WagonManager) container.lookup( WagonManager.ROLE ); + + Settings settings = getSettings( container ); + + try + { + Proxy proxy = settings.getActiveProxy(); + + if ( proxy != null ) + { + if ( proxy.getHost() == null ) + { + throw new IOException( "Proxy in settings.xml has no host" ); + } + + wagonManager.addProxy( proxy.getProtocol(), proxy.getHost(), proxy.getPort(), proxy.getUsername(), + proxy.getPassword(), proxy.getNonProxyHosts() ); + } + + for ( Iterator i = settings.getServers().iterator(); i.hasNext(); ) + { + Server server = (Server) i.next(); + + wagonManager.addAuthenticationInfo( server.getId(), server.getUsername(), server.getPassword(), + server.getPrivateKey(), server.getPassphrase() ); + + wagonManager.addPermissionInfo( server.getId(), server.getFilePermissions(), + server.getDirectoryPermissions() ); + + if ( server.getConfiguration() != null ) + { + wagonManager.addConfiguration( server.getId(), (Xpp3Dom) server.getConfiguration() ); + } + } + + RepositoryPermissions defaultPermissions = new RepositoryPermissions(); + + defaultPermissions.setDirectoryMode( "775" ); + + defaultPermissions.setFileMode( "664" ); + + wagonManager.setDefaultRepositoryPermissions( defaultPermissions ); + + for ( Iterator i = settings.getMirrors().iterator(); i.hasNext(); ) + { + Mirror mirror = (Mirror) i.next(); + + wagonManager.addMirror( mirror.getId(), mirror.getMirrorOf(), mirror.getUrl() ); + } + } + finally + { + container.release( wagonManager ); + } + } private static Collection<Artifact> downloadArtifact( PlexusContainer container, String groupId, String artifactId, From continuum-commits-returnrachel17@example.net Wed Nov 07 15:06:03 2007 Return-Path: <continuum-commits-returnrachel17@example.net> Delivered-To: rachel17@example.net Received: (qmail 24470 invoked from network); 7 Nov 2007 15:06:03 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 7 Nov 2007 15:06:03 -0000 Received: (qmail 70909 invoked by uid 500); 7 Nov 2007 15:05:51 -0000 Delivered-To: rachel17@example.net Received: (qmail 70857 invoked by uid 500); 7 Nov 2007 15:05:51 -0000 Mailing-List: contact rachel17@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:rachel17@example.net> List-Unsubscribe: <mailto:rachel17@example.net> List-Post: <mailto:rachel17@example.net> List-Id: <continuum-commits.maven.apache.org> Reply-To: rachel17@example.net Delivered-To: mailing list rachel17@example.net Received: (qmail 70844 invoked by uid 99); 7 Nov 2007 15:05:51 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Nov 2007 07:05:51 -0800 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Nov 2007 15:06:27 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id DB4451A9832; Wed, 7 Nov 2007 07:05:32 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r592774 - /maven/continuum/trunk/continuum-data-management/data-management-cli/src/main/java/org/apache/maven/continuum/management/DataManagementCli.java Date: Wed, 07 Nov 2007 15:05:32 -0000 To: rachel17@example.net From: rachel17@example.net X-Mailer: svnmailer-1.0.8 Message-Id: <rachel17@example.net> X-Virus-Checked: Checked by ClamAV on apache.org Author: evenisse Date: Wed Nov 7 07:05:32 2007 New Revision: 592774 URL: http://svn.apache.org/viewvc?rev=592774&view=rev Log: [CONTINUUM-1536] Load extra repositories from settings.xml Modified: maven/continuum/trunk/continuum-data-management/data-management-cli/src/main/java/org/apache/maven/continuum/management/DataManagementCli.java Modified: maven/continuum/trunk/continuum-data-management/data-management-cli/src/main/java/org/apache/maven/continuum/management/DataManagementCli.java URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-data-management/data-management-cli/src/main/java/org/apache/maven/continuum/management/DataManagementCli.java?rev=592774&r1=592773&r2=592774&view=diff ============================================================================== --- maven/continuum/trunk/continuum-data-management/data-management-cli/src/main/java/org/apache/maven/continuum/management/DataManagementCli.java (original) +++ maven/continuum/trunk/continuum-data-management/data-management-cli/src/main/java/org/apache/maven/continuum/management/DataManagementCli.java Wed Nov 7 07:05:32 2007 @@ -40,7 +40,9 @@ import org.apache.maven.artifact.resolver.filter.ExcludesArtifactFilter; import org.apache.maven.settings.MavenSettingsBuilder; import org.apache.maven.settings.Mirror; +import org.apache.maven.settings.Profile; import org.apache.maven.settings.Proxy; +import org.apache.maven.settings.Repository; import org.apache.maven.settings.Server; import org.apache.maven.settings.Settings; import org.apache.maven.wagon.repository.RepositoryPermissions; @@ -346,6 +348,23 @@ List<ArtifactRepository> remoteRepositories = new ArrayList<ArtifactRepository>(); remoteRepositories.add( factory.createArtifactRepository( "central", "http://repo1.maven.org/maven2", layout, null, null ) ); + //Load extra repositories from active profile + List<Profile> profiles = getSettings( container ).getActiveProfiles(); + if ( profiles != null && !profiles.isEmpty() ) + { + for ( Profile p : profiles ) + { + List<Repository> repos = p.getRepositories(); + if ( repos != null && !repos.isEmpty() ) + { + for ( Repository repo : repos ) + { + remoteRepositories.add( + factory.createArtifactRepository( repo.getId(), repo.getUrl(), layout, null, null ) ); + } + } + } + } ArtifactFactory artifactFactory = (ArtifactFactory) container.lookup( ArtifactFactory.ROLE ); Artifact artifact = From continuum-commits-returnrachel17@example.net Wed Nov 07 19:28:34 2007 Return-Path: <continuum-commits-returnrachel17@example.net> Delivered-To: rachel17@example.net Received: (qmail 50930 invoked from network); 7 Nov 2007 19:28:34 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 7 Nov 2007 19:28:34 -0000 Received: (qmail 23553 invoked by uid 500); 7 Nov 2007 19:28:22 -0000 Delivered-To: rachel17@example.net Received: (qmail 23521 invoked by uid 500); 7 Nov 2007 19:28:22 -0000 Mailing-List: contact rachel17@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:rachel17@example.net> List-Unsubscribe: <mailto:rachel17@example.net> List-Post: <mailto:rachel17@example.net> List-Id: <continuum-commits.maven.apache.org> Reply-To: rachel17@example.net Delivered-To: mailing list rachel17@example.net Received: (qmail 23507 invoked by uid 99); 7 Nov 2007 19:28:22 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Nov 2007 11:28:22 -0800 X-ASF-Spam-Status: No, hits=-98.0 required=10.0 tests=ALL_TRUSTED,URIBL_BLACK X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Nov 2007 19:28:44 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id A41181A9832; Wed, 7 Nov 2007 11:27:47 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r592861 - in /maven/continuum/trunk: continuum-api/src/main/java/org/apache/maven/continuum/ continuum-core/src/main/java/org/apache/maven/continuum/ continuum-xmlrpc/ continuum-xmlrpc/continuum-xmlrpc-api/src/main/java/org/apache/maven/con... Date: Wed, 07 Nov 2007 19:27:42 -0000 To: rachel17@example.net From: rachel17@example.net X-Mailer: svnmailer-1.0.8 Message-Id: <rachel17@example.net> X-Virus-Checked: Checked by ClamAV on apache.org Author: evenisse Date: Wed Nov 7 11:27:37 2007 New Revision: 592861 URL: http://svn.apache.org/viewvc?rev=592861&view=rev Log: Add xmlrpc backup tool Added: maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-api/src/main/resources/ maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-api/src/main/resources/dozerBeanMapping.xml (with props) maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-backup/ (with props) maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-backup/pom.xml (with props) maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-backup/src/ maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-backup/src/assembly/ maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-backup/src/assembly/app.xml (with props) maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-backup/src/main/ maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-backup/src/main/java/ maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-backup/src/main/java/org/ maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-backup/src/main/java/org/apache/ maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-backup/src/main/java/org/apache/maven/ maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-backup/src/main/java/org/apache/maven/continuum/ maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-backup/src/main/java/org/apache/maven/continuum/xmlrpc/ maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-backup/src/main/java/org/apache/maven/continuum/xmlrpc/backup/ maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-backup/src/main/java/org/apache/maven/continuum/xmlrpc/backup/Backup.java (with props) Modified: maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-api/src/main/java/org/apache/maven/continuum/xmlrpc/ContinuumService.java maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-api/src/main/mdo/continuum-service.xml maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-client/src/main/java/org/apache/maven/continuum/xmlrpc/client/ContinuumXmlRpcClient.java maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-client/src/main/java/org/apache/maven/continuum/xmlrpc/client/SampleClient.java maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-server/pom.xml maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-server/src/main/java/org/apache/maven/continuum/xmlrpc/server/ContinuumServiceImpl.java maven/continuum/trunk/continuum-xmlrpc/pom.xml Modified: maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java?rev=592861&r1=592860&r2=592861&view=diff ============================================================================== --- maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java (original) +++ maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java Wed Nov 7 11:27:37 2007 @@ -64,6 +64,8 @@ */ public Collection<ProjectGroup> getAllProjectGroupsWithProjects(); + public List<ProjectGroup> getAllProjectGroupsWithBuildDetails(); + public Collection<ProjectGroup> getAllProjectGroups(); public ProjectGroup getProjectGroupByProjectId( int projectId ) Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java?rev=592861&r1=592860&r2=592861&view=diff ============================================================================== --- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java (original) +++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java Wed Nov 7 11:27:37 2007 @@ -3021,7 +3021,11 @@ { // todo check why this interface isn't throwing exceptions on this guy return store.getAllProjectGroupsWithProjects(); + } + public List<ProjectGroup> getAllProjectGroupsWithBuildDetails() + { + return store.getAllProjectGroupsWithBuildDetails(); } public Collection<Project> getProjectsInGroup( int projectGroupId ) Modified: maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-api/src/main/java/org/apache/maven/continuum/xmlrpc/ContinuumService.java URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-api/src/main/java/org/apache/maven/continuum/xmlrpc/ContinuumService.java?rev=592861&r1=592860&r2=592861&view=diff ============================================================================== --- maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-api/src/main/java/org/apache/maven/continuum/xmlrpc/ContinuumService.java (original) +++ maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-api/src/main/java/org/apache/maven/continuum/xmlrpc/ContinuumService.java Wed Nov 7 11:27:37 2007 @@ -23,12 +23,15 @@ import org.apache.maven.continuum.xmlrpc.project.AddingResult; import org.apache.maven.continuum.xmlrpc.project.BuildDefinition; import org.apache.maven.continuum.xmlrpc.project.BuildResult; +import org.apache.maven.continuum.xmlrpc.project.BuildResultSummary; import org.apache.maven.continuum.xmlrpc.project.Project; import org.apache.maven.continuum.xmlrpc.project.ProjectGroup; import org.apache.maven.continuum.xmlrpc.project.ProjectGroupSummary; import org.apache.maven.continuum.xmlrpc.project.ProjectSummary; import org.apache.maven.continuum.xmlrpc.project.Schedule; +import org.apache.maven.continuum.xmlrpc.system.Installation; import org.apache.maven.continuum.xmlrpc.system.Profile; +import org.apache.maven.continuum.xmlrpc.system.SystemConfiguration; import org.apache.xmlrpc.XmlRpcException; import java.util.List; @@ -107,7 +110,17 @@ * @throws ContinuumException * @throws XmlRpcException */ - List getAllProjectGroups() + List<ProjectGroupSummary> getAllProjectGroups() + throws ContinuumException, XmlRpcException; + + /** + * Get all project groups with all details (project summaries, notifiers, build definitions). + * + * @return All project groups + * @throws ContinuumException + * @throws XmlRpcException + */ + List<ProjectGroup> getAllProjectGroupsWithAllDetails() throws ContinuumException, XmlRpcException; /** @@ -116,8 +129,9 @@ * @return All project groups * @throws ContinuumException * @throws XmlRpcException + * @deprecated */ - List getAllProjectGroupsWithProjects() + List<ProjectGroup> getAllProjectGroupsWithProjects() throws ContinuumException, XmlRpcException; /** @@ -337,7 +351,7 @@ * @throws ContinuumException * @throws XmlRpcException */ - List getBuildResultsForProject( int projectId ) + List<BuildResultSummary> getBuildResultsForProject( int projectId ) throws ContinuumException, XmlRpcException; /** @@ -486,7 +500,7 @@ * @throws ContinuumException * @throws XmlRpcException */ - List getSchedules() + List<Schedule> getSchedules() throws ContinuumException, XmlRpcException; /** @@ -533,7 +547,7 @@ * @throws ContinuumException * @throws XmlRpcException */ - List getProfiles() + List<Profile> getProfiles() throws ContinuumException, XmlRpcException; /** @@ -545,6 +559,38 @@ * @throws XmlRpcException */ Profile getProfile( int profileId ) + throws ContinuumException, XmlRpcException; + + // ---------------------------------------------------------------------- + // Installations + // ---------------------------------------------------------------------- + + /** + * Return the installations list. + * + * @return The installations list. + * @throws ContinuumException + * @throws XmlRpcException + */ + List<Installation> getInstallations() + throws ContinuumException, XmlRpcException; + + /** + * Return the installation defined by this id. + * + * @param installationId The installation id + * @return The installation. + * @throws ContinuumException + * @throws XmlRpcException + */ + Installation getInstallation( int installationId ) + throws ContinuumException, XmlRpcException; + + // ---------------------------------------------------------------------- + // SystemConfiguration + // ---------------------------------------------------------------------- + + SystemConfiguration getSystemConfiguration() throws ContinuumException, XmlRpcException; // ---------------------------------------------------------------------- Modified: maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-api/src/main/mdo/continuum-service.xml URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-api/src/main/mdo/continuum-service.xml?rev=592861&r1=592860&r2=592861&view=diff ============================================================================== --- maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-api/src/main/mdo/continuum-service.xml (original) +++ maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-api/src/main/mdo/continuum-service.xml Wed Nov 7 11:27:37 2007 @@ -189,7 +189,11 @@ <version>1.1.0+</version> <type>String</type> </field> - <!-- TODO, this is not exported over XMLRPC yet --> + <field> + <name>relativePath</name> + <version>1.1.0+</version> + <type>String</type> + </field> <field> <name>projectGroup</name> <version>1.1.0+</version> @@ -480,14 +484,6 @@ </association> </field> <field> - <name>changesSinceLastSuccess</name> - <version>1.1.0+</version> - <association> - <type>ChangeSet</type> - <multiplicity>*</multiplicity> - </association> - </field> - <field> <name>modifiedDependencies</name> <version>1.1.0+</version> <association> @@ -963,7 +959,65 @@ <name>name</name> <version>1.1.0+</version> <type>String</type> + </field> + <field> + <name>installationId</name> + <version>1.1.0+</version> + <type>int</type> <identifier>true</identifier> + </field> + </fields> + </class> + <class> + <name>SystemConfiguration</name> + <packageName>org.apache.maven.continuum.xmlrpc.system</packageName> + <version>1.0.9+</version> + <fields> + <field> + <name>guestAccountEnabled</name> + <version>1.0.9+</version> + <type>boolean</type> + <defaultValue>true</defaultValue> + </field> + <field> + <name>defaultScheduleDescription</name> + <version>1.0.9+</version> + <type>String</type> + <defaultValue>Run hourly</defaultValue> + </field> + <field> + <name>defaultScheduleCronExpression</name> + <version>1.0.9+</version> + <type>String</type> + <defaultValue>0 0 * * * ?</defaultValue> + </field> + <field> + <name>workingDirectory</name> + <version>1.0.9+</version> + <type>String</type> + <defaultValue>working-directory</defaultValue> + </field> + <field> + <name>buildOutputDirectory</name> + <version>1.0.9+</version> + <type>String</type> + <defaultValue>build-output-directory</defaultValue> + </field> + <field> + <name>deploymentRepositoryDirectory</name> + <version>1.0.9+</version> + <type>String</type> + </field> + <field> + <name>baseUrl</name> + <version>1.0.9+</version> + <type>String</type> + </field> + <field> + <name>initialized</name> + <version>1.0.9+</version> + <type>boolean</type> + <defaultValue>false</defaultValue> </field> </fields> </class> Added: maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-api/src/main/resources/dozerBeanMapping.xml URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-api/src/main/resources/dozerBeanMapping.xml?rev=592861&view=auto ============================================================================== --- maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-api/src/main/resources/dozerBeanMapping.xml (added) +++ maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-api/src/main/resources/dozerBeanMapping.xml Wed Nov 7 11:27:37 2007 @@ -0,0 +1,187 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE mappings PUBLIC "-//DOZER//DTD MAPPINGS//EN" + "http://dozer.sourceforge.net/dtd/dozerbeanmapping.dtd"> +<mappings> + <mapping> + <class-a>org.apache.maven.continuum.xmlrpc.project.ProjectGroupSummary</class-a> + <class-b>org.apache.maven.continuum.model.project.ProjectGroup</class-b> + </mapping> + + <mapping> + <class-a>org.apache.maven.continuum.xmlrpc.project.ProjectGroup</class-a> + <class-b>org.apache.maven.continuum.model.project.ProjectGroup</class-b> + <field> + <a>projects</a> + <b>projects</b> + <a-hint>org.apache.maven.continuum.xmlrpc.project.ProjectSummary</a-hint> + <b-hint>org.apache.maven.continuum.model.project.Project</b-hint> + </field> + <field> + <a>notifiers</a> + <b>notifiers</b> + <a-hint>org.apache.maven.continuum.xmlrpc.project.ProjectNotifier</a-hint> + <b-hint>org.apache.maven.continuum.model.project.ProjectNotifier</b-hint> + </field> + <field> + <a>buildDefinitions</a> + <b>buildDefinitions</b> + <a-hint>org.apache.maven.continuum.xmlrpc.project.BuildDefinition</a-hint> + <b-hint>org.apache.maven.continuum.model.project.BuildDefinition</b-hint> + </field> + </mapping> + + <mapping> + <class-a>org.apache.maven.continuum.xmlrpc.project.ProjectSummary</class-a> + <class-b>org.apache.maven.continuum.model.project.Project</class-b> + <field> + <a>projectGroup</a> + <b>projectGroup</b> + <a-hint>org.apache.maven.continuum.xmlrpc.project.ProjectGroupSummary</a-hint> + <b-hint>org.apache.maven.continuum.model.project.ProjectGroup</b-hint> + </field> + </mapping> + + <mapping> + <class-a>org.apache.maven.continuum.xmlrpc.project.Project</class-a> + <class-b>org.apache.maven.continuum.model.project.Project</class-b> + <field> + <a>projectGroup</a> + <b>projectGroup</b> + <a-hint>org.apache.maven.continuum.xmlrpc.project.ProjectGroupSummary</a-hint> + <b-hint>org.apache.maven.continuum.model.project.ProjectGroup</b-hint> + </field> + <field> + <a>developers</a> + <b>developers</b> + <a-hint>org.apache.maven.continuum.xmlrpc.project.ProjectDeveloper</a-hint> + <b-hint>org.apache.maven.continuum.model.project.ProjectDeveloper</b-hint> + </field> + <field> + <a>dependencies</a> + <b>dependencies</b> + <a-hint>org.apache.maven.continuum.xmlrpc.project.ProjectDependency</a-hint> + <b-hint>org.apache.maven.continuum.model.project.ProjectDependency</b-hint> + </field> + <field> + <a>notifiers</a> + <b>notifiers</b> + <a-hint>org.apache.maven.continuum.xmlrpc.project.ProjectNotifier</a-hint> + <b-hint>org.apache.maven.continuum.model.project.ProjectNotifier</b-hint> + </field> + <field> + <a>buildDefinitions</a> + <b>buildDefinitions</b> + <a-hint>org.apache.maven.continuum.xmlrpc.project.BuildDefinition</a-hint> + <b-hint>org.apache.maven.continuum.model.project.BuildDefinition</b-hint> + </field> + </mapping> + + <mapping> + <class-a>org.apache.maven.continuum.xmlrpc.project.ProjectDependency</class-a> + <class-b>org.apache.maven.continuum.model.project.ProjectDependency</class-b> + </mapping> + + <mapping> + <class-a>org.apache.maven.continuum.xmlrpc.project.ProjectNotifier</class-a> + <class-b>org.apache.maven.continuum.model.project.ProjectNotifier</class-b> + </mapping> + + <mapping> + <class-a>org.apache.maven.continuum.xmlrpc.project.ProjectDeveloper</class-a> + <class-b>org.apache.maven.continuum.model.project.ProjectDeveloper</class-b> + </mapping> + + <mapping> + <class-a>org.apache.maven.continuum.xmlrpc.project.BuildResultSummary</class-a> + <class-b>org.apache.maven.continuum.model.project.BuildResult</class-b> + <field> + <a>project</a> + <b>project</b> + <a-hint>org.apache.maven.continuum.xmlrpc.project.ProjectSummary</a-hint> + <b-hint>org.apache.maven.continuum.model.project.Project</b-hint> + </field> + <field> + <a>buildDefinition</a> + <b>buildDefinition</b> + <a-hint>org.apache.maven.continuum.xmlrpc.project.BuildDefinition</a-hint> + <b-hint>org.apache.maven.continuum.model.project.BuildDefinition</b-hint> + </field> + </mapping> + + <mapping> + <class-a>org.apache.maven.continuum.xmlrpc.project.BuildResult</class-a> + <class-b>org.apache.maven.continuum.model.project.BuildResult</class-b> + <field> + <a>scmResult</a> + <b>scmResult</b> + <a-hint>org.apache.maven.continuum.xmlrpc.scm.ScmResult</a-hint> + <b-hint>org.apache.maven.continuum.model.scm.ScmResult</b-hint> + </field> + <field> + <a>modifiedDependencies</a> + <b>modifiedDependencies</b> + <a-hint>org.apache.maven.continuum.xmlrpc.project.ProjectDependency</a-hint> + <b-hint>org.apache.maven.continuum.model.project.ProjectDependency</b-hint> + </field> + </mapping> + + <mapping> + <class-a>org.apache.maven.continuum.xmlrpc.project.Schedule</class-a> + <class-b>org.apache.maven.continuum.model.project.Schedule</class-b> + </mapping> + + <mapping> + <class-a>org.apache.maven.continuum.xmlrpc.scm.ScmResult</class-a> + <class-b>org.apache.maven.continuum.model.scm.ScmResult</class-b> + <field> + <a>changes</a> + <b>changes</b> + <a-hint>org.apache.maven.continuum.xmlrpc.scm.ChangeSet</a-hint> + <b-hint>org.apache.maven.continuum.model.scm.ChangeSet</b-hint> + </field> + </mapping> + + <mapping> + <class-a>org.apache.maven.continuum.xmlrpc.scm.ChangeSet</class-a> + <class-b>org.apache.maven.continuum.model.scm.ChangeSet</class-b> + <field> + <a>files</a> + <b>files</b> + <a-hint>org.apache.maven.continuum.xmlrpc.scm.ChangeFile</a-hint> + <b-hint>org.apache.maven.continuum.model.scm.ChangeFile</b-hint> + </field> + </mapping> + + <mapping> + <class-a>org.apache.maven.continuum.xmlrpc.scm.ChangeFile</class-a> + <class-b>org.apache.maven.continuum.model.scm.ChangeFile</class-b> + </mapping> + + <mapping> + <class-a>org.apache.maven.continuum.xmlrpc.system.Profile</class-a> + <class-b>org.apache.maven.continuum.model.system.Profile</class-b> + <field> + <a>jdk</a> + <b>jdk</b> + <a-hint>org.apache.maven.continuum.xmlrpc.system.Installation</a-hint> + <b-hint>org.apache.maven.continuum.model.system.Installation</b-hint> + </field> + <field> + <a>builder</a> + <b>builder</b> + <a-hint>org.apache.maven.continuum.xmlrpc.system.Installation</a-hint> + <b-hint>org.apache.maven.continuum.model.system.Installation</b-hint> + </field> + <field> + <a>environmentVariables</a> + <b>environmentVariables</b> + <a-hint>org.apache.maven.continuum.xmlrpc.system.Installation</a-hint> + <b-hint>org.apache.maven.continuum.model.system.Installation</b-hint> + </field> + </mapping> + + <mapping> + <class-a>org.apache.maven.continuum.xmlrpc.system.Installation</class-a> + <class-b>org.apache.maven.continuum.model.system.Installation</class-b> + </mapping> +</mappings> Propchange: maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-api/src/main/resources/dozerBeanMapping.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-api/src/main/resources/dozerBeanMapping.xml ------------------------------------------------------------------------------ svn:keywords = "Author Date Id Revision" Propchange: maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-backup/ ------------------------------------------------------------------------------ --- svn:ignore (added) +++ svn:ignore Wed Nov 7 11:27:37 2007 @@ -0,0 +1,2 @@ +target +*.iml Added: maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-backup/pom.xml URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-backup/pom.xml?rev=592861&view=auto ============================================================================== --- maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-backup/pom.xml (added) +++ maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-backup/pom.xml Wed Nov 7 11:27:37 2007 @@ -0,0 +1,91 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + ~ 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. + --> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + <parent> + <groupId>org.apache.maven.continuum</groupId> + <artifactId>continuum-xmlrpc</artifactId> + <version>1.1-beta-5-SNAPSHOT</version> + </parent> + <modelVersion>4.0.0</modelVersion> + <artifactId>continuum-xmlrpc-backup</artifactId> + <name>Continuum XMLRPC 888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4 Backup Tool</name> + + <dependencies> + <dependency> + <groupId>org.apache.maven.continuum</groupId> + <artifactId>continuum-xmlrpc-client</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>com.google.code.cli-parser</groupId> + <artifactId>cli</artifactId> + <version>7</version> + </dependency> + <dependency> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + </dependency> + </dependencies> + <build> + <plugins> + <!-- plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>exec-maven-plugin</artifactId> + <executions> + <execution> + <goals> + <goal>exec</goal> + </goals> + </execution> + </executions> + <configuration> + <executable>java</executable> + <arguments> + <argument>-classpath</argument> + <classpath /> + <argument>org.apache.maven.continuum.xmlrpc.backup.Backup</argument> + <argument>-h</argument> + </arguments> + </configuration> + </plugin --> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-assembly-plugin</artifactId> + <version>2.1</version> + <configuration> + <descriptor>src/assembly/app.xml</descriptor> + <archive> + <manifest> + <mainClass>org.apache.maven.continuum.xmlrpc.backup.Backup</mainClass> + </manifest> + </archive> + </configuration> + <executions> + <execution> + <phase>package</phase> + <goals> + <goal>single</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> +</project> \ No newline at end of file Propchange: maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-backup/pom.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-backup/pom.xml ------------------------------------------------------------------------------ svn:keywords = "Author Date Id Revision" Added: maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-backup/src/assembly/app.xml URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-backup/src/assembly/app.xml?rev=592861&view=auto ============================================================================== --- maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-backup/src/assembly/app.xml (added) +++ maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-backup/src/assembly/app.xml Wed Nov 7 11:27:37 2007 @@ -0,0 +1,35 @@ +<?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. + --> + +<assembly> + <id>app</id> + <formats> + <format>jar</format> + </formats> + <includeBaseDirectory>false</includeBaseDirectory> + <dependencySets> + <dependencySet> + <outputDirectory>/</outputDirectory> + <unpack>true</unpack> + <scope>runtime</scope> + </dependencySet> + </dependencySets> +</assembly> Propchange: maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-backup/src/assembly/app.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-backup/src/assembly/app.xml ------------------------------------------------------------------------------ svn:keywords = "Author Date Id Revision" Added: maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-backup/src/main/java/org/apache/maven/continuum/xmlrpc/backup/Backup.java URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-backup/src/main/java/org/apache/maven/continuum/xmlrpc/backup/Backup.java?rev=592861&view=auto ============================================================================== --- maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-backup/src/main/java/org/apache/maven/continuum/xmlrpc/backup/Backup.java (added) +++ maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-backup/src/main/java/org/apache/maven/continuum/xmlrpc/backup/Backup.java Wed Nov 7 11:27:37 2007 @@ -0,0 +1,633 @@ +package org.apache.maven.continuum.xmlrpc.backup; + +/* + * 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 com.sampullara.cli.Args; +import com.sampullara.cli.Argument; +import org.apache.log4j.BasicConfigurator; +import org.apache.log4j.Level; +import org.apache.log4j.Logger; +import org.apache.maven.continuum.xmlrpc.client.ContinuumXmlRpcClient; +import org.apache.maven.continuum.xmlrpc.project.BuildDefinition; +import org.apache.maven.continuum.xmlrpc.project.BuildResult; +import org.apache.maven.continuum.xmlrpc.project.BuildResultSummary; +import org.apache.maven.continuum.xmlrpc.project.Project; +import org.apache.maven.continuum.xmlrpc.project.ProjectDependency; +import org.apache.maven.continuum.xmlrpc.project.ProjectDeveloper; +import org.apache.maven.continuum.xmlrpc.project.ProjectGroup; +import org.apache.maven.continuum.xmlrpc.project.ProjectNotifier; +import org.apache.maven.continuum.xmlrpc.project.ProjectSummary; +import org.apache.maven.continuum.xmlrpc.project.Schedule; +import org.apache.maven.continuum.xmlrpc.scm.ChangeFile; +import org.apache.maven.continuum.xmlrpc.scm.ChangeSet; +import org.apache.maven.continuum.xmlrpc.scm.ScmResult; +import org.apache.maven.continuum.xmlrpc.system.Installation; +import org.apache.maven.continuum.xmlrpc.system.Profile; + +import java.io.File; +import java.io.FileWriter; +import java.io.IOException; +import java.io.PrintWriter; +import java.lang.reflect.Field; +import java.net.URL; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.Properties; +import java.util.Set; + +public class Backup +{ + private static final Logger LOGGER = Logger.getLogger( Backup.class ); + + private static ContinuumXmlRpcClient client; + + private static int indent = 0; + + private static PrintWriter writer; + + public static void main( String[] args ) + throws Exception + { + Commands command = new Commands(); + + try + { + Args.parse( command, args ); + + if ( command.help ) + { + Args.usage( command ); + return; + } + if ( command.version ) + { + System.out.println( "continuum-xmlrpc-backup version: " + getVersion() ); + return; + } + if ( command.url == null ) + { + System.out.println( "You must specified the Continuum XMLRPC URL" ); + Args.usage( command ); + return; + } + if ( command.username == null ) + { + System.out.println( "You must specified the Continuum username" ); + Args.usage( command ); + return; + } + if ( command.password == null ) + { + System.out.println( "You must specified the Continuum password" ); + Args.usage( command ); + return; + } + } + catch ( IllegalArgumentException e ) + { + System.err.println( e.getMessage() ); + Args.usage( command ); + return; + } + + BasicConfigurator.configure(); + if ( command.debug ) + { + Logger.getRootLogger().setLevel( Level.DEBUG ); + } + else + { + Logger.getRootLogger().setLevel( Level.INFO ); + } + + LOGGER.info( "Connection to " + command.url + "with username '" + command.username + "'..." ); + client = new ContinuumXmlRpcClient( command.url, command.username, command.password ); + LOGGER.info( "connected" ); + + File out = command.outputFile; + if ( out == null ) + { + out = new File( "backup/builds.xml" ); + } + + writer = new PrintWriter( new FileWriter( out ) ); + + writer.println( "<?xml version='1.0' encoding='UTF-8'?>" ); + startTag( "continuumDatabase", true ); + backupSystemConfiguration(); + backupAllSchedules(); + backupAllInstallations(); + backupAllProfiles(); + backupAllProjectGroup(); + endTag( "continuumDatabase", true ); + writer.close(); + LOGGER.info( "Done." ); + } + + private static String getVersion() + throws IOException + { + Properties properties = new Properties(); + properties.load( Backup.class.getResourceAsStream( + "/META-INF/maven/org.apache.maven.continuum/continuum-xmlrpc-backup/pom.properties" ) ); + return properties.getProperty( "version" ); + } + + private static class Commands + { + + @Argument(description = "Display help information", value = "help", alias = "h") + private boolean help; + + @Argument(description = "Display version information", value = "version", alias = "v") + private boolean version; + + @Argument(description = "Continuum XMLRPC URL", value = "url") + private URL url; + + @Argument(description = "Username", value = "username", alias = "u") + private String username; + + @Argument(description = "Password", value = "password", alias = "p") + private String password; + + @Argument(description = "Backup file", value = "outputFile", alias = "o") + private File outputFile; + + @Argument( + description = "Turn on debugging information. Default is off.", + value = "debug") + private boolean debug; + } + + private static void backupSystemConfiguration() + throws Exception + { + LOGGER.info( "Backup system configuration" ); + writeObject( client.getSystemConfiguration(), "systemConfiguration", true ); + } + + private static void backupAllSchedules() + throws Exception + { + LOGGER.info( "Backup schedules" ); + List<Schedule> schedules = client.getSchedules(); + if ( schedules != null && !schedules.isEmpty() ) + { + startTag( "schedules", true ); + for ( Schedule schedule : schedules ) + { + LOGGER.debug( "Backup schedule " + schedule.getName() ); + writeObject( schedule, "schedule", true ); + } + endTag( "schedules", true ); + } + } + + private static void backupAllInstallations() + throws Exception + { + LOGGER.info( "Backup installations" ); + List<Installation> installs = client.getInstallations(); + if ( installs != null && !installs.isEmpty() ) + { + startTag( "installations", true ); + for ( Installation install : installs ) + { + LOGGER.debug( "Backup installation " + install.getName() ); + writeObject( install, "installation", true ); + } + endTag( "installations", true ); + } + } + + private static void backupAllProfiles() + throws Exception + { + LOGGER.info( "Backup profiles" ); + List<Profile> profiles = client.getProfiles(); + if ( profiles != null && !profiles.isEmpty() ) + { + startTag( "profiles", true ); + for ( Profile p : profiles ) + { + LOGGER.debug( "Backup profile " + p.getName() ); + writeProfile( p ); + } + endTag( "profiles", true ); + } + } + + private static void backupAllProjectGroup() + throws Exception + { + LOGGER.info( "Backup project groups" ); + List<ProjectGroup> pgs = client.getAllProjectGroupsWithAllDetails(); + if ( pgs != null && !pgs.isEmpty() ) + { + startTag( "projectGroups", true ); + for ( ProjectGroup pg : pgs ) + { + backupProjectGroup( pg ); + } + endTag( "projectGroups", true ); + } + } + + private static void backupProjectGroup( ProjectGroup pg ) + throws Exception + { + if ( pg == null ) + { + return; + } + + LOGGER.debug( "Backup project group " + pg.getName() ); + startTag( "projectGroup", true ); + writeSimpleFields( pg ); + + if ( pg.getProjects() != null && !pg.getProjects().isEmpty() ) + { + startTag( "projects", true ); + for ( ProjectSummary ps : (List<ProjectSummary>) pg.getProjects() ) + { + backupProject( ps ); + } + endTag( "projects", true ); + } + + if ( pg.getBuildDefinitions() != null && !pg.getBuildDefinitions().isEmpty() ) + { + startTag( "buildDefinitions", true ); + for ( BuildDefinition bd : (List<BuildDefinition>) pg.getBuildDefinitions() ) + { + backupBuildDefinition( bd ); + } + endTag( "buildDefinitions", true ); + } + + if ( pg.getNotifiers() != null && !pg.getNotifiers().isEmpty() ) + { + startTag( "notifiers", true ); + for ( ProjectNotifier notif : (List<ProjectNotifier>) pg.getNotifiers() ) + { + backupNotifier( notif ); + } + endTag( "notifiers", true ); + } + + endTag( "projectGroup", true ); + } + + private static void backupProject( ProjectSummary ps ) + throws Exception + { + if ( ps == null ) + { + return; + } + + LOGGER.debug( "Backup project " + ps.getName() ); + + Project p = client.getProjectWithAllDetails( ps.getId() ); + startTag( "project", true ); + writeSimpleFields( p ); + + if ( p.getProjectGroup() != null ) + { + writeTagWithParameter( "projectGroup", "id", String.valueOf( p.getProjectGroup().getId() ) ); + } + + if ( p.getDevelopers() != null && !p.getDevelopers().isEmpty() ) + { + startTag( "developers", true ); + for ( ProjectDeveloper pd : (List<ProjectDeveloper>) p.getDevelopers() ) + { + writeObject( pd, "developer", true ); + } + endTag( "developers", true ); + } + + if ( p.getDependencies() != null && !p.getDependencies().isEmpty() ) + { + startTag( "dependencies", true ); + for ( ProjectDependency pd : (List<ProjectDependency>) p.getDependencies() ) + { + writeObject( pd, "dependency", true ); + } + endTag( "dependencies", true ); + } + + if ( p.getBuildDefinitions() != null && !p.getBuildDefinitions().isEmpty() ) + { + startTag( "buildDefinitions", true ); + for ( BuildDefinition bd : (List<BuildDefinition>) p.getBuildDefinitions() ) + { + backupBuildDefinition( bd ); + } + endTag( "buildDefinitions", true ); + } + + if ( p.getNotifiers() != null && !p.getNotifiers().isEmpty() ) + { + startTag( "notifiers", true ); + for ( ProjectNotifier notif : (List<ProjectNotifier>) p.getNotifiers() ) + { + backupNotifier( notif ); + } + endTag( "notifiers", true ); + } + + List<BuildResultSummary> brs = client.getBuildResultsForProject( p.getId() ); + if ( brs != null && !brs.isEmpty() ) + { + startTag( "buildResults", true ); + for ( BuildResultSummary brSummary : brs ) + { + BuildResult br = client.getBuildResult( p.getId(), brSummary.getId() ); + backupBuildResult( br ); + } + endTag( "buildResults", true ); + } + endTag( "project", true ); + } + + private static void backupBuildResult( BuildResult br ) + throws Exception + { + if ( br == null ) + { + return; + } + + startTag( "buildResult", true ); + writeSimpleFields( br ); + + if ( br.getProject() != null ) + { + writeTagWithParameter( "project", "id", String.valueOf( br.getProject().getId() ) ); + } + + if ( br.getBuildDefinition() != null ) + { + writeTagWithParameter( "buildDefinition", "id", String.valueOf( br.getBuildDefinition().getId() ) ); + } + + if ( br.getModifiedDependencies() != null && !br.getModifiedDependencies().isEmpty() ) + { + startTag( "dependencies", true ); + for ( ProjectDependency pd : (List<ProjectDependency>) br.getModifiedDependencies() ) + { + writeObject( pd, "dependency", true ); + } + endTag( "dependencies", true ); + } + endTag( "buildResult", true ); + } + + private static void writeSimpleFields( Object obj ) + throws Exception + { + if ( obj == null ) + { + return; + } + + for ( Field f : getFieldsIncludingSuperclasses( obj.getClass() ) ) + { + if ( "modelEncoding".equals( f.getName() ) ) + { + continue; + } + + if ( !f.isAccessible() ) + { + f.setAccessible( true ); + } + + if ( f.getType().getName().equals( "int" ) || f.getType().getName().equals( "long" ) || + f.getType().getName().equals( "boolean" ) || f.getType().getName().equals( "java.lang.String" ) ) + { + Object value = f.get( obj ); + if ( value != null ) + { + startTag( f.getName(), false ); + writer.print( value ); + endTag( f.getName(), false ); + } + } + /*else if ( BuildDefinition.class.getName().equals( f.getType().getName() ) ) + { + backupBuildDefinition( (BuildDefinition) f.get( obj ) ); + }*/ + else if ( ScmResult.class.getName().equals( f.getType().getName() ) ) + { + writeScmResult( (ScmResult) f.get( obj ) ); + } + else if ( ChangeFile.class.getName().equals( f.getType().getName() ) ) + { + writeObject( f.get( obj ), "changeFile", true ); + } + /*else if ( Schedule.class.getName().equals( f.getType().getName() ) ) + { + writeObject( f.get( obj ), "schedule", true ); + }*/ + else if ( Profile.class.getName().equals( f.getType().getName() ) ) + { + writeProfile( (Profile) f.get( obj ) ); + } + else + { + writer.println( "Rejected: (" + f.getName() + ") " + f.getType() ); + } + } + } + + private static void writeObject( Object obj, String tagName, boolean addNewLine ) + throws Exception + { + if ( obj == null ) + { + return; + } + startTag( tagName, addNewLine ); + writeSimpleFields( obj ); + endTag( tagName, addNewLine ); + } + + private static void backupBuildDefinition( BuildDefinition buildDef ) + throws Exception + { + if ( buildDef == null ) + { + return; + } + startTag( "buildDefinition", true ); + writeSimpleFields( buildDef ); + if ( buildDef.getSchedule() != null ) + { + writeTagWithParameter( "schedule", "id", String.valueOf( buildDef.getSchedule().getId() ) ); + } + endTag( "buildDefinition", true ); + } + + private static void backupNotifier( ProjectNotifier notifier ) + throws Exception + { + startTag( "notifier", true ); + writeSimpleFields( notifier ); + + Map conf = notifier.getConfiguration(); + startTag( "configuration", true ); + for ( String key : (Set<String>) conf.keySet() ) + { + startTag( key, false ); + writer.print( conf.get( key ) ); + endTag( key, false ); + } + endTag( "configuration", true ); + + endTag( "notifier", true ); + } + + private static void writeProfile( Profile profile ) + throws Exception + { + if ( profile == null ) + { + return; + } + + startTag( "profile", true ); + writeSimpleFields( profile ); + + if ( profile.getEnvironmentVariables() != null && !profile.getEnvironmentVariables().isEmpty() ) + { + startTag( "environmentVariables", true ); + for ( Installation env : (List<Installation>) profile.getEnvironmentVariables() ) + { + writeTagWithParameter( "environmentVariable", "installationId", + String.valueOf( env.getInstallationId() ) ); + } + endTag( "environmentVariables", true ); + } + + if ( profile.getJdk() != null ) + { + writeTagWithParameter( "jdk", "installationId", String.valueOf( profile.getJdk().getInstallationId() ) ); + } + + if ( profile.getBuilder() != null ) + { + writeTagWithParameter( "builder", "installationId", + String.valueOf( profile.getBuilder().getInstallationId() ) ); + } + + endTag( "profile", true ); + } + + private static void writeScmResult( ScmResult scmResult ) + throws Exception + { + if ( scmResult == null ) + { + return; + } + + startTag( "scmResult", true ); + writeSimpleFields( scmResult ); + + if ( scmResult.getChanges() != null && !scmResult.getChanges().isEmpty() ) + { + startTag( "changeSets", true ); + for ( ChangeSet cs : (List<ChangeSet>) scmResult.getChanges() ) + { + writeObject( cs, "changeSet", true ); + } + endTag( "changeSets", true ); + } + endTag( "scmResult", true ); + } + + private static void startTag( String tagName, boolean addNewLineAfter ) + { + writer.print( getIndent() ); + writer.print( "<" ); + writer.print( tagName ); + writer.print( ">" ); + if ( addNewLineAfter ) + { + writer.println(); + indent++; + } + } + + private static void endTag( String tagName, boolean isOnNewLine ) + { + if ( isOnNewLine ) + { + indent--; + writer.print( getIndent() ); + } + writer.print( "</" ); + writer.print( tagName ); + writer.println( ">" ); + } + + private static void writeTagWithParameter( String tagName, String parameterName, String parameterValue ) + { + writer.print( getIndent() ); + writer.print( "<" ); + writer.print( tagName ); + writer.print( " " ); + writer.print( parameterName ); + writer.print( "=\"" ); + writer.print( parameterValue ); + writer.print( "\"></" ); + writer.print( tagName ); + writer.println( ">" ); + } + + private static String getIndent() + { + String result = ""; + for ( int i = 0; i < indent; i++ ) + { + result += " "; + } + return result; + } + + private static List<Field> getFieldsIncludingSuperclasses( Class clazz ) + { + List<Field> fields = new ArrayList<Field>( Arrays.asList( clazz.getDeclaredFields() ) ); + + Class superclass = clazz.getSuperclass(); + + if ( superclass != null ) + { + fields.addAll( getFieldsIncludingSuperclasses( superclass ) ); + } + + return fields; + } +} Propchange: maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-backup/src/main/java/org/apache/maven/continuum/xmlrpc/backup/Backup.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-backup/src/main/java/org/apache/maven/continuum/xmlrpc/backup/Backup.java ------------------------------------------------------------------------------ svn:keywords = "Author Date Id Revision" Modified: maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-client/src/main/java/org/apache/maven/continuum/xmlrpc/client/ContinuumXmlRpcClient.java URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-client/src/main/java/org/apache/maven/continuum/xmlrpc/client/ContinuumXmlRpcClient.java?rev=592861&r1=592860&r2=592861&view=diff ============================================================================== --- maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-client/src/main/java/org/apache/maven/continuum/xmlrpc/client/ContinuumXmlRpcClient.java (original) +++ maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-client/src/main/java/org/apache/maven/continuum/xmlrpc/client/ContinuumXmlRpcClient.java Wed Nov 7 11:27:37 2007 @@ -24,13 +24,16 @@ import org.apache.maven.continuum.xmlrpc.project.AddingResult; import org.apache.maven.continuum.xmlrpc.project.BuildDefinition; import org.apache.maven.continuum.xmlrpc.project.BuildResult; +import org.apache.maven.continuum.xmlrpc.project.BuildResultSummary; import org.apache.maven.continuum.xmlrpc.project.ContinuumProjectState; import org.apache.maven.continuum.xmlrpc.project.Project; import org.apache.maven.continuum.xmlrpc.project.ProjectGroup; import org.apache.maven.continuum.xmlrpc.project.ProjectGroupSummary; import org.apache.maven.continuum.xmlrpc.project.ProjectSummary; import org.apache.maven.continuum.xmlrpc.project.Schedule; +import org.apache.maven.continuum.xmlrpc.system.Installation; import org.apache.maven.continuum.xmlrpc.system.Profile; +import org.apache.maven.continuum.xmlrpc.system.SystemConfiguration; import org.apache.xmlrpc.XmlRpcException; import org.apache.xmlrpc.client.XmlRpcClient; import org.apache.xmlrpc.client.XmlRpcClientConfigImpl; @@ -199,7 +202,7 @@ // Projects Groups // ---------------------------------------------------------------------- - public List getAllProjectGroups() + public List<ProjectGroupSummary> getAllProjectGroups() throws ContinuumException { try @@ -212,12 +215,12 @@ } } - public List getAllProjectGroupsWithProjects() + public List<ProjectGroup> getAllProjectGroupsWithAllDetails() throws ContinuumException { try { - return continuum.getAllProjectGroupsWithProjects(); + return continuum.getAllProjectGroupsWithAllDetails(); } catch ( Exception e ) { @@ -225,6 +228,12 @@ } } + public List<ProjectGroup> getAllProjectGroupsWithProjects() + throws ContinuumException + { + return getAllProjectGroupsWithAllDetails(); + } + public ProjectGroupSummary getProjectGroupSummary( int projectGroupId ) throws ContinuumException { @@ -491,7 +500,7 @@ } } - public List getBuildResultsForProject( int projectId ) + public List<BuildResultSummary> getBuildResultsForProject( int projectId ) throws ContinuumException { try @@ -654,7 +663,7 @@ // Schedules // ---------------------------------------------------------------------- - public List getSchedules() + public List<Schedule> getSchedules() throws ContinuumException { try @@ -710,7 +719,7 @@ // Profiles // ---------------------------------------------------------------------- - public List getProfiles() + public List<Profile> getProfiles() throws ContinuumException { try @@ -729,6 +738,53 @@ try { return continuum.getProfile( profileId ); + } + catch ( Exception e ) + { + throw new ContinuumException( "The remote method failed.", e ); + } + } + + // ---------------------------------------------------------------------- + // Installations + // ---------------------------------------------------------------------- + + public List<Installation> getInstallations() + throws ContinuumException + { + try + { + return continuum.getInstallations(); + } + catch ( Exception e ) + { + throw new ContinuumException( "The remote method failed.", e ); + } + } + + public Installation getInstallation( int installationId ) + throws ContinuumException + { + try + { + return continuum.getInstallation( installationId ); + } + catch ( Exception e ) + { + throw new ContinuumException( "The remote method failed.", e ); + } + } + + // ---------------------------------------------------------------------- + // SystemConfiguration + // ---------------------------------------------------------------------- + + public SystemConfiguration getSystemConfiguration() + throws ContinuumException + { + try + { + return continuum.getSystemConfiguration(); } catch ( Exception e ) { Modified: maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-client/src/main/java/org/apache/maven/continuum/xmlrpc/client/SampleClient.java URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-client/src/main/java/org/apache/maven/continuum/xmlrpc/client/SampleClient.java?rev=592861&r1=592860&r2=592861&view=diff ============================================================================== --- maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-client/src/main/java/org/apache/maven/continuum/xmlrpc/client/SampleClient.java (original) +++ maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-client/src/main/java/org/apache/maven/continuum/xmlrpc/client/SampleClient.java Wed Nov 7 11:27:37 2007 @@ -193,15 +193,6 @@ System.out.println( "Scm Result:" ); printScmResult( result.getScmResult() ); } - - if ( result.getChangesSinceLastSuccess() != null ) - { - System.out.println( "Changes since last success:" ); - for ( Iterator i = result.getChangesSinceLastSuccess().iterator(); i.hasNext(); ) - { - printChangeSet( (ChangeSet) i.next() ); - } - } } public static void printDependency( ProjectDependency dep ) Modified: maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-server/pom.xml URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-server/pom.xml?rev=592861&r1=592860&r2=592861&view=diff ============================================================================== --- maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-server/pom.xml (original) +++ maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-server/pom.xml Wed Nov 7 11:27:37 2007 @@ -53,6 +53,11 @@ <artifactId>xmlrpc-server</artifactId> <version>3.0</version> </dependency> + <dependency> + <groupId>net.sf.dozer</groupId> + <artifactId>dozer</artifactId> + <version>4.0</version> + </dependency> </dependencies> <build> Modified: maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-server/src/main/java/org/apache/maven/continuum/xmlrpc/server/ContinuumServiceImpl.java URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-server/src/main/java/org/apache/maven/continuum/xmlrpc/server/ContinuumServiceImpl.java?rev=592861&r1=592860&r2=592861&view=diff ============================================================================== --- maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-server/src/main/java/org/apache/maven/continuum/xmlrpc/server/ContinuumServiceImpl.java (original) +++ maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-server/src/main/java/org/apache/maven/continuum/xmlrpc/server/ContinuumServiceImpl.java Wed Nov 7 11:27:37 2007 @@ -19,29 +19,29 @@ * under the License. */ +import net.sf.dozer.util.mapping.DozerBeanMapperSingletonWrapper; +import net.sf.dozer.util.mapping.MapperIF; import org.apache.maven.continuum.Continuum; import org.apache.maven.continuum.ContinuumException; import org.apache.maven.continuum.execution.ContinuumBuildExecutorConstants; +import org.apache.maven.continuum.installation.InstallationException; import org.apache.maven.continuum.project.ContinuumProjectState; import org.apache.maven.continuum.project.builder.ContinuumProjectBuildingResult; import org.apache.maven.continuum.security.ContinuumRoleConstants; +import org.apache.maven.continuum.store.ContinuumStore; +import org.apache.maven.continuum.store.ContinuumStoreException; import org.apache.maven.continuum.xmlrpc.project.AddingResult; import org.apache.maven.continuum.xmlrpc.project.BuildDefinition; import org.apache.maven.continuum.xmlrpc.project.BuildResult; import org.apache.maven.continuum.xmlrpc.project.BuildResultSummary; import org.apache.maven.continuum.xmlrpc.project.Project; -import org.apache.maven.continuum.xmlrpc.project.ProjectDependency; -import org.apache.maven.continuum.xmlrpc.project.ProjectDeveloper; import org.apache.maven.continuum.xmlrpc.project.ProjectGroup; import org.apache.maven.continuum.xmlrpc.project.ProjectGroupSummary; -import org.apache.maven.continuum.xmlrpc.project.ProjectNotifier; import org.apache.maven.continuum.xmlrpc.project.ProjectSummary; import org.apache.maven.continuum.xmlrpc.project.Schedule; -import org.apache.maven.continuum.xmlrpc.scm.ChangeFile; -import org.apache.maven.continuum.xmlrpc.scm.ChangeSet; -import org.apache.maven.continuum.xmlrpc.scm.ScmResult; import org.apache.maven.continuum.xmlrpc.system.Installation; import org.apache.maven.continuum.xmlrpc.system.Profile; +import org.apache.maven.continuum.xmlrpc.system.SystemConfiguration; import org.codehaus.plexus.redback.authorization.AuthorizationException; import org.codehaus.plexus.redback.role.RoleManager; import org.codehaus.plexus.redback.role.RoleManagerException; @@ -49,10 +49,8 @@ import java.util.ArrayList; import java.util.Collection; -import java.util.HashMap; import java.util.Iterator; import java.util.List; -import java.util.Map; /** * @author <a href="mailto:rachel17@example.net">Emmanuel Venisse</a> @@ -62,12 +60,19 @@ public class ContinuumServiceImpl extends AbstractContinuumSecureService { + private static MapperIF mapper = DozerBeanMapperSingletonWrapper.getInstance(); + /** * @plexus.requirement */ private Continuum continuum; /** + * @plexus.requirement role-hint="jdo" + */ + private ContinuumStore store; + + /** * @plexus.requirement role-hint="default" */ private RoleManager roleManager; @@ -162,15 +167,13 @@ // Projects Groups // ---------------------------------------------------------------------- - public List getAllProjectGroups() + public List<ProjectGroupSummary> getAllProjectGroups() throws ContinuumException { - Collection pgList = continuum.getAllProjectGroups(); - List result = new ArrayList(); - for ( Iterator i = pgList.iterator(); i.hasNext(); ) + Collection<org.apache.maven.continuum.model.project.ProjectGroup> pgList = continuum.getAllProjectGroups(); + List<ProjectGroupSummary> result = new ArrayList<ProjectGroupSummary>(); + for ( org.apache.maven.continuum.model.project.ProjectGroup projectGroup : pgList ) { - org.apache.maven.continuum.model.project.ProjectGroup projectGroup = - (org.apache.maven.continuum.model.project.ProjectGroup) i.next(); try { if ( isAuthorized( ContinuumRoleConstants.CONTINUUM_VIEW_GROUP_OPERATION, projectGroup.getName() ) ) @@ -186,20 +189,19 @@ return result; } - public List getAllProjectGroupsWithProjects() + public List<ProjectGroup> getAllProjectGroupsWithAllDetails() throws ContinuumException { - Collection pgList = continuum.getAllProjectGroupsWithProjects(); - List result = new ArrayList(); - for ( Iterator i = pgList.iterator(); i.hasNext(); ) + Collection<org.apache.maven.continuum.model.project.ProjectGroup> pgList = + continuum.getAllProjectGroupsWithBuildDetails(); + List<ProjectGroup> result = new ArrayList<ProjectGroup>(); + for ( org.apache.maven.continuum.model.project.ProjectGroup projectGroup : pgList ) { - org.apache.maven.continuum.model.project.ProjectGroup projectGroup = - (org.apache.maven.continuum.model.project.ProjectGroup) i.next(); try { if ( isAuthorized( ContinuumRoleConstants.CONTINUUM_VIEW_GROUP_OPERATION, projectGroup.getName() ) ) { - result.add( populateProjectGroupWithProjects( projectGroup ) ); + result.add( populateProjectGroupWithAllDetails( projectGroup ) ); } } catch ( AuthorizationException e ) @@ -210,6 +212,12 @@ return result; } + public List<ProjectGroup> getAllProjectGroupsWithProjects() + throws ContinuumException + { + return getAllProjectGroupsWithAllDetails(); + } + protected String getProjectGroupName( int projectGroupId ) throws ContinuumException { @@ -242,7 +250,7 @@ org.apache.maven.continuum.model.project.ProjectGroup projectGroup = continuum.getProjectGroupWithProjects( projectGroupId ); - return populateProjectGroupWithProjects( projectGroup ); + return populateProjectGroupWithAllDetails( projectGroup ); } public int removeProjectGroup( int projectGroupId ) @@ -481,20 +489,18 @@ return populateBuildResult( continuum.getBuildResult( buildId ) ); } - public List getBuildResultsForProject( int projectId ) + public List<BuildResultSummary> getBuildResultsForProject( int projectId ) throws ContinuumException { ProjectSummary ps = getProjectSummary( projectId ); checkViewProjectGroupAuthorization( ps.getProjectGroup().getName() ); - List result = new ArrayList(); + List<BuildResultSummary> result = new ArrayList<BuildResultSummary>(); Collection buildResults = continuum.getBuildResultsForProject( projectId ); if ( buildResults != null ) { - for ( Iterator i = buildResults.iterator(); i.hasNext(); ) + for ( org.apache.maven.continuum.model.project.BuildResult buildResult : (List<org.apache.maven.continuum.model.project.BuildResult>) buildResults ) { - org.apache.maven.continuum.model.project.BuildResult buildResult = - (org.apache.maven.continuum.model.project.BuildResult) i.next(); BuildResultSummary br = populateBuildResultSummary( buildResult ); result.add( br ); } @@ -617,15 +623,15 @@ // Schedules // ---------------------------------------------------------------------- - public List getSchedules() + public List<Schedule> getSchedules() throws ContinuumException { Collection schedules = continuum.getSchedules(); - List s = new ArrayList(); - for ( Iterator i = schedules.iterator(); i.hasNext(); ) + List<Schedule> s = new ArrayList<Schedule>(); + for ( Object schedule : schedules ) { - s.add( populateSchedule( (org.apache.maven.continuum.model.project.Schedule) i.next() ) ); + s.add( populateSchedule( (org.apache.maven.continuum.model.project.Schedule) schedule ) ); } return s; @@ -661,15 +667,15 @@ // Profiles // ---------------------------------------------------------------------- - public List getProfiles() + public List<Profile> getProfiles() throws ContinuumException { Collection profiles = continuum.getProfileService().getAllProfiles(); - List p = new ArrayList(); - for ( Iterator i = profiles.iterator(); i.hasNext(); ) + List<Profile> p = new ArrayList<Profile>(); + for ( Object profile : profiles ) { - p.add( populateProfile( (org.apache.maven.continuum.model.system.Profile) i.next() ) ); + p.add( populateProfile( (org.apache.maven.continuum.model.system.Profile) profile ) ); } return p; @@ -682,130 +688,75 @@ } // ---------------------------------------------------------------------- - // Converters + // Installations // ---------------------------------------------------------------------- - private ProjectSummary populateProjectSummary( org.apache.maven.continuum.model.project.Project project ) + public List<Installation> getInstallations() + throws ContinuumException { - if ( project == null ) + try { - return null; - } + List<org.apache.maven.continuum.model.system.Installation> installs = + continuum.getInstallationService().getAllInstallations(); - ProjectSummary ps = new Project(); - ps.setArtifactId( project.getArtifactId() ); - ps.setBuildNumber( project.getBuildNumber() ); - ps.setDescription( project.getDescription() ); - ps.setExecutorId( project.getExecutorId() ); - ps.setGroupId( project.getGroupId() ); - ps.setId( project.getId() ); - ps.setLatestBuildId( project.getLatestBuildId() ); - ps.setName( project.getName() ); - ps.setProjectGroup( populateProjectGroupSummary( project.getProjectGroup() ) ); - ps.setScmTag( project.getScmTag() ); - ps.setScmUrl( project.getScmUrl() ); - ps.setScmUseCache( project.isScmUseCache() ); - ps.setScmUsername( project.getScmUsername() ); - ps.setState( project.getState() ); - ps.setUrl( project.getUrl() ); - ps.setVersion( project.getVersion() ); - ps.setWorkingDirectory( project.getWorkingDirectory() ); - return ps; + List<Installation> i = new ArrayList<Installation>(); + for ( Object install : installs ) + { + i.add( populateInstallation( (org.apache.maven.continuum.model.system.Installation) install ) ); + } + return i; + } + catch ( InstallationException e ) + { + throw new ContinuumException( "Can't load installations", e ); + } } - private Project populateProject( org.apache.maven.continuum.model.project.Project project ) + public Installation getInstallation( int installationId ) + throws ContinuumException { - if ( project == null ) + try { - return null; + org.apache.maven.continuum.model.system.Installation install = + continuum.getInstallationService().getInstallation( installationId ); + return populateInstallation( install ); } - - Project p = (Project) populateProjectSummary( project ); - - p.setParent( populateProjectDependency( project.getParent() ) ); - - if ( project.getDependencies() != null ) + catch ( InstallationException e ) { - List deps = new ArrayList(); - for ( Iterator i = project.getDependencies().iterator(); i.hasNext(); ) - { - org.apache.maven.continuum.model.project.ProjectDependency d = - (org.apache.maven.continuum.model.project.ProjectDependency) i.next(); - deps.add( populateProjectDependency( d ) ); - } - p.setDependencies( deps ); + throw new ContinuumException( "Can't load installations", e ); } + } - //TODO: p.setBuildDefinitions( ); + // ---------------------------------------------------------------------- + // SystemConfiguration + // ---------------------------------------------------------------------- - if ( project.getDevelopers() != null ) + public SystemConfiguration getSystemConfiguration() + throws ContinuumException + { + try { - for ( Iterator i = project.getDevelopers().iterator(); i.hasNext(); ) - { - org.apache.maven.continuum.model.project.ProjectDeveloper developer = - (org.apache.maven.continuum.model.project.ProjectDeveloper) i.next(); - p.addDeveloper( populateProjectDeveloper( developer ) ); - } + org.apache.maven.continuum.model.system.SystemConfiguration sysConf = store.getSystemConfiguration(); + return populateSystemConfiguration( sysConf ); } - - if ( project.getNotifiers() != null ) + catch ( ContinuumStoreException e ) { - for ( Iterator i = project.getNotifiers().iterator(); i.hasNext(); ) - { - org.apache.maven.continuum.model.project.ProjectNotifier notifier = - (org.apache.maven.continuum.model.project.ProjectNotifier) i.next(); - p.addNotifier( populateProjectNotifier( notifier ) ); - } + throw new ContinuumException( "Can't get SystemConfiguration.", e ); } - - return p; } - private ProjectDeveloper populateProjectDeveloper( - org.apache.maven.continuum.model.project.ProjectDeveloper developer ) - { - if ( developer == null ) - { - return null; - } + // ---------------------------------------------------------------------- + // Converters + // ---------------------------------------------------------------------- - ProjectDeveloper res = new ProjectDeveloper(); - res.setContinuumId( developer.getContinuumId() ); - res.setEmail( developer.getEmail() ); - res.setName( developer.getName() ); - res.setScmId( developer.getScmId() ); - return res; + private ProjectSummary populateProjectSummary( org.apache.maven.continuum.model.project.Project project ) + { + return (ProjectSummary) mapper.map( project, ProjectSummary.class ); } - private ProjectNotifier populateProjectNotifier( org.apache.maven.continuum.model.project.ProjectNotifier notifier ) + private Project populateProject( org.apache.maven.continuum.model.project.Project project ) { - if ( notifier == null ) - { - return null; - } - - ProjectNotifier res = new ProjectNotifier(); - res.setEnabled( notifier.isEnabled() ); - res.setFrom( notifier.getFrom() ); - res.setId( notifier.getId() ); - res.setRecipientType( notifier.getRecipientType() ); - res.setSendOnError( notifier.isSendOnError() ); - res.setSendOnFailure( notifier.isSendOnFailure() ); - res.setSendOnSuccess( notifier.isSendOnSuccess() ); - res.setSendOnWarning( notifier.isSendOnWarning() ); - res.setType( notifier.getType() ); - - if ( notifier.getConfiguration() != null ) - { - Map conf = new HashMap(); - for ( Iterator i = notifier.getConfiguration().keySet().iterator(); i.hasNext(); ) - { - String key = (String) i.next(); - conf.put( key, notifier.getConfiguration().get( key ) ); - } - res.setConfiguration( conf ); - } - return res; + return (Project) mapper.map( project, Project.class ); } private org.apache.maven.continuum.model.project.Project populateProject( ProjectSummary projectSummary ) @@ -837,35 +788,10 @@ return project; } - private ProjectDependency populateProjectDependency( - org.apache.maven.continuum.model.project.ProjectDependency dependency ) - { - if ( dependency == null ) - { - return null; - } - - ProjectDependency dep = new ProjectDependency(); - dep.setArtifactId( dependency.getArtifactId() ); - dep.setGroupId( dependency.getGroupId() ); - dep.setVersion( dependency.getVersion() ); - return dep; - } - private ProjectGroupSummary populateProjectGroupSummary( org.apache.maven.continuum.model.project.ProjectGroup group ) { - if ( group == null ) - { - return null; - } - - ProjectGroupSummary g = new ProjectGroup(); - g.setDescription( group.getDescription() ); - g.setGroupId( group.getGroupId() ); - g.setId( group.getId() ); - g.setName( group.getName() ); - return g; + return (ProjectGroupSummary) mapper.map( group, ProjectGroupSummary.class ); } private org.apache.maven.continuum.model.project.ProjectGroup populateProjectGroupSummary( @@ -885,84 +811,22 @@ return g; } - private ProjectGroup populateProjectGroupWithProjects( org.apache.maven.continuum.model.project.ProjectGroup group ) + private ProjectGroup
{'source': 'Apache Software Foundation Public Mail Archives'}