[GRADLE-3081] gradle 1.12 tries to resolve custom packaging with .jar extension Created: 05/May/14  Updated: 15/May/14  Resolved: 07/May/14

Status: Resolved
Project: Gradle
Affects Version/s: None
Fix Version/s: 2.0-rc-1

Type: Task
Reporter: Gradle Forums Assignee: Unassigned
Resolution: Fixed Votes: 0


 Description   

Hi,

I have a plugin that generates custom artifacts (.zip) and uploads them via maven to a nexus repository.

When I upgrade to gradle 1.12 I get errors when the plugin tries to find the artificats.

Caused by: org.gradle.api.internal.artifacts.ivyservice.ivyresolve.ArtifactNotFoundException: Artifact '<group>:<name>:<version>:<name>.jar' not found.

I debugged a bit and found out that the jar extension is mentioned in the cache

~/.gradle/caches/modules-2/metadata-2.6/descriptors/<group>/<name>/<version>/a3513388c78b5904e7c3c3af682f5a1a/ivy.xml:

....
<publications>
<artifact name="jquery-no-conflict-with-ui" type="zip" ext="jar" conf="master"/>
</publications>
....

Any idea where to tell gradle how to resolve the configurations with zip extension?

Thanks in advance



 Comments   
Comment by Gradle Forums [ 05/May/14 ]

Can you show the dependency declaration? Also, can you double-check that this problem exists with 1.12 but not 1.11?

Comment by Gradle Forums [ 05/May/14 ]

hey so the problem occures as soon as I set the
gradleVersion from "1.11" to "1.12" and run the wrapper task ( wrapper task runs successfully) but the tasks I execute afterwards fail.

The dependencies are defined like this:

dependencies {
webbundle "group:name:version"
}

webbundle is defined by my applied plugin:
in the apply method:

project.configurations {
webbundle
testWebbundle

{ extendsFrom webbundle }

}

there is also a conf2scopeMapping

if (project.plugins.hasPlugin(MavenPlugin)) {
project.conf2ScopeMappings.addMapping(500, project.configurations.webbundle, "webbundle")
}

The point where the plugin accesses the dependencies usually looks like this:

ResolvedComponentResult module = configuration.incoming.resolutionResult.root

for(Dependency d : module.dependencies){
....
}

Should I use @zip in the dependencies? but then I got the feeling the transitive dependencies are not being resolved or should I set the type/ext for the configuration somewhere explicitly?
I guess I also could go for JARing it but since it does not contain a META-INF nor classes I thought that would be wrong.

Running the dependencies task with 1.12 still seems to work.

Comment by Gradle Forums [ 05/May/14 ]

Can you show the code involved in publishing the zip? Perhaps the problem is on the publishing side.

Comment by Gradle Forums [ 05/May/14 ]

For publishing I use the "maven" plugin

project.apply plugin: 'maven'

The Archive task looks like this.

def assembleWebbundleTask = project.task("assembleWebbundle", type: Zip) {

from(taskX)

{ into "x/" }

from(taskY)

{ into "y/" }

from(taskZ)

{ into "z/" }

from onMoreFileGeneratingTask
}
project.artifacts

{ archives assembleWebbundleTask }

The generated build/poms/pom-default.xml

contains:

<packaging>zip</packaging>

and the other dependencies

<dependency>
<groupId>my.group</groupId>
<artifactId>my-name</artifactId>
<version>1.2.3-SNAPSHOT</version>
<scope>webbundle</scope>
</dependency>

Comment by Max Bruchmann [ 07/May/14 ]

Here is a example for that issue:

https://github.com/mxab/gradle-custom-package-resolve-problem

The error occures not when i iterate through myZipConf.incoming.resolutionResult.root

but when I try to access myZipConf.resolvedConfiguration.resolvedArtifacts files

Comment by Roman Besolov [ 15/May/14 ]

Adam Murdoch, Can you give me a link to the commit solves this issue? I want to do my own build of gradle 1.12 and fix this issue. Thanks.

Generated at Wed Jun 30 12:39:25 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.