I have a Gradle project which creates a zip artifact. I define the artifact via `artifacts.add('default', zipTask)`. I add this project to another project via `includeBuild` and use the zip as dependency (`dependencies { myConfiguration 'org.example:testA:+@zip' }`).
So far so good. It works.

The problem starts when I add the plugin `java` to the first project. For some reason it prevents Gradle from finding the zip artifact.
The error is:

```
Execution failed for task ':doubleZipTask'.
> Could not resolve all files for configuration ':myConfiguration'.
   > Could not find testA.zip (project :testA).

```

Why? How to fix it?

Complete example:
=================

Project `testA`
---------------

`settings.gradle`:

```
rootProject.name = 'testA'

```

`build.gradle`:

```
plugins {
    id 'base'
    // Uncomment the line below to break the zip artifact
    //id 'java'
}

group = 'org.test'
version = '0.0.0.1_test'

task zipTask(type: Zip) {
    from './settings.gradle' // just so the zip isn't empty
}

artifacts.add('default', zipTask)

```

Project `testB`
---------------

`settings.gradle`:

```
rootProject.name = 'testB'

// This line may be commented out in some cases and then the artifact should be downloaded from Maven repository.
// For this question it should be always uncommented, though.
includeBuild('../testA')

```

`build.gradle`:

```
plugins {
    id 'base'
}

configurations {
    myConfiguration
}

dependencies {
    myConfiguration 'org.test:testA:0.0.0.+@zip'
}

task doubleZipTask(type: Zip) {
    from configurations.myConfiguration
}

```

---

Update 1
--------

I've added some diagnostic code at the end of the `build.grade`:

```
configurations.default.allArtifacts.each() {
    println it.toString() + ' -> name: ' + it.getName() + ', extension: ' + it.getExtension()
}

```

and in the version with `java` plugin it prints:

```
ArchivePublishArtifact_Decorated testA:zip:zip: -> name: testA, extension: zip
org.gradle.api.internal.artifacts.dsl.LazyPublishArtifact@2c6aaa5 -> name: testA, extension: jar

```

However, I'm not sure if an additional artifact can break something.

It doesn't seem to be a problem when I add a second artifact myself.

---

Update 2
--------

Maybe the zip file isn't the best representation of my intentions. After all, I could build java related files in one project and zip them in another.
However, the problem also applies to war files. (War plugin internally uses the Java plugin so it cannot be run separately.)