[GRADLE-1489] Assemble in Multi Project build does to much Created: 21/Apr/11  Updated: 04/Jan/13  Resolved: 16/Oct/11

Status: Resolved
Project: Gradle
Affects Version/s: 1.0-milestone-2
Fix Version/s: 1.0-milestone-5

Type: Bug
Reporter: Bas Jansen Assignee: Adam Murdoch
Resolution: Fixed Votes: 0

Attachments: Zip Archive gradleTest.zip    


I have two subprojects. In my main gradle build I add a task to build a testJar (containing the test classes).

subprojects {
	task testJar (type: Jar, dependsOn: compileTestJava) {
		from sourceSets.test.classesDir
		classifier = "tests"
		doFirst {		
			println "-------------- Building Test Jar for ${project.name} -----------------------"

Now only in project2, I add the testJar to the artifacts:

artifacts {
	archives testJar

The output of an assemble build now looks like:

bjansen@CNL1443 ~/Development/gradle-test $ gradle clean assemble
:project-1:processResources UP-TO-DATE
-------------- Building Test Jar for project-1 -----------------------
:project-2:processResources UP-TO-DATE
-------------- Building Test Jar for project-2 -----------------------


Total time: 4.025 secs

Problem: Also project 1 gets a testJar, although it is not defined as artifact of project 1!

See also attached zip for de code.

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