Giter Club home page Giter Club logo

Comments (28)

xrigau avatar xrigau commented on July 22, 2024

Hi @jenzz

Seems like bintray have released newer versions of the plugin and our plugin is using an old one. We'll look into this to see if there's any API change and fix it.

Thanks for reporting and we'll keep you updated!

from bintray-release.

ouchadam avatar ouchadam commented on July 22, 2024

Very odd! Cloning your project and running -PdryRun=true correctly deploys the artifact and poms to my .m2. We just double checked the api by doing a release and that also still works.

Out of interest are you running the
./gradlew clean build bintrayUpload -PbintrayUser=BINTRAY_USERNAME -PbintrayKey=BINTRAY_KEY -PdryRun=false command from the project root?

from bintray-release.

jenzz avatar jenzz commented on July 22, 2024

@ouchadam Yep, that's what I'm doing.

Deployment works fine, but if you check the contents of the generated pom.xml, you can see that the a/m attrs are missing:

<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.jenzz</groupId>
  <artifactId>materialpreference</artifactId>
  <version>1.0</version>
  <packaging>aar</packaging>
  <dependencies>
    <dependency>
      <groupId>com.android.support</groupId>
      <artifactId>appcompat-v7</artifactId>
      <version>21.0.3</version>
      <scope>runtime</scope>
    </dependency>
  </dependencies>
</project>

So Bintray is complaining about it when you're trying to push it through to Maven Central. I do that via their web UI.
The issue seems to be that the package doesn't comply with the Maven Central requirements which according to that link require the presence of name, description and url. And potentially license & dev infos...

from bintray-release.

xrigau avatar xrigau commented on July 22, 2024

Are you trying to sync with Maven Central?? So this error doesn't happen at build time but once you're logged in bintray?

If that's the case I'll raise it as an issue - we need to add the ability to add more fields to the generated pom such as contributors, author, url, etc.

We haven't used the Maven Central synchronisation yet and that's why we haven't faced this issue

from bintray-release.

jenzz avatar jenzz commented on July 22, 2024

@xrigau Fair enough. That's exactly what's happening.
Those fields seem to be optional for Bintray, but mandatory for Maven Central.

So looking at the plugin code, I think it's the maven publication closure that needs to be extended.
I might send a PR for this, if I don't get tied up..

from bintray-release.

ouchadam avatar ouchadam commented on July 22, 2024

pr welcome!

from bintray-release.

ZacSweers avatar ZacSweers commented on July 22, 2024

What's the latest on this? I'm stuck in the same situation

from bintray-release.

ouchadam avatar ouchadam commented on July 22, 2024

Internally we stopped releasing to maven central once jcenter came about so this doesn't have the highest priority.

But the change seems pretty simple , would just be a case of hooking up to the existing keys from here https://github.com/bintray/gradle-bintray-plugin/blob/master/src/main/groovy/com/jfrog/bintray/gradle/BintrayExtension.groovy
to here https://github.com/novoda/bintray-release/blob/master/core/src/main/groovy/com/novoda/gradle/release/BintrayConfiguration.groovy

Missing fields like Developers would fall under attributes

from bintray-release.

ZacSweers avatar ZacSweers commented on July 22, 2024

I see. Are you sure about that second link? Seems like everything's hooked up fine there, it's the closure that @jenzz linked that seems to need things: https://github.com/novoda/bintray-release/blob/master/core/src/main/groovy/com/novoda/gradle/release/ReleasePlugin.groovy#L24-L34

If you agree, I can take a crack at a PR.

from bintray-release.

ZacSweers avatar ZacSweers commented on July 22, 2024

Been taking a look at it. I'm not sure what you mean by this line though:

Missing fields like Developers would fall under attributes

What attributes/where are those set?

Also, how do you test this? I took a look at the contributing info and it mentioned tests, but there are no tests in this project.

from bintray-release.

ouchadam avatar ouchadam commented on July 22, 2024

my bad I got confused with the bintray and publication extensions, in that case it's a bit simpler.

ignore my previous comment!

We're delegating to this https://github.com/bintray/gradle-bintray-plugin/blob/master/src/main/groovy/com/jfrog/bintray/gradle/BintrayUploadTask.groovy#L424

Which in turn calls publication.asNormalisedPublication().pomFile, Publication comes from the maven-publish plugin if you wanted to manually test in a sandboxed project.

Unfortunately because we're a little new to the whole groovy testing it's been put on the back burner..... so don't worry too much about the tests, unless you want to show us how it's done!

from bintray-release.

ZacSweers avatar ZacSweers commented on July 22, 2024

