Sonatype

8 views
Skip to first unread message

Sebastiano Vigna

unread,
Feb 22, 2012, 4:07:32 AM2/22/12
to fast...@googlegroups.com
I'm trying to learn how to push stuff to Maven Central through Sonatype.

I know someone is pushing fastutil, so if there's anythign you can share (basic configuration files, etc.) please help :).

My final goal is to be able to send stuff *without using Maven*, signing manually using gpg etc. I would like to send out all our stuff (fastutil, DSI Utilities, WebGraph, Sux4J, etc.) in the end through Maven and drop JPackage support.

Ciao,

seba


Dawid Weiss

unread,
Feb 22, 2012, 4:22:00 AM2/22/12
to fast...@googlegroups.com
> I know someone is pushing fastutil, so if there's anythign you can share (basic configuration files, etc.) please help :).

There is a documentation bit at sonatype which explains the process.

https://docs.sonatype.org/display/Repository/Sonatype+OSS+Maven+Repository+Usage+Guide

Basically you need to get the credentials to log in to their nexus
system online:

https://oss.sonatype.org/index.html#welcome

Then from there you can add a prepared release bundle (with signing
information etc) and once it's verified and staged, release it.

> My final goal is to be able to send stuff *without using Maven*, signing manually using gpg etc. I would like to send out all our stuff (fastutil, DSI Utilities, WebGraph, Sux4J, etc.) in the end through Maven and drop JPackage support.

It's definitely possible -- I used to have an ANT file to do that, but
it's a pain. It is a maven-centric world, unfortunately. I never
managed to get a multi-file (multipackage) release pushed this way
with a single release number, for example.

The simplest way I can recommend is to use maven for things it does
well (compilation, packaging) and maven-ant-plugin to switch back to
ant when complex things are necessary.

Be prepared for a fair dose of frustration at the beginning...

Dawid

Sebastiano Vigna

unread,
Feb 22, 2012, 6:40:55 AM2/22/12
to fast...@googlegroups.com

On Feb 22, 2012, at 10:22 AM, Dawid Weiss wrote:

> https://docs.sonatype.org/display/Repository/Sonatype+OSS+Maven+Repository+Usage+Guide

Yep, that's where I started from.

> Basically you need to get the credentials to log in to their nexus
> system online:

Yes, I have also registered two projects.

> Then from there you can add a prepared release bundle (with signing
> information etc) and once it's verified and staged, release it.


Do you have, like, a sample POM file?

I know it's a pain with ant, but I really can't stand maven. I'll makefile the thing, do whatever is needed, but no maven :).

Ciao,

seba


Dawid Weiss

unread,
Feb 22, 2012, 7:16:04 AM2/22/12
to fast...@googlegroups.com
>> Then from there you can add a prepared release bundle (with signing
>> information etc) and once it's verified and staged, release it.
>
> Do you have, like, a sample POM file?

So you want a POM file or an ANT file? I was putting together a JAR
file for uploading to sonatype manually -- it was basically about
putting together all project JARs, collecting sources and javadocs for
these JARs, collecting a POM (any pom will do) and signing them
manually, then throwing everything into a ZIP/JAR file. I don't quite
remember where I was doing it though... I think it was for the HPPC
project but you'd need to browse the git history... I can't quite
pinpoint where it was; I see we used to have manual JAR deployments at
some point like this:

<target name="maven.deploy.release" depends="maven.prepare">
<exec dir="etc/maven" executable="mvn" vmlauncher="false"
searchpath="true" failonerror="true">
<arg value="deploy:deploy-file" />
<arg
value="-Durl=ftp://174.132.130.8/public_html/com.carrotsearch.repository/labs/releases"
/>
<arg value="-DrepositoryId=carrotsearch.labs.releases.ftp" />
<arg value="-DpomFile=${dist.dir}/pom.xml" />
<arg value="-DgeneratePom=false" />
<arg value="-DuniqueVersion=false" />
<arg value="-DupdateReleaseInfo=true" />
<arg value="-Dversion=${hppc.version}" />
<arg value="-Dfile=${dist.dir}/${dist.name}.jar" />
</exec>
</target>

But this was so much pain that even maven seems like lesser evil.

> I know it's a pain with ant, but I really can't stand maven. I'll makefile the thing, do whatever is needed, but no maven :).

The plus of using maven with mavencentral is that it'll keep your POM
and dependencies consistent... I remain skeptical about maven and
really complex projects too, but the truth is keeping your
(artificial) POM, makefiles and other things in sync will be more of a
headache than switching to maven. That's my gut feeling based on
experience :(

Build that jar with signed jars and a POM file inside and try to
release it. Sonatype has a verification step so it won't let you close
and release an artifact that is missing things or hasn't been signed.

Dawid

Sebastiano Vigna

unread,
Feb 22, 2012, 10:20:49 AM2/22/12
to fast...@googlegroups.com

On Feb 22, 2012, at 1:16 PM, Dawid Weiss wrote:

> So you want a POM file or an ANT file? I was putting together a JAR

Both :). I found indications at the bottom of the page... I have in theory an ant setup that should reasonably be able to distribute a release. I'm waiting for the Sonatype guys to authorize the upload... and then we'll see!

Ciao,

seba


Michael Ekstrand

unread,
Feb 22, 2012, 10:28:13 AM2/22/12
to fast...@googlegroups.com
Since Fastutil doesn't have any external dependencies, it can be pretty simple:



  <modelVersion>4.0.0</modelVersion>

  <groupId>it.unimi.dsi</groupId>
  <artifactId>fastutil</artifactId>
  <version>6.4.2</version>
  <packaging>jar</packaging>

  <name>fastutil</name>
  <description>
    fastutil extends the Java™ Collections Framework by providing
    type-specific maps, sets, lists and queues with a small memory
    footprint and fast access and insertion; it also includes a fast
    I/O API for binary and text files. It is free software distributed
    under the GNU Lesser General Public License. This packaging is
    not provided by the original developer, so do not contact him
    about Maven package issues.
  </description>

  <licenses>
    <license>
      <name>Apache Software License, version 2.0 (ASL2.0)</name>
    </license>
  </licenses>
</project>
This is extracted from the full POM we've created for our uploads: https://github.com/elehack/fastutil-maven/blob/master/pom.xml.

The Apache Ivy people might have some further info on pushing to Maven with just Ant - Ivy uses the Maven Central repositories as its primary source of dependencies.

- Michael
--
Michael Ekstrand <ekst...@cs.umn.edu>
Ph.D candidate, Computer Science — University of Minnesota
GroupLens Research: http://www.grouplens.org

Reply all
Reply to author
Forward
0 new messages