You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by be...@apache.org on 2012/11/04 02:31:02 UTC

svn commit: r1405483 - in /incubator/mesos/branches/0.10.0/src/java: MESOS-MAVEN-README mesos.pom.in

Author: benh
Date: Sun Nov  4 01:31:02 2012
New Revision: 1405483

URL: http://svn.apache.org/viewvc?rev=1405483&view=rev
Log:
Changes to mesos.pom that make it easy to publish Mesos jar(s) to Maven
and a README explaining the process.

Added:
    incubator/mesos/branches/0.10.0/src/java/MESOS-MAVEN-README
Modified:
    incubator/mesos/branches/0.10.0/src/java/mesos.pom.in

Added: incubator/mesos/branches/0.10.0/src/java/MESOS-MAVEN-README
URL: http://svn.apache.org/viewvc/incubator/mesos/branches/0.10.0/src/java/MESOS-MAVEN-README?rev=1405483&view=auto
==============================================================================
--- incubator/mesos/branches/0.10.0/src/java/MESOS-MAVEN-README (added)
+++ incubator/mesos/branches/0.10.0/src/java/MESOS-MAVEN-README Sun Nov  4 01:31:02 2012
@@ -0,0 +1,49 @@
+We use Apache Maven to build jars that that are part of a Mesos Maven artifact
+that can be uploaded directly to public Maven repositories like
+repository.apache.org and Maven Central.
+
+Mesos committers can deploy the Mesos jar to the Apache Maven repository
+(repository.apache.org) using the steps below. Once it is published there,
+it will be copied into Maven Central.
+
+We don't have to vote on the jars for a release once we have voted on the
+release itself. Use http://www.apache.org/dev/publishing-maven-artifacts.html
+as a guiding document when publishing new jars. Snapshots can also be published
+via repository.apache.org, though we haven't published any of those yet as of
+the time this README was written.
+
+To create and publish to a new Staging Repository in Nexus running at
+repository.apache.org:
+
+1) Make sure you have necessary credentials with Apache Nexus repository for
+   the Mesos group (org.apache.mesos).
+2) Setup your servers/credentials in ~/.m2/settings.xml
+3) Install gpg and setup your credentials for signing (signing is required
+   by Apache) - follow directions in the Apache webpage linked to above.
+4) To install the artifact locally: run `mvn install -f mesos.pom`, which will
+   ask you to enter your password for gpg signing 3-4 times (once per file
+   that is getting signed).
+5) To push the artifact to "staging repository" at repository.apache.org: run
+   `mvn deploy -f mesos.pom` from inside the src/java directory, which will
+   also ask you to enter your password for gpg signing 3-4 times (once per
+   file that is getting signed).
+
+If you get a 401 error when you try to deploy the artifacts, read through 
+http://www.sonatype.com/people/2010/11/what-to-do-when-nexus-returns-401/
+
+The above steps will create a temporary staging repository, the purpose of
+which is to allow you to look over what will actually get published as part of
+the artifact, and try it out before officially publishing it. It will be
+helpful to understand that Nexus (which is the software server that manages
+Maven repositories) provides and requires a three step process for publishing
+any artifact:
+
+1) Create a new temporary "open" staging repository. Open repositories do
+   not yet have a URL so they can't be used for testing until they are closed.
+   Repositories in this state can be "dropped" (i.e., deleted) via a button in
+   the Nexus web UI.
+2) "Close" the staging repository - a temporary URL is assigned which can be
+   used in Maven/Ivy/SBT to test the new artifact. Repositories in this state
+   can be "dropped" (deleted) via a button in the Nexus web UI.
+3) "Publish" the closed staging repository - I believe this is not easily
+   reversable (i.e. repositories in this state cannot simply be "dropped).

Modified: incubator/mesos/branches/0.10.0/src/java/mesos.pom.in
URL: http://svn.apache.org/viewvc/incubator/mesos/branches/0.10.0/src/java/mesos.pom.in?rev=1405483&r1=1405482&r2=1405483&view=diff
==============================================================================
--- incubator/mesos/branches/0.10.0/src/java/mesos.pom.in (original)
+++ incubator/mesos/branches/0.10.0/src/java/mesos.pom.in Sun Nov  4 01:31:02 2012
@@ -1,10 +1,56 @@
-<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/xsd/maven-4.0.0.xsd">
+<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/xsd/maven-4.0.0.xsd">
+  <!--Including all elements specified at
+      https://docs.sonatype.org/display/Repository/Central+Sync+Requirements-->
   <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache.mesos</groupId>
   <artifactId>mesos</artifactId>
   <name>mesos</name>
-  <groupId>org.apache.mesos</groupId>
-  <version>@PACKAGE_VERSION@</version>
+  <version>@PACKAGE_VERSION@-incubating</version>
+  <description>The Apache Mesos Java API jar.</description>
+  <url>http://incubator.apache.org/mesos</url>
+  <scm>
+    <connection>scm:svn:https://svn.apache.org/repos/asf/incubator/mesos</connection>
+    <url>https://svn.apache.org/repos/asf/incubator/mesos</url>
+  </scm>
+  <!-- We inherit from the apache parent pom to use its repositories
+       but since we don't use Maven as the primary build system for
+       Mesos, we don't use the -Papache-profile flag -->
+  <parent>
+    <groupId>org.apache</groupId>
+    <artifactId>apache</artifactId>
+    <version>11</version>
+  </parent>
+  <mailingLists>
+    <mailingList>
+      <name>Mesos Dev List</name>
+      <subscribe>mesos-dev-subscribe@incubator.apache.org</subscribe>
+      <unsubscribe>mesos-dev-unsubscribe@incubator.apache.org</unsubscribe>
+      <post>mesos-dev@incubator.apache.org</post>
+      <archive>http://mail-archives.apache.org/mod_mbox/incubator-mesos-dev</archive>
+    </mailingList>
+  </mailingLists>
+  <developers>
+    <developer>
+      <id>benh</id>
+      <name>Benjamin Hindman</name>
+      <email>benh@apache.org</email>
+    </developer>
+    <developer>
+      <id>andyk</id>
+      <name>Andy Konwinski</name>
+      <email>andrew@apache.org</email>
+    </developer>
+    <developer>
+      <id>matei</id>
+      <name>Matei Zaharia</name>
+      <email>matei@apache.org</email>
+    </developer>
+    <developer>
+      <id>alig</id>
+      <name>Ali Ghodis</name>
+      <email>alig@apache.org</email>
+    </developer>
+  </developers>
   <dependencies>
     <dependency>
       <artifactId>protobuf-java</artifactId>
@@ -12,4 +58,138 @@
       <version>2.4.1</version>
     </dependency>
   </dependencies>
+  <build>
+    <sourceDirectory>${basedir}/src</sourceDirectory>
+    <resources>
+<!--
+      <resource>
+        <directory>${basedir}/..</directory>
+        <targetPath>${project.build.directory}</targetPath>
+        <includes>
+          <include>mesos-0.9.0.jar</include>
+        </includes>
+      </resource>
+-->
+      <resource>
+        <directory>${basedir}/classes</directory>
+        <!--<targetPath>${project.build.directory}</targetPath>-->
+      </resource>
+    </resources>
+    <plugins>
+      <!-- Skip compile:compile by re-binding it to a non-standard (made-up)
+           phase. -->
+      <plugin>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>default-compile</id>
+            <phase>never</phase>
+          </execution>
+        </executions>
+      </plugin>
+      <!-- Skip tests entirely -->
+      <plugin>
+        <artifactId>maven-surefire-plugin</artifactId>
+        <configuration>
+          <skip>true</skip>
+        </configuration>
+      </plugin>
+      <!-- Build the jar for from the classes that the make build system
+           compiled for us from source -->
+      <plugin>
+        <artifactId>maven-jar-plugin</artifactId>
+        <configuration>
+          <finalName>${project.name}-${project.version}</finalName>
+        </configuration>
+        <!-- Uncomment to skip packaging a jar ourselves,
+             and instead use the one built by make -->
+        <!-- Uses trickery found at http://stackoverflow.com/a/4853816 -->
+<!--
+        <executions>
+          <execution>
+            <id>default-jar</id>
+            <phase>never</phase>
+            <configuration>
+              <finalName>unwanted</finalName>
+              <classifier>unwanted</classifier>
+            </configuration>
+          </execution>
+        </executions>
+-->
+      </plugin>
+      <!-- Attach the prebuilt mesos jar to this build -->
+<!--
+      <plugin>
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>build-helper-maven-plugin</artifactId>
+        <version>1.7</version>
+        <executions>
+          <execution>
+            <id>attach-artifacts</id>
+            <phase>package</phase>
+            <goals>
+              <goal>attach-artifact</goal>
+            </goals>
+            <configuration>
+              <artifacts>
+                <artifact>
+                  <file>${basedir}/../mesos-0.9.0.jar</file>
+                  <type>jar</type>
+                  <classifier>${project.classifier}</classifier>
+                </artifact>
+              </artifacts>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+-->
+      <!-- Build and attach javadoc -->
+      <plugin>
+        <artifactId>maven-javadoc-plugin</artifactId>
+        <configuration>
+          <sourcepath>src</sourcepath>
+          <subpackages>org.apache.mesos</subpackages>
+        </configuration>
+        <executions>
+          <execution>
+            <id>build-and-attach-javadocs</id>
+            <phase>package</phase>
+            <goals>
+              <goal>jar</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+      <!-- Package up the Java source -->
+      <plugin>
+        <artifactId>maven-source-plugin</artifactId>
+        <configuration>
+          <excludeResources>true</excludeResources>
+        </configuration>
+        <executions>
+          <execution>
+            <id>attach-sources</id>
+            <goals>
+              <goal>jar</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+      <!-- We want to sign the artifact, the POM, and all attached artifacts -->
+      <plugin>
+        <artifactId>maven-gpg-plugin</artifactId>
+        <configuration>
+          <passphrase>${gpg.passphrase}</passphrase>
+          <useAgent>${gpg.useagent}</useAgent>
+        </configuration>
+        <executions>
+          <execution>
+            <goals>
+              <goal>sign</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
 </project>