[GRADLE-2497] maven2Gradle generates 'sourceSets.test.classes' instead of 'sourceSets.test.output' Created: 24/Sep/12  Updated: 04/Jan/13  Resolved: 01/Nov/12

Status: Resolved
Project: Gradle
Affects Version/s: 1.2
Fix Version/s: 1.3-rc-1

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


 Description   

I have found that this script block

task packageTests(type: Jar)

{ from sourceSets.test.classes classifier = 'tests' }

artifacts.archives packageTests

provokes the following error when invoking a gradle task

C:\devpacks\dpjw\maven-prj\dpjwApp>gradle dpjw-core:clean

FAILURE: Build failed with an exception.

  • Where:
    Build file 'C:\devpacks\dpjw\maven-prj\dpjw-core\build.gradle' line: 27
  • What went wrong:
    A problem occurred evaluating project ':dpjw-core'.
    > Cannot get the value of write-only property 'classes' on source set test.
  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug
    option to get more log output.

BUILD FAILED

Commenting it out, the generated build script works fine .

(there is a warning about a "provided : true" on a property in a dependency compile block, which obviously should be "provided=true")



 Comments   
Comment by Gradle Forums [ 24/Sep/12 ]

@Szczepan Faber: do you think this is no issue of gradel2Maven but something of my Gradle environment? I'm just wondering because there is no response or comment...

Comment by Gradle Forums [ 24/Sep/12 ]

Nope, this is definitely a bug in maven2Gradle. It is still in an incubating stage. To workaround, please manually fix generated build.gradle files before running Gradle build. I'll extra a jira ticket for this so that we'll add a coverage for this problem.

It should be sourceSets.test.output, not 'classes'.

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