[GRADLE-2042] gradle adds classifier to testng and can't get it from maven repository Created: 11/Jan/12  Updated: 10/Feb/17  Resolved: 10/Feb/17

Status: Resolved
Project: Gradle
Affects Version/s: 1.0-milestone-7
Fix Version/s: None

Type: Bug
Reporter: necromantiarian Assignee: Unassigned
Resolution: Won't Fix Votes: 3

Attachments: Text File build-m8.txt     Text File dependencies.txt    

 Description   

gradle adds a classifier to testng dependency , despite the fact that it wasn't specified at all or when I explicitly make it null, also source and target are 1.6
the classifier it adds is jdk15

the error is:
Could not resolve all dependencies for configuration ':testCompile'.
Cause: Artifact 'org.testng:testng:6.3.1:jdk15@jar' not found

---------------------------
apply plugin 'groovy

sourceCompatibility = 1.6
targetCompatibility = 1.6

defaultTasks 'clean', 'build'

repositories

{ mavenLocal() }

dependencies

{ groovy 'org.codehaus.groovy:groovy-all:1.8.4' testCompile 'log4j:log4j:1.2.16', 'org.testng:testng:6.3.1' }

test

{ useTestNG() }

 Comments   
Comment by Adam Murdoch [ 11/Jan/12 ]

Can you run 'gradle dependencies', and send in the output? Also, can you try using mavenCentral() instead of mavenLocal()?

Comment by Gianni Bruno [ 14/Jan/12 ]

Just a 'me too', I'm using mavenCentral() and get the same error for testng 6.3.1

Comment by Gianni Bruno [ 09/Feb/12 ]

Any chance of a fix for m8? or maybe there is a workaround I can use until it's sorted?

Comment by Daz DeBoer [ 10/Feb/12 ]

I can't reproduce this issue with Milestone7 or Milestone8. So we'll need a bit more information:
Can you please download the Milestone8 snapshot and run your build with:

gradle --refresh=dependencies --info build

The output of this command might help us track down what's going on. Thanks!

Comment by Gianni Bruno [ 11/Feb/12 ]

m8 build info attached as requested - build-m8.txt

Comment by Gianni Bruno [ 14/Feb/12 ]

I've found the problem, I'm using 'org.uncommons:reportng:1.1.2' which declares a dependency on testng 5.0 with the jdk15 classifier.

<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>5.0</version>
<classifier>jdk15</classifier>
</dependency>

If I remove the reportng dependency from my build it works fine.
Seems gradle is also adding the classifier to the testng 6.3.1 dependency.

Comment by Lidia Marchioni [ 16/Apr/12 ]

What is the solution to the reportng dependency problem? I'm trying to build with selenium, testng and reportng and get the same error:

Could not resolve all dependencies for configuration ':compile'.
> Artifact 'org.testng:testng:6.3.1:jdk15@jar' not found.

I have the following in my dependencies declaration:

dependencies

{ compile "org.seleniumhq.selenium:selenium-java:2.15.0" compile "org.testng:testng:6.3.1" // from http://kaczanowscy.pl/tomek/2009-12/better-looking-test-reports-with-reportng compile "org.uncommons:reportng:1.1.2" //ori testCompile 'org.testng:testng:5.11:jdk15@jar' }

When I run gradlew.bat dependencies, the tail of the output is:

+--- org.testng:testng:6.3.1 [default]

+--- junit:junit:3.8.1 [compile,master,runtime]
+--- org.beanshell:bsh:2.0b4 [compile,master,runtime]
+--- com.beust:jcommander:1.12 [compile,master,runtime]
--- org.yaml:snakeyaml:1.6 [compile,master,runtime]
--- org.uncommons:reportng:1.1.2 [default]
+--- org.testng:testng:6.3.1 [compile,runtime,master]
--- velocity:velocity:1.4 [compile,master,runtime]
--- velocity:velocity-dep:1.4 [compile,runtime,master]

- dependencies omitted (listed previously)

What is the correct way to add reportng dependency?

Comment by Tony Nelson [ 24/Oct/12 ]

Is there any solution to this problem yet? I've run into it again today using both the version 1.0 gradle wrapper, and an installed copy of gradle 1.2.

The most frustrating part is that I'm not even using TestNG.

For completeness:

FAILURE: Build failed with an exception.

  • What went wrong:
    Could not resolve all dependencies for configuration ':web:testCompile'.
    > Artifact 'org.testng:testng:5.14.10:jdk15@jar' not found.
Comment by Adam Murdoch [ 30/Oct/12 ]

@Tony, if you're not using TestNG, then a workaround is simply to exclude it:

configurations.all

{ exclude group: 'org.testng', module: 'testng' }
Comment by Kevin Pearcey [ 29/Apr/13 ]

Still an issue with 1.5 - I'm attempting to follow this:
http://docs.codehaus.org/display/GRADLE/Cookbook#Cookbook-addreporters

but want a later version of TestNG.

Comment by Adam Murdoch [ 30/Apr/13 ]

@Kevin, why don't you just use the built-in Gradle test report rather than reportng?

Comment by Benjamin Muschko [ 15/Nov/16 ]

As announced on the Gradle blog we are planning to completely migrate issues from JIRA to GitHub.

We intend to prioritize issues that are actionable and impactful while working more closely with the community. Many of our JIRA issues are inactionable or irrelevant. We would like to request your help to ensure we can appropriately prioritize JIRA issues you’ve contributed to.

Please confirm that you still advocate for your JIRA issue before December 10th, 2016 by:

  • Checking that your issues contain requisite context, impact, behaviors, and examples as described in our published guidelines.
  • Leave a comment on the JIRA issue or open a new GitHub issue confirming that the above is complete.

We look forward to collaborating with you more closely on GitHub. Thank you for your contribution to Gradle!

Comment by Benjamin Muschko [ 10/Feb/17 ]

Thanks again for reporting this issue. We haven't heard back from you after our inquiry from November 15th. We are closing this issue now. Please create an issue on GitHub if you still feel passionate about getting it resolved.

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