It seems like it would be too late there wouldn't it? Doing it in the maven publication seems to be the right place, but I'm not sure how to go about setting up tests for groovy. I tried configuring my own in my project as specified here, but I get the same exception as in the last comment of #24. How do you guys normally test it?

from bintray-release.

ouchadam avatar ouchadam commented on July 22, 2024

I meant the maven publication like you said. I just posted a fix for the task name issue
#42

As for testing, I'm currently having to release the plugin locally and then use it to release another project. It's a bad flow but for now it works

from bintray-release.

blundell avatar blundell commented on July 22, 2024

so maybe we do need #30 ?

from bintray-release.

ouchadam avatar ouchadam commented on July 22, 2024

#30 is the same flow just the dummy project is within the codebase. anddddd whether or not it should live there is another discussion!

from bintray-release.

ZacSweers avatar ZacSweers commented on July 22, 2024

I see. I'll wait until that fix is released so I can test the custom publication, otherwise I don't think I can afford the time to work on it right now because I don't have time to learn pushing it locally or how to write groovy tests :/

from bintray-release.

jjhesk avatar jjhesk commented on July 22, 2024

add this to your gradle build file:

apply plugin: 'maven'
task createPom << {
    pom {
        project {
            name project.POM_DESCRIPTION
            packaging project.POM_PACKAGING
            description project.POM_DESCRIPTION
            url project.POM_URL
            version project.VERSION_NAME

            scm {
                url project.POM_SCM_CONNECTION
                connection project.POM_SCM_CONNECTION
                developerConnection project.POM_SCM_CONNECTION
            }

            licenses {
                license {
                    name project.POM_LICENCE_NAME
                }
            }

            developers {
                developer {
                    id project.POM_DEVELOPER_ID
                    name project.POM_DEVELOPER_NAME
                    email project.POM_EMAIL
                }
            }
        }
    }.writeTo("pom.xml")
}

and then go to the build selection tab and create a new task callback and name it as createPom

from bintray-release.

ZacSweers avatar ZacSweers commented on July 22, 2024

@jjhesk could you elaborate a bit on that? Where to use it, when to call the task, etc?

from bintray-release.

ZacSweers avatar ZacSweers commented on July 22, 2024

Specifically, the example you just gave just creates a pom.xml file in the top level of the project or wherever your build.gradle file is. How would you integrate that easily with this plugin?

from bintray-release.

ZacSweers avatar ZacSweers commented on July 22, 2024

I got it working, here's my repo for example: https://github.com/hzsweers/barber/blob/master/build.gradle#L42-L83

Basically, you have to hook the task @jjhesk described into the build process, and schedule it to run sometime after the plugin generates its default POM file but before upload. I have it set up to only configure this when bintrayUpload was one of the gradle tasks passed, and reuse the same configuration for both subprojects by using some logic to determine what values to put (packaging, name, etc)

from bintray-release.

elektrojunge avatar elektrojunge commented on July 22, 2024

Hi guys,
I just stumbled over this and thanks to @hzsweers solution I got it working in no time.
Why don't you guys add it to your readme.md? I'll happily submit a PR that contains this.
Cheers!

from bintray-release.

blundell avatar blundell commented on July 22, 2024

@elektrojunge pull requests welcome, I'll look out for it to review/merge 😺

from bintray-release.

elektrojunge avatar elektrojunge commented on July 22, 2024

#70

Not sure if the Wiki would be a better place for this. Do with it whatever you want. ;)

from bintray-release.

yilylong avatar yilylong commented on July 22, 2024

@jjhesk @hzsweers I did accroding to
https://github.com/novoda/bintray-release/wiki/Add-support-for-syncing-to-maven-central
but i got an error like below when build :
“Cannot invoke method doLast() on null object”

from bintray-release.

aheadlcx avatar aheadlcx commented on July 22, 2024

@hzsweers @jjhesk @yilylong I get the same result as @yilylong .
Anyone could help.
thanks in advance

from bintray-release.

qinglinyi avatar qinglinyi commented on July 22, 2024

@yilylong @aheadlcx I just add:

 gradle.taskGraph.whenReady { taskGraph ->
            def pomTask = taskGraph.getAllTasks().find {
                it.path == ":$project.name:generatePomFileForMavenPublication"
            }
            if (pomTask == null) return;
            pomTask.doLast {...

and right module name in:

if (IS_UPLOADING && project.name in['compiler','api']) {...

from bintray-release.

ashishraval21 avatar ashishraval21 commented on July 22, 2024

Hey all ,
I am stuck in the same issue like "Missing Some Attributes".
give me some solution to what i can do for that. I have not idea how to solve that issue.
Thanks in advance.

from bintray-release.

blundell avatar blundell commented on July 22, 2024

continue conversation on #96

from bintray-release.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.