pom updated to support deployment to sonatype
(backport cherry-pick from master)


Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/9b276632
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/9b276632
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/9b276632

Branch: refs/heads/0.4.0
Commit: 9b2766327cfb0ba6cdb057aa7da1e63c620f25fe
Parents: f8e0654
Author: Alex Heneveld <[email protected]>
Authored: Wed Jan 9 21:42:22 2013 +0000
Committer: Alex Heneveld <[email protected]>
Committed: Mon Jan 14 16:50:53 2013 +0000

----------------------------------------------------------------------
 pom.xml | 148 +++++++++++++++++++++++++++++++++++++++++++++--------------
 1 file changed, 113 insertions(+), 35 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/9b276632/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 6a4ea5b..ea702e9 100644
--- a/pom.xml
+++ b/pom.xml
@@ -14,22 +14,28 @@
         serving as the ancestor POM for all projects --
         declaring versions, profiles, and the modules to build
     </description>
+    <url>http://brooklyn.io/</url>
 
-    <!-- useful custom properties:
+    <!-- useful custom properties/defines to specify to control the build:
 
       brooklyn.explicitModules :: only builds explicit modules (instead of 
default modules)
 
-      brooklyn.cloudsoftArtifactory :: deploys to cloudsoft artifactory repo 
(when using deploy) 
-                                       instead of default cloudsoft filesystem
+      brooklyn.deployTo={cloudsoftFilesystem,cloudsoftArtifactory,sonatype} :: 
+            :: required when deploying; specify the deployment target
+
+      javadoc :: build javadoc (adds a minute or two; enabled automatically 
for target deploy)
+      
+      skipSources :: don't make the -sources.jar (saves a second or two, not 
much)
+      
+      skipTests :: does the usual thing (saves a lot of time, but at some cost 
of build quality!)
+
 
       simply activate with -Dbrooklyn.theCustomProperty on the mvn build line
-      (these are used to trigger profile selection, since maven activeByDefault
+      (some of these are used to trigger profile selection, since maven 
activeByDefault
       only works if _no_ profiles are triggered, see suggestion/background at:
       
http://stackoverflow.com/questions/5309379/how-to-keep-maven-profiles-which-are-activebydefault-active-even-if-another-prof
 )
     -->
 
-    <url>http://brooklyn.io/</url>
-
     <licenses>
         <license>
             <name>Monterey Developer Edition</name>
@@ -52,6 +58,14 @@
 
     <repositories>
         <repository>
+            <id>sonatype-nexus-snapshots</id>
+            <name>Sonatype Nexus Snapshots</name>
+            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
+            <releases> <enabled>false</enabled> </releases>
+            <snapshots> <enabled>true</enabled> </snapshots>
+        </repository>
+<!-- 
+        <repository>
             <id>cloudsoft-cloudfront-releases-repo</id>
             <url>http://developers.cloudsoftcorp.com/maven/releases/</url>
         </repository>
@@ -64,6 +78,7 @@
                 <checksumPolicy>fail</checksumPolicy>
            </snapshots>
          </repository>
+ -->
     </repositories>
 
     <distributionManagement>
@@ -77,7 +92,6 @@
             <id>${snapshot_repo_id}</id>
             <name>${snapshot_repo_name}</name>
             <url>${snapshot_repo_url}</url>
-            <uniqueVersion>true</uniqueVersion>
         </snapshotRepository>
     </distributionManagement>
 
@@ -112,6 +126,10 @@
 
         <includedTestGroups />
         <excludedTestGroups>Integration,Live,WIP</excludedTestGroups>
+        
+        <!-- no passphrase by default, so we can do automated deploy builds;
+             you can still supply your own passphrase with 
-Dgpg.passphrase=XXX -->
+        <gpg.passphrase></gpg.passphrase>
     </properties>
 
     <dependencyManagement>
@@ -286,6 +304,20 @@
                     <version>2.3.1</version>
                 </plugin>
                 <plugin>
+                    <artifactId>maven-source-plugin</artifactId>
+                    <version>2.1.2</version>
+                    <inherited>true</inherited>
+                    <executions>
+                        <execution>
+                            <id>attach-sources</id>
+                            <phase>verify</phase>
+                            <goals>
+                                <goal>jar-no-fork</goal>
+                            </goals>
+                        </execution>
+                    </executions>
+                </plugin>
+                <plugin>
                     <artifactId>maven-javadoc-plugin</artifactId>
                     <version>2.8</version>
                     <inherited>true</inherited>
@@ -309,7 +341,6 @@
                     <executions>
                         <execution>
                             <id>attach-javadocs</id>
-                            <phase>process-classes</phase>
                             <goals>
                                 <goal>jar</goal>
                             </goals>
@@ -317,6 +348,33 @@
                     </executions>
                 </plugin>
                 <plugin>
+                    <groupId>org.apache.maven.plugins</groupId>
+                    <artifactId>maven-gpg-plugin</artifactId>
+                    <version>1.1</version>
+                    <executions>
+                        <execution>
+                            <id>sign-artifacts</id>
+                            <phase>verify</phase>
+                            <goals>
+                                <goal>sign</goal>
+                            </goals>
+                        </execution>
+                    </executions>
+                </plugin>
+                <plugin>
+                    <!-- 'release' is not used; easier just to checkout, tag, 
`mvn deploy` manually
+                         with -Dbrooklyn.deployTo=TARGET ... and note we need 
to update docs and examples, 
+                         which is a non-maven task!) -->
+                    <groupId>org.apache.maven.plugins</groupId>
+                    <artifactId>maven-release-plugin</artifactId>
+                    <version>2.1</version>
+                    <configuration>
+                        <mavenExecutorId>forked-path</mavenExecutorId>
+                        <useReleaseProfile>false</useReleaseProfile>
+                        <arguments>-Dbrooklyn.deployTo=sonatype</arguments>
+                    </configuration>
+                </plugin>
+                <plugin>
                     <artifactId>maven-resources-plugin</artifactId>
                     <version>2.4.1</version>
                 </plugin>
@@ -469,20 +527,6 @@
         </pluginManagement>
         <plugins>
             <plugin>
-                <artifactId>maven-source-plugin</artifactId>
-                <version>2.1.2</version>
-                <inherited>true</inherited>
-                <executions>
-                    <execution>
-                        <id>attach-sources</id>
-                        <phase>verify</phase>
-                        <goals>
-                            <goal>jar-no-fork</goal>
-                        </goals>
-                    </execution>
-                </executions>
-            </plugin>
-            <plugin>
                 <artifactId>maven-enforcer-plugin</artifactId>
                 <executions>
                     <execution>
@@ -536,13 +580,6 @@
                     </dependency>
                 </dependencies>
             </plugin>
-            <plugin>
-                <artifactId>maven-release-plugin</artifactId>
-                <configuration>
-                    <tagNameFormat>release-@{project.version}</tagNameFormat>
-                    <arguments>-DskipTests=true 
-PBrooklyn,Console,Launcher</arguments>
-                </configuration>
-            </plugin>
             <!--  workaround for src/main/resources excluding all in eclipse, 
as per
                   https://issues.sonatype.org/browse/MNGECLIPSE-864 -->
             <plugin>
@@ -845,9 +882,7 @@
         <profile>
             <id>Tests</id>
             <activation>
-                <file>
-                    <exists>${basedir}/src/test</exists>
-                </file>
+                <file> <exists>${basedir}/src/test</exists> </file>
             </activation>
             <build>
                 <plugins>
@@ -1212,12 +1247,44 @@
             </build>
         </profile>
 
+        <!-- build sources jars by default, it's quick -->
+        <profile>
+            <id>make-sources-jar</id>
+            <activation> <property><name>!skipSources</name></property> 
</activation>
+            <build><plugins><plugin>
+                <artifactId>maven-source-plugin</artifactId>
+            </plugin></plugins></build>
+        </profile>
+        
+        <!-- only build javadoc if asked, or if deploying (it's slow) -->
+        <profile>
+            <id>make-javadoc-jar</id>
+            <activation> <property><name>javadoc</name></property> 
</activation>            
+            <build><plugins><plugin>
+                <artifactId>maven-javadoc-plugin</artifactId>
+            </plugin></plugins></build>
+        </profile>
+        
+        <!-- sign and make javadoc when deploying; note, this means you'll 
need gpg set up to deploy -->
+        <profile>
+            <id>make-more-things-when-deploying</id>
+            <activation> <property><name>brooklyn.deployTo</name></property> 
</activation>            
+            <build><plugins>
+                <plugin>
+                    <artifactId>maven-javadoc-plugin</artifactId>
+                </plugin>
+                <plugin>
+                    <artifactId>maven-gpg-plugin</artifactId>
+                </plugin>
+            </plugins></build>
+        </profile>
+
         <!-- different properties used to deploy to different locations 
depending on profiles;
              default is cloudsoft filesystem repo, but some sources still use 
cloudsoft artifactory as source
              (and soon we will support artifactory) -->
         <profile>
             <id>cloudsoft-filesystem-repo</id>
-            <activation> 
<property><name>!brooklyn.cloudsoftArtifactory</name></property> </activation>
+            <activation> 
<property><name>brooklyn.deployTo</name><value>cloudsoftFilesystem</value></property>
 </activation>
             <properties>
                 <repo_id>cloudsoft-deploy-cloudfront-origin-releases</repo_id>
                 <repo_name>Cloudsoft Release Filesystem repo (used as origin 
for cloudfront)</repo_name>
@@ -1229,7 +1296,7 @@
         </profile>
         <profile>
             <id>cloudsoft-artifactory-repo</id>
-            <activation> 
<property><name>brooklyn.cloudsoftArtifactory</name></property> </activation>
+            <activation> 
<property><name>brooklyn.deployTo</name><value>cloudsoftArtifactory</value></property>
 </activation>
             <properties>
                 <repo_id>cloudsoft-deploy-artifactory-release</repo_id>
                 <repo_name>Cloudsoft Artifactory libs-release-local 
repo</repo_name>
@@ -1239,7 +1306,18 @@
                 
<snapshot_repo_url>http://ccweb.cloudsoftcorp.com/maven/libs-snapshot-local/</snapshot_repo_url>
             </properties>
         </profile>
-
+        <profile>
+            <id>sonatype-nexus-repo</id>
+            <activation> 
<property><name>brooklyn.deployTo</name><value>sonatype</value></property> 
</activation>
+            <properties>
+                <repo_id>sonatype-nexus-staging</repo_id>
+                <repo_name>Nexus Release Repository</repo_name>
+                
<repo_url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</repo_url>
+                <snapshot_repo_id>sonatype-nexus-snapshots</snapshot_repo_id>
+                <snapshot_repo_name>Sonatype Nexus 
Snapshots</snapshot_repo_name>
+                
<snapshot_repo_url>https://oss.sonatype.org/content/repositories/snapshots/</snapshot_repo_url>
+            </properties>
+        </profile>
     </profiles>
 
 </project>

Reply via email to