Skip to content
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

Broken release on Maven Central #481

Closed
wiget opened this issue Jun 2, 2022 · 29 comments
Closed

Broken release on Maven Central #481

wiget opened this issue Jun 2, 2022 · 29 comments
Assignees
Labels

Comments

@wiget
Copy link
Contributor

wiget commented Jun 2, 2022

Jar for version 1.13.10 released to Maven Central is broken in some way.

* What went wrong:
Could not apply requested plugin [id: 'pl.allegro.tech.build.axion-release', version: '1.13.10'] as it does not provide a plugin with id 'pl.allegro.tech.build.axion-release'. This is caused by an incorrect plugin implementation. Please contact the plugin author(s).
> Plugin with id 'pl.allegro.tech.build.axion-release' not found.

Jar from Gradle Plugins works without problem.

https://plugins.gradle.org/m2/pl/allegro/tech/build/axion-release-plugin/1.13.10/axion-release-plugin-1.13.10.jar has md5 hash fb245869dbbf1ebfd0eb25fe83c128fa
but https://repo1.maven.org/maven2/pl/allegro/tech/build/axion-release-plugin/1.13.10/axion-release-plugin-1.13.10.jar has md5 hash d39481b8f5dc729250d2086ae313ba72

@bgalek
Copy link
Collaborator

bgalek commented Jun 2, 2022

@wiget thx for pointing out, gonna check it out as soon as possible!

@bgalek bgalek self-assigned this Jun 2, 2022
@bgalek bgalek added the bug label Jun 2, 2022
@bgalek
Copy link
Collaborator

bgalek commented Jun 2, 2022

I'm trying to figure out the problem, the faster way will be to release next (snapshot) version, @wiget will you check it?:)

@wiget
Copy link
Contributor Author

wiget commented Jun 3, 2022

Sure, I can test. Just let me know version number.

@bgalek
Copy link
Collaborator

bgalek commented Jun 3, 2022

@wiget i've released v1.13.11 - please check it out - this project is not ready to use anykind of gradle plugin snapshots ;(

@wiget
Copy link
Contributor Author

wiget commented Jun 3, 2022

@bgalek comparing your last commit to Gradle documentation I think gradlePlugin should be defined outside pluginBundle

Something like this

gradlePlugin {
    testSourceSets project.sourceSets.integration
    setAutomatedPublishing(false)
    plugins {
        release {
            id = 'pl.allegro.tech.build.axion-release'
            implementationClass = 'pl.allegro.tech.build.axion.release.ReleasePlugin'
        }
    }
}

pluginBundle {
    website = 'https://github.com/allegro/axion-release-plugin'
    vcsUrl = 'https://github.com/allegro/axion-release-plugin'
    description = 'Release and version management plugin.'
    tags = ['release', 'version']
    plugins {
        release {
            displayName = 'axion-release-plugin'
        }
    }
}

@bgalek
Copy link
Collaborator

bgalek commented Jun 3, 2022

I've seen this, but during the local maven publication it looked like it didn't make any difference - if the latest version still has problems I'll try that. We need to move from build.gradle to kts so this kind of things will be type checked.

@bgalek
Copy link
Collaborator

bgalek commented Jun 4, 2022

@wiget did you manage to test latest version? :)

@wiget
Copy link
Contributor Author

wiget commented Jun 4, 2022

If you mean v1.13.11, then yes. I used this Gradle project to test it: https://github.com/wiget/axion-test

Running ./gradlew --info tasks gives

> Configure project :app
Evaluating project ':app' using build file '/work/axion-test/app/build.gradle'.
Compiling build file '/work/axion-test/app/build.gradle' using SubsetScriptTransformer.
Resource missing. [HTTP GET: https://repo.maven.apache.org/maven2/pl/allegro/tech/build/axion-release/pl.allegro.tech.build.axion-release.gradle.plugin/1.13.11/pl.allegro.tech.build.axion-release.gradle.plugin-1.13.11.pom]

FAILURE: Build failed with an exception.

* Where:
Build file '/work/axion-test/app/build.gradle' line: 13

* What went wrong:
Plugin [id: 'pl.allegro.tech.build.axion-release', version: '1.13.11'] was not found in any of the following sources:

- Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
- Plugin Repositories (could not resolve plugin artifact 'pl.allegro.tech.build.axion-release:pl.allegro.tech.build.axion-release.gradle.plugin:1.13.11')
  Searched in the following repositories:
    MavenRepo

As you see metadata file for gradle plugin is missing on Maven Central.

@wiget
Copy link
Contributor Author

wiget commented Jun 4, 2022

I used gradle:7.4.2-jdk17-jammy Docker image for tests.

@bgalek
Copy link
Collaborator

bgalek commented Jun 5, 2022

@wiget I'll double checked jars published to maven local after moving gradlePlugin section it looks all right I hope it helps

@bgalek
Copy link
Collaborator

bgalek commented Jun 5, 2022

released v1.13.12,
I hope that in upcoming 1.14.0 with build-cache support and further kotlin compatibility improvements we will also move build.gradle to kts version and such dummy problems wont happen again ;)

@wiget
Copy link
Contributor Author

wiget commented Jun 6, 2022

From my testing it look like setAutomatedPublishing(false) is causing the problem.

Here is how local maven repository looks after publishToMavenLocal

└── pl
    └── allegro
        └── tech
            └── build
                └── axion-release-plugin
                    ├── 1.13.12
                    │   ├── axion-release-plugin-1.13.12.jar
                    │   ├── axion-release-plugin-1.13.12-javadoc.jar
                    │   ├── axion-release-plugin-1.13.12.module
                    │   ├── axion-release-plugin-1.13.12.pom
                    │   └── axion-release-plugin-1.13.12-sources.jar
                    └── maven-metadata-local.xml

and here with setAutomatedPublishing(true) (which is the default setting)

└── pl
    └── allegro
        └── tech
            └── build
                ├── axion-release
                │   └── pl.allegro.tech.build.axion-release.gradle.plugin
                │       ├── 1.13.12
                │       │   └── pl.allegro.tech.build.axion-release.gradle.plugin-1.13.12.pom
                │       └── maven-metadata-local.xml
                └── axion-release-plugin
                    ├── 1.13.12
                    │   ├── axion-release-plugin-1.13.12.jar
                    │   ├── axion-release-plugin-1.13.12-javadoc.jar
                    │   ├── axion-release-plugin-1.13.12.module
                    │   ├── axion-release-plugin-1.13.12.pom
                    │   └── axion-release-plugin-1.13.12-sources.jar
                    └── maven-metadata-local.xml

pl.allegro.tech.build.axion-release.gradle.plugin-1.13.12.pom it's crucial to resolve Gradle plugin id to artifact coordinates.

@bgalek
Copy link
Collaborator

bgalek commented Jun 6, 2022

and with setAutomatedPublishing(true) maven publish fails saying that there are two artifacts that ale colliding ;/

@bgalek
Copy link
Collaborator

bgalek commented Jun 6, 2022

@wiget https://github.com/allegro/axion-release-plugin/pull/486/files we can try it, as long as maven artifact won't be published (was the problem last time) I can always "withdraw" gradle portal publication

@bgalek
Copy link
Collaborator

bgalek commented Jun 6, 2022

@wiget https://github.com/allegro/axion-release-plugin/runs/6757276720?check_suite_focus=true I'm trying to distinguish artifact from plugin from the actual jars but as you see it's tricky ;(

@bgalek
Copy link
Collaborator

bgalek commented Jun 6, 2022

@wiget I've also updated badge Gradle Plugin Portal to see any differences with maven/gradle fast

@wiget
Copy link
Contributor Author

wiget commented Jun 6, 2022

#487 should help for colliding artifacts

@bgalek
Copy link
Collaborator

bgalek commented Jun 6, 2022

@wiget thx, this could also be the way to go - as for now, the issue is resolved with v1.13.13 right?

@wiget
Copy link
Contributor Author

wiget commented Jun 6, 2022

Nope.

Resource missing. [HTTP GET: https://repo.maven.apache.org/maven2/pl/allegro/tech/build/axion-release/pl.allegro.tech.build.axion-release.gradle.plugin/1.13.13/pl.allegro.tech.build.axion-release.gradle.plugin-1.13.13.pom]

plugin marker is missing.

@bgalek
Copy link
Collaborator

bgalek commented Jun 6, 2022

@wiget it's 404 for me, maven central sync takes some time

@wiget
Copy link
Contributor Author

wiget commented Jun 6, 2022

After successful publication I will expect two directories here: https://repo1.maven.org/maven2/pl/allegro/tech/build/

  • axion-release with plugin marker (pom)
  • axion-release-plugin with all jars and pom

@bgalek
Copy link
Collaborator

bgalek commented Jun 6, 2022

@wiget i can't see older versions of axion-release artifact/pom in maven central so I understand we've never published it before, right?

@wiget
Copy link
Contributor Author

wiget commented Jun 6, 2022

Correct.

@bgalek
Copy link
Collaborator

bgalek commented Jun 6, 2022

I see, that was the missing puzzle!
I thought that we broke something, but it had never been there in the first place!
Your pr seems to work (i see snapshot pom that you would expect)

<dependency>
  <groupId>pl.allegro.tech.build.axion-release</groupId>
  <artifactId>pl.allegro.tech.build.axion-release.gradle.plugin</artifactId>
  <version>1.13.14-SNAPSHOT</version>
  <type>pom</type>
</dependency>

as I've already created a lot of havoc with those dummy versions, I'll create another one with your changes

@bgalek
Copy link
Collaborator

bgalek commented Jun 6, 2022

v1.13.14 released, it will take a while to sync maven central if you do not use sonatype as a taget

@wiget
Copy link
Contributor Author

wiget commented Jun 6, 2022

Works with following settings:

                maven {
                        url 'https://oss.sonatype.org/service/local/repositories/releases/content/'
                }

Will re-check against Maven Central in few hours.

@wiget
Copy link
Contributor Author

wiget commented Jun 6, 2022

Works with Maven Central too. Thank you.

@wiget wiget closed this as completed Jun 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants