Skip to content
Browse files

merging trunk to transient-state branch -r 690852:708342

  • Loading branch information...
1 parent b7fe302 commit 75027175e455c3f00e89210b87445bd4422c4c4b Maria Catherine R. Tan committed
Showing with 5,108 additions and 624 deletions.
  1. +1 −1 continuum-api/pom.xml
  2. +11 −0 continuum-api/src/main/java/org/apache/continuum/configuration/GeneralConfiguration.java
  3. +9 −0 continuum-api/src/main/java/org/apache/continuum/dao/BuildResultDao.java
  4. +50 −0 continuum-api/src/main/java/org/apache/continuum/dao/ContinuumReleaseResultDao.java
  5. +3 −0 continuum-api/src/main/java/org/apache/continuum/taskqueue/manager/TaskQueueManager.java
  6. +23 −54 continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java
  7. +12 −0 continuum-api/src/main/java/org/apache/maven/continuum/configuration/ConfigurationService.java
  8. +19 −0 continuum-api/src/main/java/org/apache/maven/continuum/release/ContinuumReleaseManager.java
  9. +1 −1 continuum-base/continuum-configuration/pom.xml
  10. +11 −0 ...configuration/src/main/java/org/apache/continuum/configuration/DefaultContinuumConfiguration.java
  11. +6 −1 continuum-base/continuum-configuration/src/main/mdo/continuum-configuration.xml
  12. +1 −1 continuum-base/continuum-scm/pom.xml
  13. +1 −1 continuum-base/pom.xml
  14. +12 −1 continuum-commons/pom.xml
  15. +4 −1 ...ontinuum-commons/src/main/java/org/apache}/continuum/installation/DefaultInstallationService.java
  16. +12 −2 .../maven → continuum-commons/src/main/java/org/apache}/continuum/profile/DefaultProfileService.java
  17. +71 −2 ... continuum-commons/src/main/java/org/apache}/continuum/utils/shell/DefaultShellCommandHelper.java
  18. +1 −1 ...he/maven → continuum-commons/src/main/java/org/apache}/continuum/utils/shell/ExecutionResult.java
  19. +13 −2 ...maven → continuum-commons/src/main/java/org/apache}/continuum/utils/shell/ShellCommandHelper.java
  20. +93 −0 ...m-commons/src/main/java/org/apache/maven/continuum/configuration/DefaultConfigurationService.java
  21. +1 −1 continuum-commons/src/main/resources/META-INF/spring-context.xml
  22. +3 −1 ...nuum-commons/src/test/java/org/apache}/continuum/installation/DefaultInstallationServiceTest.java
  23. +3 −1 ...en → continuum-commons/src/test/java/org/apache}/continuum/profile/DefaultProfileServiceTest.java
  24. +11 −1 continuum-core/pom.xml
  25. +14 −0 continuum-core/src/main/java/org/apache/continuum/repository/DefaultRepositoryService.java
  26. +26 −2 continuum-core/src/main/java/org/apache/continuum/taskqueue/manager/DefaultTaskQueueManager.java
  27. +150 −10 continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
  28. +21 −13 continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/DefaultBuildController.java
  29. +2 −2 continuum-core/src/main/java/org/apache/maven/continuum/execution/AbstractBuildExecutor.java
  30. +1 −1 ...re/src/main/java/org/apache/maven/continuum/execution/maven/m1/DefaultMavenOneMetadataHelper.java
  31. +18 −1 ...inuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/MavenTwoBuildExecutor.java
  32. +61 −38 continuum-core/src/main/java/org/apache/maven/continuum/notification/mail/MailContinuumNotifier.java
  33. +55 −33 ...ore/src/main/java/org/apache/maven/continuum/project/builder/AbstractContinuumProjectBuilder.java
  34. +1 −0 continuum-core/src/main/resources/META-INF/spring-context.xml
  35. +5 −0 continuum-core/src/main/resources/org/apache/maven/continuum/notification/mail/templates/common.vm
  36. +63 −0 continuum-core/src/test/java/org/apache/continuum/notification/mail/MockJavaMailSender.java
  37. +36 −1 continuum-core/src/test/java/org/apache/maven/continuum/DefaultContinuumTest.java
  38. +76 −1 ...uum-core/src/test/java/org/apache/maven/continuum/buildcontroller/DefaultBuildControllerTest.java
  39. +2 −2 continuum-core/src/test/java/org/apache/maven/continuum/execution/ContinuumBuildExecutorTest.java
  40. +40 −32 ...um-core/src/test/java/org/apache/maven/continuum/notification/mail/MailContinuumNotifierTest.java
  41. +8 −4 ...rc/test/resources/org/apache/maven/continuum/notification/ContinuumNotificationDispatcherTest.xml
  42. +6 −3 ...ore/src/test/resources/org/apache/maven/continuum/notification/mail/MailContinuumNotifierTest.xml
  43. +1 −1 continuum-data-management/continuum-legacy/pom.xml
  44. +1 −1 continuum-data-management/data-management-api/pom.xml
  45. +1 −1 continuum-data-management/data-management-cli/pom.xml
  46. +1 −1 continuum-data-management/data-management-jdo/pom.xml
  47. +1 −1 continuum-data-management/data-management-redback-jdo/pom.xml
  48. +1 −1 continuum-data-management/pom.xml
  49. +1 −1 continuum-data-management/redback-legacy/pom.xml
  50. +6 −3 continuum-docs/pom.xml
  51. +4 −4 continuum-docs/src/site/apt/administrator_guides/appearance.apt
  52. +2 −2 continuum-docs/src/site/apt/administrator_guides/external-db.apt
  53. +4 −0 continuum-docs/src/site/apt/administrator_guides/index.apt
  54. +5 −5 continuum-docs/src/site/apt/administrator_guides/jdk.apt
  55. +36 −0 continuum-docs/src/site/apt/administrator_guides/localRepository.apt
  56. +79 −0 continuum-docs/src/site/apt/administrator_guides/purgeConfiguration.apt
  57. +1 −1 continuum-docs/src/site/apt/administrator_guides/security/customising-security.apt
  58. +1 −1 continuum-docs/src/site/apt/administrator_guides/security/ldap.apt
  59. +3 −5 continuum-docs/src/site/apt/administrator_guides/shutdown.apt
  60. +10 −10 continuum-docs/src/site/apt/developer_guides/building.apt
  61. +1 −1 continuum-docs/src/site/apt/developer_guides/xmlrpc.apt
  62. +4 −4 continuum-docs/src/site/apt/getting-started.apt
  63. +4 −0 continuum-docs/src/site/apt/index.apt
  64. +1 −1 continuum-docs/src/site/apt/installation/geronimo.apt
  65. +1 −1 continuum-docs/src/site/apt/installation/glassfish.apt
  66. +1 −1 continuum-docs/src/site/apt/installation/installation.apt
  67. +6 −6 continuum-docs/src/site/apt/installation/jboss.apt
  68. +1 −1 continuum-docs/src/site/apt/installation/jetty.apt
  69. +1 −1 continuum-docs/src/site/apt/installation/requirements.apt
  70. +4 −3 continuum-docs/src/site/apt/installation/standalone.apt
  71. +10 −10 continuum-docs/src/site/apt/installation/tomcat.apt
  72. +17 −4 continuum-docs/src/site/apt/installation/upgrade.apt
  73. +1 −1 continuum-docs/src/site/apt/user_guides/building_project/index.apt
  74. +4 −4 continuum-docs/src/site/apt/user_guides/managing_builddef/index.apt
  75. +17 −17 continuum-docs/src/site/apt/user_guides/managing_project/addProject.apt
  76. +3 −3 continuum-docs/src/site/apt/user_guides/managing_project/editProject.apt
  77. +2 −2 continuum-docs/src/site/apt/user_guides/managing_project/removeProject.apt
  78. +7 −7 continuum-docs/src/site/apt/user_guides/notification/index.apt
  79. BIN continuum-docs/src/site/resources/images/directorypurgeconfiguration-add.png
  80. BIN continuum-docs/src/site/resources/images/disabled_purgenow.gif
  81. BIN continuum-docs/src/site/resources/images/localrepositories-view.png
  82. BIN continuum-docs/src/site/resources/images/localrepositories.png
  83. BIN continuum-docs/src/site/resources/images/localrepository-add.png
  84. BIN continuum-docs/src/site/resources/images/purgeconfigurations-view.png
  85. BIN continuum-docs/src/site/resources/images/purgeconfigurations.png
  86. BIN continuum-docs/src/site/resources/images/purgenow.gif
  87. BIN continuum-docs/src/site/resources/images/repositorypurgeconfiguration-add.png
  88. +3 −1 continuum-docs/src/site/site.xml
  89. +64 −19 continuum-docs/src/site/xdoc/release-notes.xml
  90. +37 −21 continuum-jetty/pom.xml
  91. +13 −0 continuum-jetty/src/main/assembly/bin.xml
  92. +261 −0 continuum-jetty/src/main/resources/LICENSE
  93. +2 −2 continuum-model/pom.xml
  94. +82 −18 continuum-model/src/main/mdo/continuum.xml
  95. +12 −5 continuum-model/src/main/resources/package-mssql.orm
  96. +1 −1 continuum-notifiers/continuum-notifier-api/pom.xml
  97. +1 −1 continuum-notifiers/continuum-notifier-irc/pom.xml
  98. +1 −1 continuum-notifiers/continuum-notifier-jabber/pom.xml
  99. +1 −1 continuum-notifiers/continuum-notifier-msn/pom.xml
  100. +1 −1 continuum-notifiers/continuum-notifier-wagon/pom.xml
  101. +1 −1 continuum-notifiers/pom.xml
  102. +1 −1 continuum-purge/pom.xml
  103. +1 −1 continuum-release/pom.xml
  104. +348 −0 .../src/main/java/org/apache/continuum/release/config/ContinuumPropertiesReleaseDescriptorStore.java
  105. +68 −0 continuum-release/src/main/java/org/apache/continuum/release/config/ContinuumReleaseDescriptor.java
  106. +77 −0 ...nuum-release/src/main/java/org/apache/continuum/release/phase/AbstractContinuumRunGoalsPhase.java
  107. +76 −0 continuum-release/src/main/java/org/apache/continuum/release/phase/RunPerformGoalsPhase.java
  108. +63 −0 continuum-release/src/main/java/org/apache/continuum/release/phase/RunPrepareGoalsPhase.java
  109. +72 −6 ...nuum-release/src/main/java/org/apache/maven/continuum/release/DefaultContinuumReleaseManager.java
  110. +16 −1 ...um-release/src/main/java/org/apache/maven/continuum/release/tasks/AbstractReleaseProjectTask.java
  111. +10 −2 ...uum-release/src/main/java/org/apache/maven/continuum/release/tasks/PerformReleaseProjectTask.java
  112. +7 −1 ...uum-release/src/main/java/org/apache/maven/continuum/release/tasks/PrepareReleaseProjectTask.java
  113. +7 −1 ...um-release/src/main/java/org/apache/maven/continuum/release/tasks/RollbackReleaseProjectTask.java
  114. +34 −7 continuum-release/src/main/resources/META-INF/plexus/components.xml
  115. +4 −3 ...m-release/src/test/java/org/apache/maven/continuum/release/executors/ReleaseTaskExecutorTest.java
  116. +1 −1 continuum-reports/pom.xml
  117. +26 −33 ...ts/src/main/java/org/apache/maven/continuum/reports/surefire/DefaultReportTestSuiteGenerator.java
  118. +26 −13 continuum-reports/src/main/java/org/apache/maven/continuum/reports/surefire/ReportTestResult.java
  119. +15 −14 continuum-reports/src/main/java/org/apache/maven/continuum/reports/surefire/ReportTestSuite.java
  120. +17 −16 ...rc/test/java/org/apache/maven/continuum/reports/surefire/DefaultReportTestSuiteGeneratorTest.java
  121. +4 −3 ...eports/src/test/resources/continuum-core/TEST-org.apache.maven.continuum.scm.ContinuumScmTest.xml
  122. +1 −1 continuum-security/pom.xml
  123. +6 −18 continuum-security/src/main/resources/META-INF/redback/redback.xml
  124. +2 −3 continuum-store/pom.xml
  125. +41 −0 continuum-store/src/main/java/org/apache/continuum/dao/BuildResultDaoImpl.java
  126. +170 −0 continuum-store/src/main/java/org/apache/continuum/dao/ContinuumReleaseResultDaoImpl.java
  127. +2 −0 continuum-store/src/main/java/org/apache/continuum/dao/DaoUtilsImpl.java
  128. +39 −4 continuum-store/src/test/java/org/apache/maven/continuum/store/AbstractContinuumStoreTestCase.java
  129. +27 −2 continuum-store/src/test/java/org/apache/maven/continuum/store/ContinuumStoreTest.java
  130. +1 −1 continuum-test/pom.xml
  131. +2 −0 continuum-test/src/main/java/org/apache/maven/continuum/AbstractContinuumTest.java
  132. +33 −0 continuum-test/src/main/java/org/apache/maven/continuum/configuration/ConfigurationServiceMock.java
  133. +1 −1 continuum-webapp-test/pom.xml
  134. +25 −1 continuum-webapp/pom.xml
  135. +280 −0 continuum-webapp/src/main/java/org/apache/continuum/web/action/ReleaseResultAction.java
  136. +5 −5 ...uum-webapp/src/main/java/org/apache/maven/continuum/web/action/AbstractBuildDefinitionAction.java
  137. +29 −10 continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddMavenProjectAction.java
  138. +6 −0 continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ContinuumActionSupport.java
  139. +103 −25 continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectGroupAction.java
  140. +57 −0 continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleaseInProgressAction.java
  141. +39 −2 continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleasePerformAction.java
  142. +35 −1 continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleasePrepareAction.java
  143. +8 −0 continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleaseProjectAction.java
  144. +12 −0 continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleaseRollbackAction.java
  145. +52 −0 continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/ConfigurationAction.java
  146. +32 −4 continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/ProfileAction.java
  147. +6 −11 continuum-webapp/src/main/resources/META-INF/plexus/application.xml
  148. +45 −1 continuum-webapp/src/main/resources/localization/Continuum.properties
  149. +3 −1 continuum-webapp/src/main/resources/localization/Continuum_fr.properties
  150. +1 −1 continuum-webapp/src/main/resources/localization/Continuum_pt_BR.properties
  151. +1 −1 ...app/src/main/resources/org/apache/maven/continuum/web/action/admin/ConfigurationAction.properties
  152. +37 −1 continuum-webapp/src/main/resources/xwork.xml
  153. +10 −0 continuum-webapp/src/main/webapp/WEB-INF/applicationContext.xml
  154. +1 −0 continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/configuration.jsp
  155. +16 −6 continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/configurationEdit.jsp
  156. +8 −0 continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/profilesList.jsp
  157. +13 −8 continuum-webapp/src/main/webapp/WEB-INF/jsp/components/buildDefinitionGroupSummaryComponent.jsp
  158. +12 −0 continuum-webapp/src/main/webapp/WEB-INF/jsp/components/projectGroupTabComponent.jsp
  159. +55 −0 continuum-webapp/src/main/webapp/WEB-INF/jsp/confirmReleaseResultsRemoval.jsp
  160. +41 −0 continuum-webapp/src/main/webapp/WEB-INF/jsp/groupSummary.jsp
  161. +2 −1 continuum-webapp/src/main/webapp/WEB-INF/jsp/projectGroupEdit.jsp
  162. +97 −0 continuum-webapp/src/main/webapp/WEB-INF/jsp/projectGroupReleaseResults.jsp
  163. +1 −1 continuum-webapp/src/main/webapp/WEB-INF/jsp/projectGroupSummary.jsp
  164. +1 −0 continuum-webapp/src/main/webapp/WEB-INF/jsp/releaseFinished.jsp
  165. +1 −0 continuum-webapp/src/main/webapp/WEB-INF/jsp/releaseInProgress.jsp
  166. +1 −0 continuum-webapp/src/main/webapp/WEB-INF/jsp/releaseInitialized.jsp
  167. +9 −7 continuum-webapp/src/main/webapp/WEB-INF/jsp/releasePerformFromScm.jsp
  168. +8 −6 continuum-webapp/src/main/webapp/WEB-INF/jsp/releasePrepare.jsp
  169. +1 −0 continuum-webapp/src/main/webapp/WEB-INF/jsp/releaseRollbackWarning.jsp
  170. +6 −0 continuum-webapp/src/main/webapp/WEB-INF/jsp/releaseViewResult.jsp
  171. +2 −2 continuum-xmlrpc/continuum-xmlrpc-api/pom.xml
  172. +825 −1 ...xmlrpc/continuum-xmlrpc-api/src/main/java/org/apache/maven/continuum/xmlrpc/ContinuumService.java
  173. +205 −0 continuum-xmlrpc/continuum-xmlrpc-api/src/main/mdo/continuum-service.xml
  174. +1 −1 continuum-xmlrpc/continuum-xmlrpc-backup/pom.xml
  175. +136 −0 ...xmlrpc/continuum-xmlrpc-backup/src/main/java/org/apache/maven/continuum/xmlrpc/backup/Backup.java
  176. +2 −2 continuum-xmlrpc/continuum-xmlrpc-client/pom.xml
