UndecoratorBis icon indicating copy to clipboard operation
UndecoratorBis copied to clipboard

Is there a way to provide a maven dependency?

Open PatrickHaas opened this issue 8 years ago • 17 comments

Hey there! i wanted to try out your example with my FX-Application but didn't find a way to a a maven dependency to my project. Is there a repo where I can find the jar for using it with maven?

Best regards Patrick

PatrickHaas avatar Apr 08 '16 09:04 PatrickHaas

Hi, Unfortunately not yet. I 'm just a beginner in using Maven central, so I only have to find the time... If you may, it could be great :) ! Thanks.

in-sideFX avatar Apr 08 '16 11:04 in-sideFX

Would you care to add a Gradle setup to the project? I've helped a couple of JavaFX projects (TestFX, JFoenix, VWorkflows, AnchorFX) to move to Gradle. We get lost of goodies with such build, one of them is the easy publication of binaries to bintray.com; at a later stage binaries can be synced from Bintray's JCenter to Maven Central.

aalmiray avatar Apr 08 '16 13:04 aalmiray

Sorry, but i'm stuck with maven cause of company restrictions :(

Best regards Patrick

PatrickHaas avatar Apr 14 '16 06:04 PatrickHaas

@PatrickHaas the Gradle setup was required for the Undecorator project itself, not for consumers as yourself :wink: @in-sideFX has merged a PR with the required changes. Now it's up to him to decide what needs to be changed in the configuration in order to push a release to Bintray first. :smile:

aalmiray avatar Apr 14 '16 06:04 aalmiray

@aalmiray, I've modified publishing.gradle file to include my credentials: user = 'in-sidefx' key = 'AZERTY', but I'm facing this issue:

:undecorator:bintrayUpload FAILED

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':undecorator:bintrayUpload'.

    Could not create version '0.0.0-SNAPSHOT': HTTP/1.1 400 Bad Request [message:Unable to create version 0.0.0-SNAPSHOT at 'in-sidefx/maven/undecorator'] Could you help? Thanks.

in-sideFX avatar Apr 14 '16 13:04 in-sideFX

Ah, right. Bintray does not allow snapshot releases to be published. However there's a way to publish snapshot release through Artifactory OSS @ JFrog

https://www.jfrog.com/confluence/display/RTF/Bintray+Integration https://www.jfrog.com/confluence/display/RTF/Deploying+Snapshots+to+oss.jfrog.org https://bintray.com/docs/usermanual/index.html

To be honest I haven't published a snapshot release through this mechanism yet. All the binaries I've released so far are regular releases. You might want to ping the JFrog guys for additional hints (such as @jbaruch). The alternative is to make the first release a non-snapshot one, for example 0.1.0.

aalmiray avatar Apr 14 '16 13:04 aalmiray

Yup, oss.jfrog.org is the way to go. Ping me if you need help with that.

jbaruch avatar Apr 14 '16 15:04 jbaruch

@jbaruch is there a "I'm in a hurry, need publish asap" step list on how to make this happen? I must confess I read the docs and found myself confused. Not as easy as simply configuring the bintray plugin and pushing "gradle bintrayUpload", is it?

aalmiray avatar Apr 14 '16 15:04 aalmiray

You mean for Artifactory? Why would be be gradle bintrayUpload for Artifactory? You need the Gradle Artifactory plugin to publish to Artifactory.

jbaruch avatar Apr 14 '16 15:04 jbaruch

Hm, which makes me thinking, maybe we need a unified plugin for both Artifactory and Bintray.

jbaruch avatar Apr 14 '16 15:04 jbaruch

Perhaps I explained myself badly. I'd like to see a document/blog post where the steps required for publishing to oss.jfrog.org and bintray is explained. Right now the information is found in a couple of documents (see links above) instead of a single place :smile:

What do you think?

If the metadata for publishing to Artifactory & Bintray is the same or almost the same then I guess it makes sense to unify both plugins. Otherwise I'll leave it as it is.

Bonus points for adding configuration to the gradle bintray plugin so that it can push snapshots directly to oss.jfrog.org.

I think the last option would be better as there would be a single point of configuration. Depending on the snapshot qualifier the plugin can push to Artifactory OSS or Bintray :smirk:

aalmiray avatar Apr 14 '16 15:04 aalmiray

Bintray plugin won't publish to Artifactory, it doesn't make sense. But JFrog plugin might publish to both. We'll look into this idea.

jbaruch avatar Apr 14 '16 15:04 jbaruch

Hi @aalmiray, I pushed something, could you take a look? Thanks

in-sideFX avatar Apr 15 '16 08:04 in-sideFX

great! But on which server did you push the binary? I tried searching oss.jfrog.org and bintray.com and came up empty

https://oss.jfrog.org/webapp/#/artifacts/browse//search/quick/eyJzZWFyY2giOiJxdWljayIsInF1ZXJ5IjoiaW5zaWRlZngifQ== https://oss.jfrog.org/webapp/#/artifacts/browse/tree/General/oss-snapshot-local

https://bintray.com/insidefx https://bintray.com/search?query=insidefx

aalmiray avatar Apr 15 '16 09:04 aalmiray

You missed the '-' in in-sidefx https://bintray.com/in-sidefx/maven/undecorator/0.1.0

in-sideFX avatar Apr 15 '16 09:04 in-sideFX

Aha! does this mean you pushed the version manually? Because the gradle.properties file at master shows version=0.0.0-SNAPSHOT and project_bintray_org=insidefx.

https://raw.githubusercontent.com/in-sideFX/UndecoratorBis/master/gradle.properties

you may want tom update those values so that the next time you may release using the gradle bintray plugin, either from the command line or from inside the IDE (using the IDE's gradle integration). :smile:

aalmiray avatar Apr 15 '16 09:04 aalmiray

Also, I don't know if you did this already, but you should see a button similar to "Add to JCenter" on the lower right corner of https://bintray.com/in-sidefx/maven/undecorator/0.1.0/view Click on it, then click on the next button. It will take some hours for your new package to be visible in JCenter.

For anyone else following this issue, the following repository must be configured in your Gradle build

maven { url 'https://dl.bintray.com/in-sidefx/maven' }

or if you prefer Maven then you must add it in this way

<repositories>
    <repository>
        <id>jcenter</id>
        <url>http://jcenter.bintray.com/</url>
    </repository>
    <repository>
        <id>in-sidefx</id>
        <url>https://dl.bintray.com/in-sidefx/maven/</url>
    </repository>
</repositories>

aalmiray avatar Apr 15 '16 09:04 aalmiray