Re: [netcdf-java] NetCDF jars=>Maven Central Repos?

Hello Chris

I have spent part of the day trying to sort out the NetCDF 4.2 dependencies in order to make them suitable to a Maven deployment. After some attempt to find my way in the Ant script, I finally found easier to really Mavenize the project. Maybe not up to the netcdf.jar file (this one could be build by Ant again), but at least for some dependencies like "unidatacommon", "grib" and "opendap".

I'm attaching to this email a new patch for the NetCDF build.xml. This is the same patch than the one you sent me, except that it doesn't recompile anymore the NetCDF library; it try to reuse the existing one. I didn't tested however. I can not commit this patch or any other file, since I don't have write access to the NetCDF SVN.

The pom.xml files are there: http://hg.geotoolkit.org/netcdf-deploy/file/tip
Would it be possible to add the configuration for the PGP signature please? The pom.xml that you sent me in your patch is in the cdm directory, in a modified form. You can get those pom.xml file with:

  hg clone http://hg.geotoolkit.org/netcdf-deploy

or I can send you a ZIP file or a SVN patch, as you prefer.

I have setup the project as a multi-module project. For now, the only modules that work are:

  * unidatacommon
  * common
  * grid
  * opendap

I have not yet reached the point where "cdm" (the main NetCDF module) compile, but I'm getting closer.

You need to do a trick for unidatacommon:

1) Create the unidataCommon directory manualy.
2) Download ftp://ftp.unidata.ucar.edu/pub/netcdf-java/v4.2/ncSrc-4.2.zip
3) Uncompress in whatever directory you wish.
4) Inside unidataCommon directory, create a link to <unzipped>/unidataCommon/src

Would it be possible for you to test if you can build?

        Thanks

Index: cdm/build.xml
===================================================================
--- cdm/build.xml       (revision 12812)
+++ cdm/build.xml       (working copy)
@@ -1,12 +1,12 @@
 <?xml version="1.0"?>
-<project name="cdm" default="makeMain" basedir=".">
+<project name="cdm" default="makeMain" basedir="." 
xmlns:artifact="antlib:org.apache.maven.artifact.ant">
   <echo>basedir=${basedir}</echo>
   <tstamp>
     <format property="build.time" pattern="yyyy-MM-dd HH:mm:ss" 
timezone="GMT"/>
     <format property="build.time.number" pattern="yyyyMMdd.HHmm" 
timezone="GMT"/>
   </tstamp>
 
-  <property name="release.version" value="4.2"/>
+  <property name="release.version" value="4.2.1"/>
   <!-- TeamCity sets "build.number" property to value of its build counter. -->
   <property name="build.number" value="${build.time.number}" />
   <property name="release.version.minor" 
value="${release.version}.${build.number}"/>
@@ -81,6 +81,10 @@
   <property name="stax.jar" value="stax-api-1.0.1.jar"/>
   <property name="unidatacommon.jar" value="unidatacommon.jar"/>
   <property name="visadNoDods.jar" value="visadNoDods.jar"/>
+  
+  <!-- define Maven coordinates. -->
+  <property name="maven-repository-url" 
value="https://oss.sonatype.org/service/local/staging/deploy/maven2"/>
+  <property name="maven-repository-id" value="sonatype-nexus-staging" />
 
   <!-- source -->
   <path id="sourcepath">
@@ -819,6 +823,43 @@
     </copy>
   </target>
 
+  <!-- Deploy the main NetCDF artifacts to Sonatype OSS Hosting, synced to 
Maven Central.
+       Before to deploy the main artifact, all dependencies must be deployed 
first. -->
+  <target name="m2-deploy" depends="makeMain, makeSrc-CDM, javadoc" 
description="deploy to Nexus">
+
+    <!-- sign and deploy the main artifact -->
+    <artifact:mvn>
+      <arg 
value="org.apache.maven.plugins:maven-gpg-plugin:1.1:sign-and-deploy-file" />
+      <arg value="-Durl=${maven-repository-url}" />
+      <arg value="-DrepositoryId=${maven-repository-id}" />
+      <arg value="-DpomFile=pom.xml" />
+      <arg value="-Dfile=${build.dir}/${jarMain}" />
+      <arg value="-Pnetcdf-release" />
+    </artifact:mvn>
+
+    <!-- sign and deploy the sources artifact -->
+    <artifact:mvn>
+      <arg 
value="org.apache.maven.plugins:maven-gpg-plugin:1.1:sign-and-deploy-file" />
+      <arg value="-Durl=${maven-repository-url}" />
+      <arg value="-DrepositoryId=${maven-repository-id}" />
+      <arg value="-DpomFile=pom.xml" />
+      <arg value="-Dfile=${build.dir}/${ncSrcRelease.jar}" />
+      <arg value="-Dclassifier=sources" />
+      <arg value="-Pnetcdf-release" />
+    </artifact:mvn>
+
+    <!-- sign and deploy the javadoc artifact -->
+    <artifact:mvn>
+      <arg 
value="org.apache.maven.plugins:maven-gpg-plugin:1.1:sign-and-deploy-file" />
+      <arg value="-Durl=${maven-repository-url}" />
+      <arg value="-DrepositoryId=${maven-repository-id}" />
+      <arg value="-DpomFile=pom.xml" />
+      <arg value="-Dfile=${build.dir}/${jarJavadoc}" />
+      <arg value="-Dclassifier=javadoc" />
+      <arg value="-Pnetcdf-release" />
+    </artifact:mvn>
+  </target>
+
   <!-- $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$  -->
   <target name="dist" depends="makeAll, makeIDVjar, thredds, makeSrc-CDM, 
javadoc, javadocAll"
           description="create a full distribution"/>
  • 2010 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the netcdf-java archives: