Skip to content
This repository has been archived by the owner on Mar 28, 2019. It is now read-only.

Create public maven release #3

Closed
ghost opened this issue Apr 1, 2016 · 33 comments
Closed

Create public maven release #3

ghost opened this issue Apr 1, 2016 · 33 comments

Comments

@ghost
Copy link

ghost commented Apr 1, 2016

Please create a public maven release of OpenPDF so that I can include it as a dependency in my pom.xml file.

@ghost
Copy link
Author

ghost commented Apr 21, 2016

Perhaps this link is relevant: https://maven.apache.org/guides/mini/guide-central-repository-upload.html
It would be nice with a release of OpenPDF to the public maven repo.

@syakovyn
Copy link

I can see there was a request https://issues.sonatype.org/browse/OSSRH-22003 to release OpenPDF to the maven central. Unfortunately, it was closed due to an improper group id. Are you going to make one more request with a rectified group id?

@ghost
Copy link
Author

ghost commented May 12, 2016

The groupId has been changed to com.github.rtfarte. I have also added a comment to the sonatype.org jira issue. Is there anything more to do to get access to the maven central?

@syakovyn
Copy link

I am just afraid if commenting on the already closed ticket will help. Let's wait until Monday (5/16) and if the ticket remains closed, create a new one.

@ghost
Copy link
Author

ghost commented May 12, 2016

@rtfarte please see the update on https://issues.sonatype.org/browse/OSSRH-22003

@rtfarte
Copy link
Owner

rtfarte commented May 12, 2016

Andreas,

Thanks for picking up the slack for me. I've been super busy at work and have been unable to put a bunch of time towards this. Are you able to perform the release?

Thanks,
Art

On May 12, 2016, at 9:29 AM, Andreas Røsdal notifications@github.com wrote:

@rtfarte please see the update on https://issues.sonatype.org/browse/OSSRH-22003


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub

@ghost
Copy link
Author

ghost commented May 12, 2016

What do we have to do in order to create a release now? I suggest we release the current git master as a new version now.

@ghost
Copy link
Author

ghost commented May 13, 2016

Ok, I have created a new 1.0 release here: https://github.com/rtfarte/OpenPDF/releases/tag/1.0

What are the next steps in order to publish this to the maven repo?

@ghost
Copy link
Author

ghost commented May 19, 2016

We still really need to get the release published on the maven repo.
There is some more information here: http://central.sonatype.org/pages/ossrh-guide.html

@syakovyn
Copy link

I plan to take a look at http://central.sonatype.org/pages/ossrh-guide.html tomorrow.

@ghost
Copy link
Author

ghost commented May 27, 2016

Hi again @syakovyn, did you get a chance to look at this issue?

@syakovyn
Copy link

Hi Andreas,

Unfortunately, I got very busy on my project. Don't expect to have time till the mid of next week.

@bengolder
Copy link

bengolder commented Jul 10, 2016

I did some skimming of this issue and the OSSRH Guide, because I'd love to be able to more easily install OpenPDF as a dependency.

Here are the steps that I can see:

1. Open a JIRA ticket with Sonatype (done)

2. Decide on the type of deployment plugin to use. Choices are maven-deploy-plugin or nexus-staging-maven-plugin.

Here is the pom.xml config for the nexus-staging-maven-plugin:

    <plugin>
      <groupId>org.sonatype.plugins</groupId>
      <artifactId>nexus-staging-maven-plugin</artifactId>
      <version>1.6.7</version>
      <extensions>true</extensions>
      <configuration>
        <serverId>ossrh</serverId>
        <nexusUrl>https://oss.sonatype.org/</nexusUrl>
        <autoReleaseAfterClose>true</autoReleaseAfterClose>
      </configuration>
    </plugin>

3. Add distributionManagement element to pom.xml. The contents of distributionManagement will depend on the plugin used.

For maven-deploy-plugin:

<distributionManagement>
  <snapshotRepository>
    <id>ossrh</id>
    <url>https://oss.sonatype.org/content/repositories/snapshots</url>
  </snapshotRepository>
  <repository>
    <id>ossrh</id>
    <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
  </repository>
</distributionManagement>

For nexus-staging-maven-plugin:

<distributionManagement>
  <snapshotRepository>
    <id>ossrh</id>
    <url>https://oss.sonatype.org/content/repositories/snapshots</url>
  </snapshotRepository>
</distributionManagement>

4. For the person who manages the deployments, they should create a settings.xml file in the root directory of the project. This file should include the JIRA login info and should not be tracked by git or any public version control.

<settings>
  <servers>
    <server>
      <id>ossrh</id>
      <username>your-jira-id</username>
      <password>your-jira-pwd</password>
    </server>
  </servers>
</settings>