Sorry, we could not display the entire diff because it was too big.
View
2 continuum-api/pom.xml
@@ -21,7 +21,7 @@ under the License.
<parent>
<artifactId>continuum</artifactId>
<groupId>org.apache.continuum</groupId>
- <version>1.2-SNAPSHOT</version>
+ <version>1.3-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>continuum-api</artifactId>
View
11 continuum-api/src/main/java/org/apache/continuum/configuration/GeneralConfiguration.java
@@ -39,6 +39,8 @@
private String baseUrl;
private ProxyConfiguration proxyConfiguration;
+
+ private File releaseOutputDirectory;
public GeneralConfiguration()
{
@@ -101,5 +103,14 @@ public String toString()
return ReflectionToStringBuilder.toString( this );
}
+ public File getReleaseOutputDirectory()
+ {
+ return releaseOutputDirectory;
+ }
+
+ public void setReleaseOutputDirectory( File releaseOutputDirectory )
+ {
+ this.releaseOutputDirectory = releaseOutputDirectory;
+ }
}
View
9 continuum-api/src/main/java/org/apache/continuum/dao/BuildResultDao.java
@@ -55,6 +55,15 @@ void updateBuildResult( BuildResult build )
List<BuildResult> getBuildResultsForProject( int projectId, long startIndex, long endIndex );
+ /**
+ * @since 1.2
+ * @param projectId
+ * @param startIndex
+ * @return the returned list will contains all BuildResult for this project after the startId
+ */
+ List<BuildResult> getBuildResultsForProjectFromId( int projectId, long startId )
+ throws ContinuumStoreException;
+
List<BuildResult> getBuildResultsForProject( int projectId, long fromDate );
Map<Integer, BuildResult> getLatestBuildResultsByProjectGroupId( int projectGroupId );
View
50 continuum-api/src/main/java/org/apache/continuum/dao/ContinuumReleaseResultDao.java
@@ -0,0 +1,50 @@
+package org.apache.continuum.dao;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.util.List;
+
+import org.apache.continuum.model.release.ContinuumReleaseResult;
+import org.apache.maven.continuum.store.ContinuumObjectNotFoundException;
+import org.apache.maven.continuum.store.ContinuumStoreException;
+
+/**
+ * @author <a href="mailto:ctan@apache.org">Maria Catherine Tan</a>
+ */
+public interface ContinuumReleaseResultDao
+{
+ ContinuumReleaseResult addContinuumReleaseResult( ContinuumReleaseResult releaseResult )
+ throws ContinuumStoreException;
+
+ void removeContinuumReleaseResult( ContinuumReleaseResult releaseResult )
+ throws ContinuumStoreException;
+
+ List<ContinuumReleaseResult> getContinuumReleaseResultsByProjectGroup( int projectGroupId );
+
+ List<ContinuumReleaseResult> getAllContinuumReleaseResults();
+
+ ContinuumReleaseResult getContinuumReleaseResult( int releaseResultId )
+ throws ContinuumObjectNotFoundException, ContinuumStoreException;
+
+ ContinuumReleaseResult getContinuumReleaseResult( int projectId, String releaseGoal, long startTime, long endTime )
+ throws ContinuumStoreException;
+
+ List<ContinuumReleaseResult> getContinuumReleaseResultsByProject( int projectId );
+}
View
3 continuum-api/src/main/java/org/apache/continuum/taskqueue/manager/TaskQueueManager.java
@@ -19,6 +19,9 @@ boolean buildInProgress()
void cancelBuildTask( int projectId )
throws TaskQueueManagerException;
+ boolean cancelCurrentBuild()
+ throws TaskQueueManagerException;
+
TaskQueue getBuildQueue();
TaskQueueExecutor getBuildTaskQueueExecutor()
View
77 continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java
@@ -24,8 +24,10 @@
import java.util.List;
import java.util.Map;
+import org.apache.continuum.model.release.ContinuumReleaseResult;
import org.apache.continuum.model.project.ProjectScmRoot;
import org.apache.continuum.purge.ContinuumPurgeManager;
+import org.apache.continuum.purge.PurgeConfigurationService;
import org.apache.continuum.repository.RepositoryService;
import org.apache.continuum.taskqueue.manager.TaskQueueManager;
import org.apache.maven.continuum.builddefinition.BuildDefinitionService;
@@ -147,57 +149,6 @@ Project getProjectWithBuildDetails( int projectId )
Map<Integer, BuildResult> getBuildResultsInSuccess();
// ----------------------------------------------------------------------
- // Queues
- // ----------------------------------------------------------------------
-/*
- public List<BuildProjectTask> getProjectsInBuildQueue()
- throws ContinuumException;
-
- boolean isInBuildingQueue( int projectId )
- throws ContinuumException;
-
- boolean isInBuildingQueue( int projectId, int buildDefinitionId )
- throws ContinuumException;
-
- boolean removeProjectsFromBuildingQueue( int[] projectsId )
- throws ContinuumException;
-
- /**
- * @param hashCodes BuildProjectTask hashCodes
- * @throws ContinuumException
- */
-/* void removeProjectsFromBuildingQueueWithHashCodes( int[] hashCodes )
- throws ContinuumException;
-
- boolean removeFromBuildingQueue( int projectId, int buildDefinitionId, int trigger, String projectName )
- throws ContinuumException;
-
- boolean isInCheckoutQueue( int projectId )
- throws ContinuumException;
-
- boolean removeProjectFromCheckoutQueue( int projectId )
- throws ContinuumException;
-
- List /* CheckOutTask *//*getCheckOutTasksInQueue()
- throws ContinuumException;
-
- boolean removeProjectsFromCheckoutQueue( int[] projectId )
- throws ContinuumException;
-
- /**
- * @param hashCodes CheckOutTask hashCodes
- * @throws ContinuumException
- */
-/* void removeTasksFromCheckoutQueueWithHashCodes( int[] hashCodes )
- throws ContinuumException;
-
- TaskQueueExecutor getPrepareBuildTaskQueueExecutor()
- throws ContinuumException;
-
- boolean isProjectInPrepareBuild( int projectId )
- throws ContinuumException;
-*/
- // ----------------------------------------------------------------------
// Building
// ----------------------------------------------------------------------
@@ -657,6 +608,8 @@ void reloadConfiguration()
// ----------------------------------------------------------------------
ContinuumPurgeManager getPurgeManager();
+ PurgeConfigurationService getPurgeConfigurationService();
+
// ----------------------------------------------------------------------
// Repository Service
// ----------------------------------------------------------------------
@@ -687,9 +640,6 @@ ProjectScmRoot getProjectScmRootByProject( int projectId )
void prepareBuildProjects( Collection<Map<Integer, Integer>> projectsAndBuildDefinitions, int trigger )
throws ContinuumException;
-
- //void prepareBuildProjects( Map<Integer, Integer> projectsAndBuildDefinitionsMap )
- // throws ContinuumException;
// ----------------------------------------------------------------------
// Task Queue Manager
@@ -698,4 +648,23 @@ void prepareBuildProjects( Collection<Map<Integer, Integer>> projectsAndBuildDef
public void startup()
throws ContinuumException;
+
+ ContinuumReleaseResult addContinuumReleaseResult( ContinuumReleaseResult releaseResult )
+ throws ContinuumException;
+
+ void removeContinuumReleaseResult( int releaseResultId )
+ throws ContinuumException;
+
+ ContinuumReleaseResult getContinuumReleaseResult( int releaseResultId )
+ throws ContinuumException;
+
+ List<ContinuumReleaseResult> getContinuumReleaseResultsByProjectGroup( int projectGroupId );
+
+ List<ContinuumReleaseResult> getAllContinuumReleaseResults();
+
+ ContinuumReleaseResult getContinuumReleaseResult( int projectId, String releaseGoal, long startTime, long endTime )
+ throws ContinuumException;
+
+ String getReleaseOutput( int releaseResultId )
+ throws ContinuumException;
}
View
12 ...nuum-api/src/main/java/org/apache/maven/continuum/configuration/ConfigurationService.java
@@ -71,6 +71,18 @@ File getBuildOutputFile( int buildId, int projectId )
File getTestReportsDirectory( int buildId, int projectId )
throws ConfigurationException;
+
+ File getReleaseOutputDirectory();
+
+ void setReleaseOutputDirectory( File releaseOutputDirectory );
+
+ File getReleaseOutputDirectory( int projectGroupId );
+
+ File getReleaseOutputFile( int projectGroupId, String releaseName )
+ throws ConfigurationException;
+
+ String getReleaseOutput( int projectGroupId, String releaseName )
+ throws ConfigurationException;
// ----------------------------------------------------------------------
//
View
19 continuum-api/src/main/java/org/apache/maven/continuum/release/ContinuumReleaseManager.java
@@ -21,6 +21,7 @@
import org.apache.continuum.model.repository.LocalRepository;
import org.apache.maven.continuum.model.project.Project;
+import org.apache.maven.continuum.model.system.Profile;
import java.io.File;
import java.util.Map;
@@ -50,6 +51,22 @@
String prepare( Project project, Properties releaseProperties, Map releaseVersions, Map developmentVersions,
ContinuumReleaseManagerListener listener )
throws ContinuumReleaseException;
+
+ /**
+ * Prepare a project for release
+ *
+ * @param project
+ * @param releaseProperties
+ * @param releaseVersions
+ * @param developmentVersions
+ * @param listener
+ * @param profile
+ * @return
+ * @throws ContinuumReleaseException
+ */
+ String prepare( Project project, Properties releaseProperties, Map releaseVersions, Map developmentVersions,
+ ContinuumReleaseManagerListener listener, Profile profile )
+ throws ContinuumReleaseException;
/**
* Perform a release based on a given releaseId
@@ -99,4 +116,6 @@ public void rollback( String releaseId, String workingDirectory, ContinuumReleas
void perform( String releaseId, File buildDirectory, String goals, boolean useReleaseProfile,
ContinuumReleaseManagerListener listener, LocalRepository repository )
throws ContinuumReleaseException;
+
+ Map<String, String> getEnvironments( Profile profile );
}
View
2 continuum-base/continuum-configuration/pom.xml
@@ -21,7 +21,7 @@ under the License.
<parent>
<artifactId>continuum-base</artifactId>
<groupId>org.apache.continuum</groupId>
- <version>1.2-SNAPSHOT</version>
+ <version>1.3-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>continuum-configuration</artifactId>
View
11 ...ation/src/main/java/org/apache/continuum/configuration/DefaultContinuumConfiguration.java
@@ -143,6 +143,12 @@ public void reload( File file )
.getProxyConfiguration().getProxyUser() );
this.generalConfiguration.setProxyConfiguration( proxyConfiguration );
}
+ if ( StringUtils.isNotEmpty( configuration.getReleaseOutputDirectory() ) )
+ {
+ // TODO take care if file exists?
+ this.generalConfiguration.setReleaseOutputDirectory( new File( configuration
+ .getReleaseOutputDirectory() ) );
+ }
}
catch ( IOException e )
{
@@ -197,6 +203,11 @@ public void save( File file )
this.generalConfiguration
.getProxyConfiguration().getProxyHost() );
}
+ if ( this.generalConfiguration.getReleaseOutputDirectory() != null )
+ {
+ configurationModel.setReleaseOutputDirectory( this.generalConfiguration.getReleaseOutputDirectory()
+ .getPath() );
+ }
ContinuumConfigurationModelXpp3Writer writer = new ContinuumConfigurationModelXpp3Writer();
FileWriter fileWriter = new FileWriter( file );
View
7 continuum-base/continuum-configuration/src/main/mdo/continuum-configuration.xml
@@ -60,7 +60,12 @@
<type>ProxyConfiguration</type>
<multiplicity>1</multiplicity>
</association>
- </field>
+ </field>
+ <field>
+ <name>releaseOutputDirectory</name>
+ <version>1.0.0+</version>
+ <type>String</type>
+ </field>
</fields>
</class>
<class xml.tagName="proxy-configuration">
View
2 continuum-base/continuum-scm/pom.xml
@@ -21,7 +21,7 @@ under the License.
<parent>
<artifactId>continuum-base</artifactId>
<groupId>org.apache.continuum</groupId>
- <version>1.2-SNAPSHOT</version>
+ <version>1.3-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>continuum-scm</artifactId>
View
2 continuum-base/pom.xml
@@ -21,7 +21,7 @@ under the License.
<parent>
<artifactId>continuum</artifactId>
<groupId>org.apache.continuum</groupId>
- <version>1.2-SNAPSHOT</version>
+ <version>1.3-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>continuum-base</artifactId>
View
13 continuum-commons/pom.xml
@@ -22,7 +22,7 @@ under the License.
<parent>
<artifactId>continuum</artifactId>
<groupId>org.apache.continuum</groupId>
- <version>1.2-SNAPSHOT</version>
+ <version>1.3-SNAPSHOT</version>
</parent>
<artifactId>continuum-commons</artifactId>
<name>Continuum :: Commons</name>
@@ -43,6 +43,17 @@ under the License.
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-spring</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.apache.maven.release</groupId>
+ <artifactId>maven-release-manager</artifactId>
+ <version>1.0-alpha-3</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-container-default</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
<!-- === Testing Dependencies === -->
<dependency>
<groupId>hsqldb</groupId>
View
5 ...tallation/DefaultInstallationService.java → ...tallation/DefaultInstallationService.java
@@ -1,4 +1,4 @@
-package org.apache.maven.continuum.installation;
+package org.apache.continuum.installation;
/*
* Licensed to the Apache Software Foundation (ASF) under one
@@ -21,6 +21,9 @@
import org.apache.continuum.dao.InstallationDao;
import org.apache.maven.continuum.execution.ExecutorConfigurator;
+import org.apache.maven.continuum.installation.AlreadyExistsInstallationException;
+import org.apache.maven.continuum.installation.InstallationException;
+import org.apache.maven.continuum.installation.InstallationService;
import org.apache.maven.continuum.model.system.Installation;
import org.apache.maven.continuum.model.system.Profile;
import org.apache.maven.continuum.profile.AlreadyExistsProfileException;
View
14 ...tinuum/profile/DefaultProfileService.java → ...tinuum/profile/DefaultProfileService.java
@@ -1,4 +1,4 @@
-package org.apache.maven.continuum.profile;
+package org.apache.continuum.profile;
/*
* Licensed to the Apache Software Foundation (ASF) under one
@@ -24,6 +24,9 @@
import org.apache.maven.continuum.installation.InstallationService;
import org.apache.maven.continuum.model.system.Installation;
import org.apache.maven.continuum.model.system.Profile;
+import org.apache.maven.continuum.profile.AlreadyExistsProfileException;
+import org.apache.maven.continuum.profile.ProfileException;
+import org.apache.maven.continuum.profile.ProfileService;
import org.apache.maven.continuum.store.ContinuumObjectNotFoundException;
import org.apache.maven.continuum.store.ContinuumStoreException;
@@ -131,7 +134,14 @@ public Profile addProfile( Profile profile )
public void deleteProfile( int profileId )
throws ProfileException
{
- profileDao.removeProfile( getProfile( profileId ) );
+ try
+ {
+ profileDao.removeProfile( getProfile( profileId ) );
+ }
+ catch ( Exception e )
+ {
+ throw new ProfileException( "Cannot remove the profile", e );
+ }
}
/**
View
73 ...tils/shell/DefaultShellCommandHelper.java → ...tils/shell/DefaultShellCommandHelper.java
@@ -1,4 +1,4 @@
-package org.apache.maven.continuum.utils.shell;
+package org.apache.continuum.utils.shell;
/*
* Licensed to the Apache Software Foundation (ASF) under one
@@ -19,7 +19,12 @@
* under the License.
*/
+import org.apache.maven.shared.release.ReleaseResult;
+import org.apache.maven.shared.release.exec.MavenExecutorException;
+import org.apache.maven.shared.release.exec.TeeConsumer;
import org.codehaus.plexus.logging.AbstractLogEnabled;
+import org.codehaus.plexus.util.StringUtils;
+import org.codehaus.plexus.util.cli.CommandLineException;
import org.codehaus.plexus.util.cli.CommandLineUtils;
import org.codehaus.plexus.util.cli.Commandline;
import org.codehaus.plexus.util.cli.StreamConsumer;
@@ -35,7 +40,7 @@
/**
* @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
* @version $Id$
- * @plexus.component role="org.apache.maven.continuum.utils.shell.ShellCommandHelper"
+ * @plexus.component role="org.apache.continuum.utils.shell.ShellCommandHelper"
* role-hint="default"
*/
public class DefaultShellCommandHelper
@@ -150,4 +155,68 @@ public void killProcess( long idCommand )
{
CommandLineUtils.killProcess( idCommand );
}
+
+ public void executeGoals( File workingDirectory, String goals, boolean interactive, String arguments,
+ ReleaseResult relResult, Map<String, String> environments )
+ throws Exception
+ {
+ Commandline cl = new Commandline();
+
+ Commandline.Argument argument = cl.createArgument();
+
+ argument.setLine( arguments );
+
+ executeGoals( workingDirectory, goals, interactive, argument.getParts(), relResult, environments );
+ }
+
+ public void executeGoals( File workingDirectory, String goals, boolean interactive, String[] arguments,
+ ReleaseResult relResult, Map<String, String> environments )
+ throws Exception
+ {
+ Commandline cl = createCommandline( workingDirectory, "mvn", arguments, -1, environments );
+
+ if ( goals != null )
+ {
+ // accept both space and comma, so the old way still work
+ String[] tokens = StringUtils.split( goals, ", " );
+
+ for ( int i = 0; i < tokens.length; ++i )
+ {
+ cl.createArgument().setValue( tokens[i] );
+ }
+ }
+
+ cl.createArgument().setValue( "--no-plugin-updates" );
+
+ if ( !interactive )
+ {
+ cl.createArgument().setValue( "--batch-mode" );
+ }
+
+ StreamConsumer stdOut = new TeeConsumer( System.out );
+
+ StreamConsumer stdErr = new TeeConsumer( System.err );
+
+ try
+ {
+ relResult.appendInfo( "Executing: " + cl.toString() );
+ getLogger().info( "Executing: " + cl.toString() );
+
+ int result = CommandLineUtils.executeCommandLine( cl, stdOut, stdErr );
+
+ if ( result != 0 )
+ {
+ throw new MavenExecutorException( "Maven execution failed, exit code: \'" + result + "\'", result,
+ stdOut.toString(), stdErr.toString() );
+ }
+ }
+ catch ( CommandLineException e )
+ {
+ throw new MavenExecutorException( "Can't run goal " + goals, stdOut.toString(), stdErr.toString(), e );
+ }
+ finally
+ {
+ relResult.appendOutput( stdOut.toString() );
+ }
+ }
}
View
2 ...ontinuum/utils/shell/ExecutionResult.java → ...ontinuum/utils/shell/ExecutionResult.java
@@ -1,4 +1,4 @@
-package org.apache.maven.continuum.utils.shell;
+package org.apache.continuum.utils.shell;
/*
* Licensed to the Apache Software Foundation (ASF) under one
View
15 ...inuum/utils/shell/ShellCommandHelper.java → ...inuum/utils/shell/ShellCommandHelper.java
@@ -1,4 +1,4 @@
-package org.apache.maven.continuum.utils.shell;
+package org.apache.continuum.utils.shell;
/*
* Licensed to the Apache Software Foundation (ASF) under one
@@ -22,9 +22,12 @@
import java.io.File;
import java.util.Map;
+import org.apache.continuum.utils.shell.ExecutionResult;
+import org.apache.maven.shared.release.ReleaseResult;
+
/**
* @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
- * @version $Id$
+ * @version $Id: ShellCommandHelper.java 548732 2007-06-19 14:04:13Z evenisse $
*/
public interface ShellCommandHelper
{
@@ -41,4 +44,12 @@ ExecutionResult executeShellCommand( File workingDirectory, String executable, S
boolean isRunning( long idCommand );
void killProcess( long idCommand );
+
+ void executeGoals( File workingDirectory, String goals, boolean interactive, String arguments,
+ ReleaseResult relResult, Map<String, String> environments )
+ throws Exception;
+
+ void executeGoals( File workingDirectory, String goals, boolean interactive, String[] arguments,
+ ReleaseResult relResult, Map<String, String> environments )
+ throws Exception;
}
View
93 ...s/src/main/java/org/apache/maven/continuum/configuration/DefaultConfigurationService.java
@@ -244,6 +244,37 @@ public String getBuildOutput( int buildId, int projectId )
}
}
+ public File getReleaseOutputDirectory()
+ {
+ File releaseOutputDirectory = generalConfiguration.getReleaseOutputDirectory();
+
+ if ( releaseOutputDirectory == null )
+ {
+ releaseOutputDirectory = getFile( systemConf.getReleaseOutputDirectory() );
+ setReleaseOutputDirectory( releaseOutputDirectory );
+ }
+ return releaseOutputDirectory;
+ }
+
+ public void setReleaseOutputDirectory( File releaseOutputDirectory )
+ {
+ if ( releaseOutputDirectory == null )
+ {
+ generalConfiguration.setReleaseOutputDirectory( releaseOutputDirectory );
+ return;
+ }
+
+ File f = releaseOutputDirectory;
+ try
+ {
+ f = f.getCanonicalFile();
+ }
+ catch ( IOException e )
+ {
+ }
+ generalConfiguration.setReleaseOutputDirectory( f );
+ }
+
// ----------------------------------------------------------------------
//
// ----------------------------------------------------------------------
@@ -288,6 +319,68 @@ public File getBuildOutputFile( int buildId, int projectId )
return new File( dir, buildId + ".log.txt" );
}
+ public File getReleaseOutputDirectory( int projectGroupId )
+ {
+ if ( getReleaseOutputDirectory() == null )
+ {
+ return null;
+ }
+
+ File dir = new File( getReleaseOutputDirectory(), Integer.toString( projectGroupId ) );
+
+ try
+ {
+ dir = dir.getCanonicalFile();
+ }
+ catch ( IOException e )
+ {
+ }
+
+ return dir;
+ }
+
+ public File getReleaseOutputFile( int projectGroupId, String name )
+ throws ConfigurationException
+ {
+ File dir = getReleaseOutputDirectory( projectGroupId );
+
+ if ( dir == null )
+ {
+ return null;
+ }
+
+ if ( !dir.exists() && !dir.mkdirs() )
+ {
+ throw new ConfigurationException(
+ "Could not make the release output directory: " + "'" + dir.getAbsolutePath() + "'." );
+ }
+
+ return new File( dir, name + ".log.txt" );
+ }
+
+ public String getReleaseOutput( int projectGroupId, String name )
+ throws ConfigurationException
+ {
+ File file = getReleaseOutputFile( projectGroupId, name );
+
+ try
+ {
+ if ( file.exists() )
+ {
+ return FileUtils.fileRead( file.getAbsolutePath() );
+ }
+ else
+ {
+ return "There are no output for this release.";
+ }
+ }
+ catch ( IOException e )
+ {
+ log.warn( "Error reading release output for release '" + name + "'.", e );
+ return null;
+ }
+ }
+
// ----------------------------------------------------------------------
//
// ----------------------------------------------------------------------
View
2 continuum-commons/src/main/resources/META-INF/spring-context.xml
@@ -25,7 +25,7 @@
<bean id="configurationService" class="org.apache.maven.continuum.configuration.DefaultConfigurationService"
init-method="initialize">
- <property name="applicationHome" value="target"/>
+ <property name="applicationHome" value="data"/>
<property name="scheduleDao" ref="scheduleDao"/>
<property name="systemConfigurationDao" ref="systemConfigurationDao"/>
<property name="configuration" ref="continuumConfiguration"/>
View
4 ...ation/DefaultInstallationServiceTest.java → ...ation/DefaultInstallationServiceTest.java
@@ -1,4 +1,4 @@
-package org.apache.maven.continuum.installation;
+package org.apache.continuum.installation;
/*
* Licensed to the Apache Software Foundation (ASF) under one
@@ -22,6 +22,8 @@
import org.apache.continuum.dao.DaoUtils;
import org.apache.maven.continuum.AbstractContinuumTest;
import org.apache.maven.continuum.execution.ExecutorConfigurator;
+import org.apache.maven.continuum.installation.AlreadyExistsInstallationException;
+import org.apache.maven.continuum.installation.InstallationService;
import org.apache.maven.continuum.model.system.Installation;
import org.apache.maven.continuum.model.system.Profile;
import org.apache.maven.continuum.profile.ProfileService;
View
4 ...um/profile/DefaultProfileServiceTest.java → ...um/profile/DefaultProfileServiceTest.java
@@ -1,10 +1,12 @@
-package org.apache.maven.continuum.profile;
+package org.apache.continuum.profile;
import org.apache.continuum.dao.DaoUtils;
import org.apache.maven.continuum.AbstractContinuumTest;
import org.apache.maven.continuum.installation.InstallationService;
import org.apache.maven.continuum.model.system.Installation;
import org.apache.maven.continuum.model.system.Profile;
+import org.apache.maven.continuum.profile.AlreadyExistsProfileException;
+import org.apache.maven.continuum.profile.ProfileService;
import java.util.List;
View
12 continuum-core/pom.xml
@@ -21,7 +21,7 @@ under the License.
<parent>
<artifactId>continuum</artifactId>
<groupId>org.apache.continuum</groupId>
- <version>1.2-SNAPSHOT</version>
+ <version>1.3-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>continuum-core</artifactId>
@@ -167,6 +167,16 @@ under the License.
<artifactId>archiva-repository-layer</artifactId>
<version>${archiva.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context-support</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>javax.mail</groupId>
+ <artifactId>mail</artifactId>
+ <version>1.4</version>
+ <scope>provided</scope>
+ </dependency>
<!-- === Testing Dependencies === -->
<dependency>
<groupId>hsqldb</groupId>
View
14 continuum-core/src/main/java/org/apache/continuum/repository/DefaultRepositoryService.java
@@ -72,6 +72,20 @@ public LocalRepository addLocalRepository( LocalRepository localRepository )
try
{
+ List<LocalRepository> repos = getAllLocalRepositories();
+ for ( LocalRepository repo : repos )
+ {
+ if ( repo.getName().equals( localRepository.getName() ) )
+ {
+ throw new RepositoryServiceException( "Local repository name must be unique" );
+ }
+
+ if ( repo.getLocation().equals( localRepository.getLocation() ) )
+ {
+ throw new RepositoryServiceException( "Local repository location must be unique" );
+ }
+ }
+
localRepository.setName( localRepository.getName().trim() );
localRepository.setLocation( localRepository.getLocation().trim() );
View
28 ...um-core/src/main/java/org/apache/continuum/taskqueue/manager/DefaultTaskQueueManager.java
@@ -104,7 +104,31 @@ public void cancelBuildTask( int projectId )
}
}
}
-
+
+ public boolean cancelCurrentBuild()
+ throws TaskQueueManagerException
+ {
+ Task task = getBuildTaskQueueExecutor().getCurrentTask();
+
+ if ( task != null )
+ {
+ if ( task instanceof BuildProjectTask )
+ {
+ getLogger().info( "Cancelling current build task" );
+ return getBuildTaskQueueExecutor().cancelTask( task );
+ }
+ else
+ {
+ getLogger().warn( "Current task not a BuildProjectTask - not cancelling" );
+ }
+ }
+ else
+ {
+ getLogger().warn( "No task running - not cancelling" );
+ }
+ return false;
+ }
+
public TaskQueue getBuildQueue()
{
return buildQueue;
@@ -483,7 +507,7 @@ public boolean removeProjectsFromBuildingQueue( int[] projectsId )
}
}
}
-
+
for ( BuildProjectTask buildProjectTask : tasks )
{
getLogger().info( "cancel build for project " + buildProjectTask.getProjectId() );
View
160 continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
@@ -33,18 +33,20 @@
import java.util.regex.Matcher;
import java.util.regex.Pattern;
-//import org.apache.commons.lang.ArrayUtils;
import org.apache.continuum.configuration.ContinuumConfigurationException;
import org.apache.continuum.dao.BuildDefinitionDao;
import org.apache.continuum.dao.BuildResultDao;
+import org.apache.continuum.dao.ContinuumReleaseResultDao;
import org.apache.continuum.dao.DaoUtils;
import org.apache.continuum.dao.NotifierDao;
import org.apache.continuum.dao.ProjectDao;
import org.apache.continuum.dao.ProjectGroupDao;
import org.apache.continuum.dao.ProjectScmRootDao;
import org.apache.continuum.dao.ScheduleDao;
+import org.apache.continuum.model.release.ContinuumReleaseResult;
import org.apache.continuum.model.project.ProjectScmRoot;
import org.apache.continuum.purge.ContinuumPurgeManager;
+import org.apache.continuum.purge.PurgeConfigurationService;
import org.apache.continuum.repository.RepositoryService;
import org.apache.continuum.taskqueue.manager.TaskQueueManager;
import org.apache.continuum.taskqueue.manager.TaskQueueManagerException;
@@ -77,7 +79,6 @@
import org.apache.maven.continuum.project.builder.maven.MavenOneContinuumProjectBuilder;
import org.apache.maven.continuum.project.builder.maven.MavenTwoContinuumProjectBuilder;
import org.apache.maven.continuum.release.ContinuumReleaseManager;
-//import org.apache.maven.continuum.scm.queue.CheckOutTask;
import org.apache.maven.continuum.scm.queue.PrepareBuildProjectsTask;
import org.apache.maven.continuum.store.ContinuumObjectNotFoundException;
import org.apache.maven.continuum.store.ContinuumStoreException;
@@ -89,7 +90,6 @@
import org.codehaus.plexus.action.Action;
import org.codehaus.plexus.action.ActionManager;
import org.codehaus.plexus.action.ActionNotFoundException;
-//import org.codehaus.plexus.component.repository.exception.ComponentLookupException;
import org.codehaus.plexus.context.Context;
import org.codehaus.plexus.context.ContextException;
import org.codehaus.plexus.logging.AbstractLogEnabled;
@@ -99,10 +99,7 @@
import org.codehaus.plexus.personality.plexus.lifecycle.phase.Startable;
import org.codehaus.plexus.personality.plexus.lifecycle.phase.StartingException;
import org.codehaus.plexus.personality.plexus.lifecycle.phase.StoppingException;
-//import org.codehaus.plexus.taskqueue.Task;
-//import org.codehaus.plexus.taskqueue.TaskQueue;
import org.codehaus.plexus.taskqueue.TaskQueueException;
-//import org.codehaus.plexus.taskqueue.execution.TaskQueueExecutor;
import org.codehaus.plexus.util.FileUtils;
import org.codehaus.plexus.util.StringUtils;
import org.codehaus.plexus.util.dag.CycleDetectedException;
@@ -165,6 +162,11 @@
/**
* @plexus.requirement
*/
+ private ContinuumReleaseResultDao releaseResultDao;
+
+ /**
+ * @plexus.requirement
+ */
private ProjectScmRootDao projectScmRootDao;
/**
@@ -195,7 +197,7 @@
// ----------------------------------------------------------------------
// Moved from core
// ----------------------------------------------------------------------
-
+
/**
* @plexus.requirement
*/
@@ -236,6 +238,11 @@
*/
private RepositoryService repositoryService;
+ /**
+ * @plexus.requirement
+ */
+ private PurgeConfigurationService purgeConfigurationService;
+
/**
* @plexus.requirement
*/
@@ -289,6 +296,11 @@ public TaskQueueManager getTaskQueueManager()
return taskQueueManager;
}
+ public PurgeConfigurationService getPurgeConfigurationService()
+ {
+ return purgeConfigurationService;
+ }
+
// ----------------------------------------------------------------------
// Project Groups
// ----------------------------------------------------------------------
@@ -563,6 +575,31 @@ public void removeProject( int projectId )
{
Project project = getProjectWithBuilds( projectId );
+ List<ContinuumReleaseResult> releaseResults = releaseResultDao.getContinuumReleaseResultsByProject( projectId );
+
+ try
+ {
+ for ( ContinuumReleaseResult releaseResult : releaseResults )
+ {
+ releaseResultDao.removeContinuumReleaseResult( releaseResult );
+ }
+
+ File releaseOutputDirectory = configurationService.getReleaseOutputDirectory( project.getProjectGroup().getId() );
+
+ if ( releaseOutputDirectory != null )
+ {
+ FileUtils.deleteDirectory( releaseOutputDirectory );
+ }
+ }
+ catch ( ContinuumStoreException e )
+ {
+ throw new ContinuumException( "Error while deleting continuum release result of project group", e );
+ }
+ catch ( IOException e )
+ {
+ throw logAndCreateException( "Error while deleting project group release output directory.", e );
+ }
+
getLogger().info( "Remove project " + project.getName() + "(" + projectId + ")" );
try
@@ -3031,6 +3068,109 @@ public BuildDefinitionService getBuildDefinitionService()
return buildDefinitionService;
}
+ public ContinuumReleaseResult addContinuumReleaseResult( ContinuumReleaseResult releaseResult )
+ throws ContinuumException
+ {
+ try
+ {
+ return releaseResultDao.addContinuumReleaseResult( releaseResult );
+ }
+ catch ( ContinuumStoreException e )
+ {
+ throw new ContinuumException( "Error while adding continuumReleaseResult", e );
+ }
+ }
+
+ public void removeContinuumReleaseResult( int releaseResultId )
+ throws ContinuumException
+ {
+ ContinuumReleaseResult releaseResult = getContinuumReleaseResult( releaseResultId );
+
+ try
+ {
+ releaseResultDao.removeContinuumReleaseResult( releaseResult );
+ }
+ catch ( ContinuumStoreException e )
+ {
+ throw new ContinuumException( "Error while deleting continuumReleaseResult: " + releaseResultId, e );
+ }
+
+ try
+ {
+ int projectGroupId = releaseResult.getProjectGroup().getId();
+
+ String name = "releases-" + releaseResult.getStartTime();
+
+ File releaseFile = getConfiguration().getReleaseOutputFile( projectGroupId, name );
+
+ if ( releaseFile.exists() )
+ {
+ releaseFile.delete();
+ }
+ }
+ catch ( ConfigurationException e )
+ {
+ getLogger().info( "skip error during cleanup release files " + e.getMessage(), e );
+ }
+ }
+
+ public ContinuumReleaseResult getContinuumReleaseResult( int releaseResultId )
+ throws ContinuumException
+ {
+ try
+ {
+ return releaseResultDao.getContinuumReleaseResult( releaseResultId );
+ }
+ catch ( ContinuumObjectNotFoundException e )
+ {
+ throw new ContinuumException( "No continuumReleaseResult found: " + releaseResultId );
+ }
+ catch ( ContinuumStoreException e )
+ {
+ throw new ContinuumException( "Error while retrieving continuumReleaseResult: " + releaseResultId, e );
+ }
+ }
+
+ public List<ContinuumReleaseResult> getAllContinuumReleaseResults()
+ {
+ return releaseResultDao.getAllContinuumReleaseResults();
+ }
+
+ public List<ContinuumReleaseResult> getContinuumReleaseResultsByProjectGroup( int projectGroupId )
+ {
+ return releaseResultDao.getContinuumReleaseResultsByProjectGroup( projectGroupId );
+ }
+
+ public ContinuumReleaseResult getContinuumReleaseResult( int projectId, String releaseGoal, long startTime, long endTime )
+ throws ContinuumException
+ {
+ try
+ {
+ return releaseResultDao.getContinuumReleaseResult( projectId, releaseGoal, startTime, endTime );
+ }
+ catch ( ContinuumStoreException e )
+ {
+ throw new ContinuumException( "Error while retrieving continuumReleaseResult of projectId " + projectId + " with releaseGoal: " + releaseGoal, e);
+ }
+ }
+
+ public String getReleaseOutput( int releaseResultId )
+ throws ContinuumException
+ {
+ ContinuumReleaseResult releaseResult = getContinuumReleaseResult( releaseResultId );
+
+ ProjectGroup projectGroup = releaseResult.getProjectGroup();
+
+ try
+ {
+ return configurationService.getReleaseOutput( projectGroup.getId(), "releases-" + releaseResult.getStartTime() );
+ }
+ catch ( ConfigurationException e )
+ {
+ throw new ContinuumException( "Error while retrieving release output for release: " + releaseResultId );
+ }
+ }
+
public List<ProjectScmRoot> getProjectScmRootByProjectGroup( int projectGroupId )
{
return projectScmRootDao.getProjectScmRootByProjectGroup( projectGroupId );
@@ -3072,8 +3212,8 @@ public ProjectScmRoot getProjectScmRootByProject( int projectId )
}
public Collection<Map<Integer, Integer>> getProjectsAndBuildDefinitions( Collection<Project> projects,
- List<BuildDefinition> bds,
- boolean checkDefaultBuildDefinitionForProject )
+ List<BuildDefinition> bds,
+ boolean checkDefaultBuildDefinitionForProject )
throws ContinuumException
{
Map<String, Map<Integer, Integer>> map = new HashMap<String, Map<Integer, Integer>>();
@@ -3170,7 +3310,7 @@ public ProjectScmRoot getProjectScmRootByProject( int projectId )
}
public Collection<Map<Integer, Integer>> getProjectsAndBuildDefinitions( Collection<Project> projects,
- int buildDefinitionId )
+ int buildDefinitionId )
throws ContinuumException
{
Map<String, Map<Integer,Integer>> map = new HashMap<String, Map<Integer, Integer>>();
View
34 ...core/src/main/java/org/apache/maven/continuum/buildcontroller/DefaultBuildController.java
@@ -27,6 +27,7 @@
import org.apache.continuum.model.project.ProjectScmRoot;
import org.apache.maven.continuum.core.action.AbstractContinuumAction;
import org.apache.maven.continuum.execution.ContinuumBuildExecutor;
+import org.apache.maven.continuum.execution.ContinuumBuildExecutorConstants;
import org.apache.maven.continuum.execution.manager.BuildExecutorManager;
import org.apache.maven.continuum.model.project.BuildDefinition;
import org.apache.maven.continuum.model.project.BuildResult;
@@ -34,7 +35,6 @@
import org.apache.maven.continuum.model.project.ProjectDependency;
import org.apache.maven.continuum.model.scm.ChangeFile;
import org.apache.maven.continuum.model.scm.ChangeSet;
-//import org.apache.maven.continuum.model.scm.ScmResult;
import org.apache.maven.continuum.notification.ContinuumNotificationDispatcher;
import org.apache.maven.continuum.project.ContinuumProjectState;
import org.apache.maven.continuum.store.ContinuumObjectNotFoundException;
@@ -47,7 +47,6 @@
import org.codehaus.plexus.action.ActionNotFoundException;
import org.codehaus.plexus.logging.AbstractLogEnabled;
import org.codehaus.plexus.taskqueue.execution.TaskExecutionException;
-//import org.codehaus.plexus.util.StringUtils;
import java.util.ArrayList;
import java.util.Iterator;
@@ -151,16 +150,18 @@ public void build( int projectId, int buildDefinitionId, int trigger )
}
catch ( TaskExecutionException e )
{
- //just log the error but don't stop the build from progressing in order not to suppress any build result messages there
+ updateBuildResult( context, ContinuumUtils.throwableToString( e ) );
+
+ //just log the error but don't stop the build from progressing in order not to suppress any build result messages there
getLogger().error( "Error executing action update-project-from-working-directory '", e );
}
performAction( "execute-builder", context );
-
+
performAction( "deploy-artifact", context );
context.setCancelled( (Boolean) actionContext.get( AbstractContinuumAction.KEY_CANCELLED ) );
-
+
String s = (String) actionContext.get( AbstractContinuumAction.KEY_BUILD_ID );
if ( s != null && !context.isCancelled() )
@@ -331,7 +332,7 @@ protected BuildContext initializeBuildContext( int projectId, int buildDefinitio
try
{
Project project = projectDao.getProjectWithScmDetails( projectId );
-
+
context.setProject( project );
BuildDefinition buildDefinition = buildDefinitionDao.getBuildDefinition( buildDefinitionId );
@@ -342,7 +343,7 @@ protected BuildContext initializeBuildContext( int projectId, int buildDefinitio
buildResultDao.getLatestBuildResultForBuildDefinition( projectId, buildDefinitionId );
context.setOldBuildResult( oldBuildResult );
-
+
context.setScmResult( project.getScmResult() );
}
catch ( ContinuumStoreException e )
@@ -368,7 +369,7 @@ protected BuildContext initializeBuildContext( int projectId, int buildDefinitio
{
actionContext.put( AbstractContinuumAction.KEY_OLD_BUILD_ID, context.getOldBuildResult().getId() );
}
-
+
return context;
}
@@ -430,6 +431,11 @@ protected boolean shouldBuild( BuildContext context )
throws TaskExecutionException
{
BuildDefinition buildDefinition = context.getBuildDefinition();
+ if ( buildDefinition.isBuildFresh() )
+ {
+ getLogger().info( "FreshBuild configured, building" );
+ return true;
+ }
if ( buildDefinition.isAlwaysBuild() )
{
getLogger().info( "AlwaysBuild configured, building" );
@@ -492,7 +498,8 @@ protected boolean shouldBuild( BuildContext context )
}
// Check changes
- if ( !shouldBuild && !allChangesUnknown && !context.getScmResult().getChanges().isEmpty() )
+ if ( !shouldBuild && ( ( !allChangesUnknown && !context.getScmResult().getChanges().isEmpty() ) ||
+ project.getExecutorId().equals( ContinuumBuildExecutorConstants.MAVEN_TWO_BUILD_EXECUTOR ) ) )
{
try
{
@@ -503,6 +510,7 @@ protected boolean shouldBuild( BuildContext context )
}
catch ( Exception e )
{
+ updateBuildResult( context, ContinuumUtils.throwableToString( e ) );
throw new TaskExecutionException( "Can't determine if the project should build or not", e );
}
}
@@ -693,9 +701,9 @@ private boolean checkScmResult( BuildContext context )
throws TaskExecutionException
{
Project project = context.getProject();
-
+
int projectGroupId = project.getProjectGroup().getId();
-
+
List<ProjectScmRoot> scmRoots = projectScmRootDao.getProjectScmRootByProjectGroup( projectGroupId );
for ( ProjectScmRoot projectScmRoot : scmRoots )
@@ -706,11 +714,11 @@ private boolean checkScmResult( BuildContext context )
{
return true;
}
-
+
break;
}
}
-
+
return false;
}
View
4 continuum-core/src/main/java/org/apache/maven/continuum/execution/AbstractBuildExecutor.java
@@ -19,6 +19,8 @@
* under the License.
*/
+import org.apache.continuum.utils.shell.ExecutionResult;
+import org.apache.continuum.utils.shell.ShellCommandHelper;
import org.apache.maven.artifact.Artifact;
import org.apache.maven.continuum.installation.InstallationService;
import org.apache.maven.continuum.model.project.BuildDefinition;
@@ -28,8 +30,6 @@
import org.apache.maven.continuum.model.system.Profile;
import org.apache.maven.continuum.project.ContinuumProjectState;
import org.apache.maven.continuum.utils.WorkingDirectoryService;
-import org.apache.maven.continuum.utils.shell.ExecutionResult;
-import org.apache.maven.continuum.utils.shell.ShellCommandHelper;
import org.codehaus.plexus.commandline.ExecutableResolver;
import org.codehaus.plexus.logging.AbstractLogEnabled;
import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable;
View
2 ...ain/java/org/apache/maven/continuum/execution/maven/m1/DefaultMavenOneMetadataHelper.java
@@ -217,7 +217,7 @@ public void mapMetadata( ContinuumProjectBuildingResult result, File metadata, P
if ( StringUtils.isEmpty( scmConnection ) )
{
- result.addError( ContinuumProjectBuildingResult.ERROR_MISSING_SCM );
+ result.addError( ContinuumProjectBuildingResult.ERROR_MISSING_SCM, name );
// Do not throw an exception or return here, gather up as many results as possible first.
}
View
19 ...re/src/main/java/org/apache/maven/continuum/execution/maven/m2/MavenTwoBuildExecutor.java
@@ -407,8 +407,25 @@ public boolean shouldBuild( List<ChangeSet> changes, Project continuumProject, F
return true;
}
- //check if changes are only in sub-modules or not
MavenProject project = getMavenProject( continuumProject, workingDirectory, buildDefinition );
+
+ //CONTINUUM-1815: additional check for projects recently released
+ if ( !continuumProject.getVersion().equals( project.getVersion() ) )
+ {
+ getLogger().info( "Found changes in project's version ( maybe project was recently released ), building" );
+ return true;
+ }
+
+ if ( changes.isEmpty() )
+ {
+ if ( getLogger().isDebugEnabled() )
+ {
+ getLogger().info( "Found no changes, not building" );
+ }
+ return false;
+ }
+
+ //check if changes are only in sub-modules or not
List<String> modules = project.getModules();
List<ChangeFile> files = new ArrayList<ChangeFile>();
View
99 ...ore/src/main/java/org/apache/maven/continuum/notification/mail/MailContinuumNotifier.java
@@ -47,20 +47,26 @@
import org.apache.maven.continuum.reports.surefire.ReportTestSuiteGenerator;
import org.apache.velocity.VelocityContext;
import org.apache.velocity.exception.ResourceNotFoundException;
-import org.codehaus.plexus.mailsender.MailMessage;
-import org.codehaus.plexus.mailsender.MailSender;
-import org.codehaus.plexus.mailsender.MailSenderException;
import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable;
import org.codehaus.plexus.util.StringUtils;
import org.codehaus.plexus.velocity.VelocityComponent;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-
+import org.springframework.mail.javamail.JavaMailSender;
+
+import javax.mail.Address;
+import javax.mail.Message;
+import javax.mail.MessagingException;
+import javax.mail.internet.AddressException;
+import javax.mail.internet.InternetAddress;
+import javax.mail.internet.MimeMessage;
import java.io.StringWriter;
+import java.io.UnsupportedEncodingException;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -95,9 +101,9 @@
private Continuum continuum;
/**
- * @plexus.configuration
+ * @plexus.requirement
*/
- private MailSender mailSender;
+ private JavaMailSender javaMailSender;
/**
* @plexus.requirement
@@ -659,23 +665,24 @@ private void sendMessage( Project project, List<ProjectNotifier> notifiers, Stri
return;
}
- MailMessage message = new MailMessage();
+ try
+ {
+
+ MimeMessage message = javaMailSender.createMimeMessage();
- message.addHeader( "X-Continuum-Build-Host", buildHost );
+ message.addHeader( "X-Continuum-Build-Host", buildHost );
- message.addHeader( "X-Continuum-Project-Id", Integer.toString( project.getId() ) );
+ message.addHeader( "X-Continuum-Project-Id", Integer.toString( project.getId() ) );
- message.addHeader( "X-Continuum-Project-Name", project.getName() );
+ message.addHeader( "X-Continuum-Project-Name", project.getName() );
- try
- {
message.setSubject( subject );
log.info( "Message Subject: '" + subject + "'." );
- message.setContent( content );
+ message.setText( content );
- MailMessage.Address from = new MailMessage.Address( fromMailbox, fromName );
+ InternetAddress from = new InternetAddress( fromMailbox, fromName );
message.setFrom( from );
@@ -693,16 +700,15 @@ private void sendMessage( Project project, List<ProjectNotifier> notifiers, Stri
if ( StringUtils.isNotEmpty( addressField ) )
{
String[] addresses = StringUtils.split( addressField, "," );
-
for ( String address : addresses )
{
// TODO: set a proper name
- MailMessage.Address to = new MailMessage.Address( address.trim() );
+ InternetAddress to = new InternetAddress( address.trim() );
log.info( "Recipient: To '" + to + "'." );
-
- message.addTo( to );
+ message.addRecipient( Message.RecipientType.TO, to );
}
+
}
String committerField = (String) notifier.getConfiguration().get( COMMITTER_FIELD );
@@ -742,11 +748,10 @@ private void sendMessage( Project project, List<ProjectNotifier> notifiers, Stri
else
{
// TODO: set a proper name
- MailMessage.Address to = new MailMessage.Address( email.trim() );
-
+ InternetAddress to = new InternetAddress( email.trim() );
log.info( "Recipient: To '" + to + "'." );
- message.addTo( to );
+ message.addRecipient( Message.RecipientType.TO, to );
}
}
}
@@ -760,16 +765,26 @@ private void sendMessage( Project project, List<ProjectNotifier> notifiers, Stri
{
// TODO: use configuration file instead of to load it fron component configuration
// TODO: set a proper name
- MailMessage.Address to = new MailMessage.Address( toOverride.trim() );
-
+ InternetAddress to = new InternetAddress( toOverride.trim() );
log.info( "Recipient: To '" + to + "'." );
- message.addTo( to );
+ message.addRecipient( Message.RecipientType.TO, to );
}
- mailSender.send( message );
+ message.setSentDate( new Date() );
+
+ javaMailSender.send( message );
+ //mailSender.send( message );
}
- catch ( MailSenderException ex )
+ catch ( AddressException ex )
+ {
+ throw new NotificationException( "Exception while sending message.", ex );
+ }
+ catch ( MessagingException ex )
+ {
+ throw new NotificationException( "Exception while sending message.", ex );
+ }
+ catch ( UnsupportedEncodingException ex )
{
throw new NotificationException( "Exception while sending message.", ex );
}
@@ -802,7 +817,7 @@ private void sendMessage( ProjectScmRoot projectScmRoot, List<ProjectNotifier> n
return;
}
- MailMessage message = new MailMessage();
+ MimeMessage message = javaMailSender.createMimeMessage();
try
{
@@ -810,9 +825,9 @@ private void sendMessage( ProjectScmRoot projectScmRoot, List<ProjectNotifier> n
log.info( "Message Subject: '" + subject + "'." );
- message.setContent( content );
+ message.setText( content );
- MailMessage.Address from = new MailMessage.Address( fromMailbox, fromName );
+ InternetAddress from = new InternetAddress( fromMailbox, fromName );
message.setFrom( from );
@@ -839,11 +854,10 @@ private void sendMessage( ProjectScmRoot projectScmRoot, List<ProjectNotifier> n
for ( String address : addresses )
{
// TODO: set a proper name
- MailMessage.Address to = new MailMessage.Address( address.trim() );
+ InternetAddress to = new InternetAddress( address.trim() );
log.info( "Recipient: To '" + to + "'." );
-
- message.addTo( to );
+ message.addRecipient( Message.RecipientType.TO, to );
}
}
}
@@ -853,19 +867,28 @@ private void sendMessage( ProjectScmRoot projectScmRoot, List<ProjectNotifier> n
{
// TODO: use configuration file instead of to load it fron component configuration
// TODO: set a proper name
- MailMessage.Address to = new MailMessage.Address( toOverride.trim() );
-
+ InternetAddress to = new InternetAddress( toOverride.trim() );
log.info( "Recipient: To '" + to + "'." );
- message.addTo( to );
+ message.addRecipient( Message.RecipientType.TO, to );
}
- mailSender.send( message );
+ message.setSentDate( new Date() );
+
+ javaMailSender.send( message );
}
- catch ( MailSenderException ex )
+ catch ( AddressException ex )
{
throw new NotificationException( "Exception while sending message.", ex );
- }
+ }
+ catch ( MessagingException ex )
+ {
+ throw new NotificationException( "Exception while sending message.", ex );
+ }
+ catch ( UnsupportedEncodingException ex )
+ {
+ throw new NotificationException( "Exception while sending message.", ex );
+ }
}
private Map<String, String> mapDevelopersToRecipients( List<ProjectDeveloper> developers )
View
88 ...main/java/org/apache/maven/continuum/project/builder/AbstractContinuumProjectBuilder.java
@@ -19,17 +19,6 @@
* under the License.
*/
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.MalformedURLException;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.net.URL;
-import java.net.UnknownHostException;
-
import org.apache.commons.io.IOUtils;
import org.apache.http.HttpException;
import org.apache.http.HttpResponse;
@@ -57,6 +46,17 @@
import org.codehaus.plexus.util.IOUtil;
import org.codehaus.plexus.util.StringUtils;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.MalformedURLException;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.net.UnknownHostException;
+
/**
* @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
@@ -68,23 +68,23 @@
{
private static final String TMP_DIR = System.getProperty( "java.io.tmpdir" );
-
+
private DefaultHttpClient httpClient;
-
-
+
+
public void initialize()
throws InitializationException
{
SchemeRegistry schemeRegistry = new SchemeRegistry();
// http scheme
- schemeRegistry.register( new Scheme( "http", PlainSocketFactory.getSocketFactory(), 80 ) );
+ schemeRegistry.register( new Scheme( "http", PlainSocketFactory.getSocketFactory(), 80 ) );
// https scheme
- SSLSocketFactory sslSocketFactory = SSLSocketFactory.getSocketFactory();
-
+ SSLSocketFactory sslSocketFactory = SSLSocketFactory.getSocketFactory();
+
// ignore cert
sslSocketFactory.setHostnameVerifier( SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER );
schemeRegistry.register( new Scheme( "https", sslSocketFactory, 443 ) );
-
+
HttpParams params = new BasicHttpParams();
// TODO put this values to a configuration way ???
params.setParameter( ConnManagerPNames.MAX_TOTAL_CONNECTIONS, new Integer( 30 ) );
@@ -92,24 +92,30 @@ public void initialize()
HttpProtocolParams.setVersion( params, HttpVersion.HTTP_1_1 );
ClientConnectionManager cm = new ThreadSafeClientConnManager( params, schemeRegistry );
-
+
httpClient = new DefaultHttpClient( cm, params );
-
+
}
- protected File createMetadataFile( URL metadata, String username, String password, ContinuumProjectBuildingResult result )
+ protected File createMetadataFile( URL metadata, String username, String password,
+ ContinuumProjectBuildingResult result )
throws IOException, URISyntaxException, HttpException
{
- getLogger().info( "Downloading " + metadata.toExternalForm() );
+ String url = metadata.toExternalForm();
+ if ( metadata.getProtocol().startsWith( "http" ) )
+ {
+ url = hidePasswordInUrl( url );
+ }
+ getLogger().info( "Downloading " + url );
InputStream is = null;
-
+
if ( metadata.getProtocol().startsWith( "http" ) )
{
URI uri = metadata.toURI();
HttpGet httpGet = new HttpGet( uri );
-
+
// basic auth
if ( username != null && password != null )
{
@@ -117,21 +123,21 @@ protected File createMetadataFile( URL metadata, String username, String passwor
.setCredentials( new AuthScope( uri.getHost(), uri.getPort() ),
new UsernamePasswordCredentials( username, password ) );
}
-