Hi, i’m having an issue with a composite build that includes a project using the ear
plugin. i created a sample project to show the issue. it looks like:
ear-composite
├── gradle-java-ear
│ ├── build.gradle
│ └── settings.gradle
└── test
├── build.gradle.kts
├── gradle
│ └── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
└── settings.gradle.kts
the test
project includes the gradle-java-ear
project and the build file looks like:
plugins {
base
}
val ears by configurations.creating
configurations.all {
isTransitive = false
}
dependencies {
ears("org.test:gradle-java-ear")
}
tasks.register<Copy>("fetchDeployments") {
into(layout.buildDirectory.dir("deployments"))
from(ears)
}
when running gradle fetchDeployments
, i get the following error:
Could not determine the dependencies of task ':fetchDeployments'.
> Could not resolve all task dependencies for configuration ':ears'.
> Could not resolve org.test:gradle-java-ear.
Required by:
project :
> Cannot choose between the following variants of project :gradle-java-ear:
- deploy
- earlib
All of them match the consumer attributes:
- Variant 'deploy' capability org.test:gradle-java-ear:unspecified:
- Unmatched attributes:
- Provides org.gradle.category 'library' but the consumer didn't ask for it
- Provides org.gradle.dependency.bundling 'external' but the consumer didn't ask for it
- Provides org.gradle.usage 'java-runtime' but the consumer didn't ask for it
- Variant 'earlib' capability org.test:gradle-java-ear:unspecified:
- Unmatched attributes:
- Provides org.gradle.category 'library' but the consumer didn't ask for it
- Provides org.gradle.dependency.bundling 'external' but the consumer didn't ask for it
- Provides org.gradle.usage 'java-runtime' but the consumer didn't ask for it
Any ideas on what i’m missing? I’ve uploaded the test project.
ear-composite.zip (64.7 KB)