5. Add javadoc and source jar plugins. If you want to reduce how often these plugins are run, you can add a profile that only runs these for a release.

Java doc and source jar plugins:

 <build>
  <plugins>
    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-source-plugin</artifactId>
      <version>2.2.1</version>
      <executions>
        <execution>
          <id>attach-sources</id>
          <goals>
            <goal>jar-no-fork</goal>
          </goals>
        </execution>
      </executions>
    </plugin>
    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-javadoc-plugin</artifactId>
      <version>2.9.1</version>
      <executions>
        <execution>
          <id>attach-javadocs</id>
          <goals>
            <goal>jar</goal>
          </goals>
        </execution>
      </executions>
    </plugin>
  </plugins>
</build>

The profile:

<profiles>
  <profile> 
    <id>release</id>
    <build>
      ...
      javadoc, source and gpg plugin from above
      ...
    </build>
  </profile>
</profiles>

6. Add the Maven GPG plugin to sign the components

You must have a GPG client installed and on your command line path for this plugin to work.

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-gpg-plugin</artifactId>
  <version>1.5</version>
  <executions>
    <execution>
      <id>sign-artifacts</id>
      <phase>verify</phase>
      <goals>
        <goal>sign</goal>
      </goals>
    </execution>
  </executions>
</plugin>
<settings>
  <profiles>
    <profile>
      <id>ossrh</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>
      <properties>
        <gpg.executable>gpg2</gpg.executable>
        <gpg.passphrase>the_pass_phrase</gpg.passphrase>
      </properties>
    </profile>
  </profiles>
</settings>

7. Add the Nexus Staging Maven Plugin for deployment and release

<plugin>
  <groupId>org.sonatype.plugins</groupId>
  <artifactId>nexus-staging-maven-plugin</artifactId>
  <version>1.6.7</version>
  <extensions>true</extensions>
  <configuration>
     <serverId>ossrh</serverId>
     <nexusUrl>https://oss.sonatype.org/</nexusUrl>
     <autoReleaseAfterClose>false</autoReleaseAfterClose>
  </configuration>
</plugin>

8. Add a staging release

Run

mvn clean deploy

and go to https://oss.sonatype.org/#stagingRepositories

I think you use your JIRA login to view the staging repositories

If things look good and there aren't any errors, you can create a release with:

mvn nexus-staging:release

@ghost
Copy link
Author

ghost commented Jul 11, 2016

Thanks for the effort, @bengolder. What is missing from the pom.xml, if anything?

@bengolder
Copy link

@andreasrosdal I looked in more detail and tried to update the instructions. I'm not 100% confident in my own understanding. I did what I could to understand their documentation. I imagine there will be some trial and error to publish. I'd be willing to try to publish it, but I believe that has to be done by the person who holds the JIRA login information.

@bengolder
Copy link

bengolder commented Sep 11, 2016

I took another look at this today. It looks like only a few steps remain.

  • There must be a choice of the deployment plugin to use. The choices appear to be maven-deploy-plugin or nexus-staging-maven-plugin. This affects what is needed in the pom.xml. @andreasrosdal I assume that you should make this decision. The pom.xml currently includes maven-deploy-plugin. Is that the one you'd like to try?
  • There is no distributionManagement element in the pom.xml. See above for examples of distributionManagement elements for each of the deployment plugins.
  • For the person who will do the deployments, add a settings.xml as described above, with JIRA login information. Make sure that settings.xml is ignored by git.
  • For the person who will do the deployments, include a gpg client plugin
  • Run mvn clean deploy. I think this will create a staging repository. Check https://oss.sonatype.org/#stagingRepositories to see if the staging deployment looks correct.
  • If the staging deployment looks good, run mvn nexus-staging:release to make a release on nexus.

If you think any of these are incorrect, or look confusing, let me know and I'd be happy to research them further.

@ghost
Copy link
Author

ghost commented Sep 11, 2016

@bengolder thanks for looking at this again! I really hope that you can help us create the release to the public maven repo. Can you please do the deployment? This project needs a public release for maven.

This affects what is needed in the pom.xml. @andreasrosdal I assume that you should make this decision. The pom.xml currently includes maven-deploy-plugin. Is that the one you'd like to try?

Sure, maven-deploy-plugin is fine with me.

@bengolder
Copy link

I'm willing to try, but there are few small difficulties it would involve

  1. I'm not sure if I would have sufficient privileges and access to create a release of this repo. I might have to release it from my own forked copy if I'm not able to access this repo or the previous work.
  2. I know little to nothing about Java or maven. My only experience is from trying to use this project. There is a chance I will make very basic mistakes in my attempts to publish.

I will see what I can do

@bengolder
Copy link

bengolder commented Sep 13, 2016

@andreasrosdal & @rtfarte I'm happy to try to complete this process.

Here are the options:

  1. I will make pull requests to finish preparing this repo for deployment, but either @andreasrosdal or @rtfarte will use their JIRA accounts to authenticate and run the publish commands.
  2. I can edit and publish my fork of this repo using a different groupId, com.github.bengolder and my own JIRA login. I can add both of you to the JIRA ticket so that you are able to publish to it in the future. I'm also happy to give you write access to my fork so you can use it as a means to publish the repo.

2 is the only option I can do on my own. I will proceed with that option unless you'd prefer something else. Let me know.

I've created a new ticket in order to proceed with option 2.
https://issues.sonatype.org/browse/OSSRH-24948

We should expect a response from the OSSRH admins within the next couple days.

@bengolder
Copy link

Update: They've created the OSSRH repo already (it only took 40 minutes!)
https://issues.sonatype.org/browse/OSSRH-24948

Next step is to try to do a staging deployment of the artifacts.

@ghost
Copy link
Author

ghost commented Sep 15, 2016

@bengolder Nice work! Ready for the next step?

@bengolder
Copy link

Yes, I'll start trying the staging deployments tomorrow.

@bengolder
Copy link

bengolder commented Sep 16, 2016

Update: I changed the group Id throughout the repo so that it will build and won't conflict with the other ticket. I installed gpg2 and I'm figuring out how to configure pgp signing on all the files. I'm also trying to figure out where to publish my public key.

@ghost
Copy link
Author

ghost commented Sep 16, 2016

Cool. One day, we will finally have a public maven release.

@bengolder
Copy link

bengolder commented Sep 17, 2016

Update: I worked through the PGP configuration and made some more edits to the pom.xml. I got most of the way through a staging deployment (using mv clean deploy), but ran into a little trouble at the end involving PGP. If you want to see the tail end of the deploy log, I pasted it into a gist: https://gist.github.com/bengolder/9260d5c69a000b85988c47e2ef86aacd

I added more details to the open ticket: https://issues.sonatype.org/browse/OSSRH-24948?focusedCommentId=372353&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-372353

@bengolder
Copy link

bengolder commented Sep 17, 2016

Update: I successfully completed a staging deploy! All that should be left is to review the staging deploy, double check the release settings and promote it to Central if it looks okay.

@bengolder
Copy link

bengolder commented Sep 17, 2016

Here is the staging repository on nexus: https://oss.sonatype.org/content/repositories/comgithubbengolder-1002/com/github/bengolder/
(no longer works, because I released the staging repo)

@bengolder
Copy link

bengolder commented Sep 17, 2016

I released the staging repository. It should be available on Maven central after the syncing is complete. I think we can check here for updates: https://issues.sonatype.org/browse/OSSRH-24948

@bengolder
Copy link

bengolder commented Sep 17, 2016

It's up on maven central! Someone should try to use the version I pushed to make sure it will work. I did change the group Id, so it would be good to ensure there aren't any conflicts.

http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.github.bengolder%22

If for any reason this published version doesn't work, I'm happy to walk someone else through the process of publishing to Maven central. Now that I've done it, it doesn't seem too complicated.

@bengolder
Copy link

bengolder commented Sep 18, 2016

The version in central seems to be working. I successfully used it as a dependency in another project, with the following configuration:

  <!-- Open PDF & associated dependencies -->
        <dependency>
            <groupId>org.bouncycastle</groupId>
            <artifactId>bcprov-jdk15on</artifactId>
            <version>1.54</version>
        </dependency>
        <dependency>
            <groupId>com.github.bengolder</groupId>
            <artifactId>openpdf</artifactId>
            <version>1.0</version>
        </dependency>

@bengolder
Copy link

bengolder commented Sep 18, 2016

To recap: my fork is now working and published to Maven central. This changes the group ID to com.github.bengolder.
@andreasrosdal and @rtfarte you both have write access to my fork, and I gave you both access to publish to Maven under that group ID & artifact ID.

If at any point you'd rather publish it under the original group ID: com.github.rtfarte, I'm happy to help walk you through the steps.

@ghost
Copy link
Author

ghost commented Sep 18, 2016

@bengolder Awesome work!

I would suggest that all future development of OpenPDF now occurs here:
https://github.com/bengolder/openpdf

@rtfarte
Copy link
Owner

rtfarte commented Sep 18, 2016

Agreed! Great work, guys. Hopefully you can continue to grow the project into something awesome!

Art

On Sep 17, 2016, at 11:29 PM, Andreas Røsdal notifications@github.com wrote:

@bengolder Awesome work!

I would suggest that all future development of OpenPDF now occurs here:
https://github.com/bengolder/openpdf


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

@ghost ghost closed this as completed Sep 23, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants