New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publish snapshots to Sonatype #71

Closed
mmoayyed opened this Issue Feb 4, 2016 · 16 comments

Comments

Projects
None yet
2 participants
@mmoayyed
Copy link
Contributor

mmoayyed commented Feb 4, 2016

Testing the current master would be tremendously easier if ldaptive were to publish snapshots to sonatype. I can provide instructions and/or do the work, if you need an extra hand.

@mmoayyed

This comment has been minimized.

Copy link
Contributor

mmoayyed commented Feb 4, 2016

If this is done, at least CAS would be able to automatically test the changes that are published without any manual work. Collaboration would be that much faster.

@dfish3r

This comment has been minimized.

Copy link
Member

dfish3r commented Feb 4, 2016

I have sonatype credentials, but have never integrated publishing into the build.
Instructions would be helpful.

@mmoayyed

This comment has been minimized.

Copy link
Contributor

mmoayyed commented Feb 4, 2016

First step is, you will need to encrypt your credentials via Travis, and put them into a Travis file:
https://github.com/Jasig/cas/blob/4.1.x/.travis.yml

See those SECURE entries for instance.

Your credentials need to match a settings.xml file that is used by the sonatype deployment task:
https://github.com/Jasig/cas/blob/4.1.x/travis/settings.xml

So when you encrypt, you need to provide SONATYPE_USER=username and SONATYPE_PWD=password to the Travis command.

You'll need to have Travis installed locally of course. See instructions at the top of the yml file.

Then you instruct Travis to call a shell script to push changes to sonatype:
https://github.com/Jasig/cas/blob/4.1.x/travis/deploy-to-sonatype.sh

@mmoayyed

This comment has been minimized.

Copy link
Contributor

mmoayyed commented Feb 4, 2016

You can of course do all of this by hand manually, but letting Travis do this would be automatic and somewhat immediate.

@dfish3r

This comment has been minimized.

Copy link
Member

dfish3r commented Apr 21, 2016

Can you articulate the reasons why the sonatype repository is preferred over:
https://github.com/vt-middleware/maven-repo

Is it just about reducing the number of repository dependencies?

@mmoayyed

This comment has been minimized.

Copy link
Contributor

mmoayyed commented Apr 21, 2016

That, and sonatype auto publishes to central. This allows me to auto switch a GA to a SNAPSHOT without any further changes in the poms, which is much easier to teach. If a bug is fixed and the snapshot is made available automatically, I can just go back to my pom, switch the version and rebuild the same exact way without any additional changes.

@dfish3r

This comment has been minimized.

Copy link
Member

dfish3r commented Apr 21, 2016

Can you post a link to one of your poms that configures the sonatype repo?

@mmoayyed

This comment has been minimized.

@mmoayyed

This comment has been minimized.

Copy link
Contributor

mmoayyed commented Apr 21, 2016

Specifically:

<repositories>
        <repository>
            <id>sonatype-releases</id>
            <url>http://oss.sonatype.org/content/repositories/releases/</url>
        </repository>
        <repository>
            <id>sonatype-snapshots</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
        </repository>
    </repositories>

The "releases" bit arguably can be removed.

@dfish3r

This comment has been minimized.

Copy link
Member

dfish3r commented Apr 21, 2016

So it's not like sonatype is detecting whether you're asking for a snapshot or a release and silently redirecting you.
You still have to configure multiple repositories.

@mmoayyed

This comment has been minimized.

Copy link
Contributor

mmoayyed commented Apr 21, 2016

Correct.

@mmoayyed

This comment has been minimized.

Copy link
Contributor

mmoayyed commented Apr 27, 2016

So Daniel, would you want me to submit a PR to handle the sonatype/Travis changes?

@mmoayyed

This comment has been minimized.

Copy link
Contributor

mmoayyed commented May 7, 2016

Tried out the snapshot. Works great! thanks. Sorry I missed your earlier post on this.

@mmoayyed mmoayyed closed this May 7, 2016

@mmoayyed

This comment has been minimized.

Copy link
Contributor

mmoayyed commented May 7, 2016

So, I apologize for being this demanding but this still is not solved.

If I let travis pull the repository above and run through the tests, it fails miserable.
If I download and install ldaptive into my local repo and then run through tests, everything passes fine.

So, this sort of indicates to me that snapshots are not auto-published, right? State of the codebase is not the same of the repo. I don't know if you can call this a snapshot.

If you are manually publishing artifacts every once in a while, you're really releasing milestones. Which doesn't solve the problem stated in the original issue description.

Are there processes in place that publish snapshots to the github repo automatically?

@mmoayyed mmoayyed reopened this May 7, 2016

@dfish3r

This comment has been minimized.

Copy link
Member

dfish3r commented May 13, 2016

Updated ldaptive with travis config.
Snapshots are now being published to our repository automatically.

@dfish3r dfish3r closed this May 13, 2016

@mmoayyed

This comment has been minimized.

Copy link
Contributor

mmoayyed commented May 13, 2016

Very nice. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment