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

grgit-core as runtime dependency for grgit-gradle from gradle plugin portal #271

Closed
artemy-osipov opened this issue Jan 12, 2019 · 5 comments
Labels

Comments

@artemy-osipov
Copy link

grgit-core has not resolved in compileClasspath for grgit-gradle from gradle plugin portal when using Gradle 5.0

build.gradle:

plugins {
    id 'groovy'
}

repositories {
    gradlePluginPortal()
}

dependencies {
    compile 'org.ajoberstar.grgit:grgit-gradle:3.0.0'
    compile 'org.codehaus.groovy:groovy-all:2.5.0'
}

result of ./gradlew dependencies --configuration compileClasspath

compileClasspath - Compile classpath for source set 'main'.
+--- org.ajoberstar.grgit:grgit-gradle:3.0.0
\--- org.codehaus.groovy:groovy-all:2.5.0
     +--- org.codehaus.groovy:groovy:2.5.0
...

But grgit-gradle from jcenter works well

compileClasspath - Compile classpath for source set 'main'.
+--- org.ajoberstar.grgit:grgit-gradle:3.0.0
|    \--- org.ajoberstar.grgit:grgit-core:3.0.0
|         \--- org.eclipse.jgit:org.eclipse.jgit:5.1.3.201810200350-r
|              +--- com.jcraft:jsch:0.1.54
|              +--- com.jcraft:jzlib:1.1.1
|              +--- com.googlecode.javaewah:JavaEWAH:1.1.6
|              \--- org.slf4j:slf4j-api:1.7.2
\--- org.codehaus.groovy:groovy-all:2.5.0
     +--- org.codehaus.groovy:groovy:2.5.0
...

Probably that happens via different dependency block in their pom

@ajoberstar
Copy link
Owner

Thanks for the report! This should have been resolved when #267 was fixed (prior to the 3.0.0 final release). Looking at the POM files they are different between the two, though even the plugin portal lists grgit-core as a compile dependency. However, it does also list it as a runtime dependency, which seems odd.

In 3.0.0, I was using 0.9.10 of the gradle plugin publishing plugin, which created its own POM file different from what is used by the Maven publish plugin. In 0.10.0 they now reuse the Maven publish POM. So I think a re-release with the newer plugin would fix this.

I'll leave this until the next batch of fixes, since there's ways around it.

@ajoberstar ajoberstar added the bug label Jan 12, 2019
@ajoberstar ajoberstar added this to the 3.1.0 milestone Jan 12, 2019
@ajoberstar ajoberstar removed this from the 3.1.0 milestone Mar 23, 2019
@jjohannes
Copy link

Hi. Unfortunately, this is still (or again) an issue with 4.1.1 (tested with Gradle 7.3.1).

If you look at the POM, you notice that there are two entries for grgit-core:

    <dependency>
      <groupId>org.ajoberstar.grgit</groupId>
      <artifactId>grgit-core</artifactId>
      <version>4.1.1</version>
      <scope>compile</scope>
      <type>jar</type>
      <optional>false</optional>
    </dependency>
    <dependency>
      <groupId>org.ajoberstar.grgit</groupId>
      <artifactId>grgit-core</artifactId>
      <version>4.1.1</version>
      <scope>runtime</scope>
      <type>jar</type>
      <optional>false</optional>
    </dependency>

Looks like Gradle uses the last one if there are multiple entires. You could argue that Gradle could be a bit more "careful" when parsing the POM, but having these two entries also does not make much sense. Usually, there should be only one entry for each dependency. And compile scope in Maven already means that it is included at runtime. Hence, the second entry can be removed. I don't know how it ends up in there though.

@ajoberstar
Copy link
Owner

Resolved in 5.0.0

@jjohannes
Copy link

Thanks for having a look at this @ajoberstar. Unfortunately, the issue is still present in the 5.0.0-rc.3.pom.

@jjohannes
Copy link

jjohannes commented Feb 14, 2022

My bad, I missed

As of 5.0.0, this project is no longer directly published to the Gradle Plugin Portal

and thought rc.3 was the latest. Works well with rc.7 (and the final 5.0.0). 👍 Thanks for fixing!

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

3 participants