I have a test application with three options:
- dev: uses a local copy of the library at design time
- qa: uses snapshot during QA
- rc: Uses a pre-build to test release candidates.
dependencies { devCompile project(':library') qaCompile 'com.example:library:1.0.0-SNAPSHOT@aar' rcCompile 'com.example:library:1.0.0@aar' }
I run Gradle and expect it to do the minimum amount of work needed to build exactly what I want:
./gradlew :test-app:connectedAndroidTestDevDebug
However, the assembly fails because it tries to resolve dependencies for all assembly assemblies, and not just from what I create.
FAILURE: assembly failure with exception.
* Something went wrong:
There was a problem setting up the project: test-app.
Failed to resolve all dependencies for configuration: test-app: _qaDebugCompile.
Could not find com.example: library1.0.0-SNAPSHOT.
Searched in the following locations: https://repo1.maven.org/maven2/com/example/library/1.0.0-SNAPSHOT/maven-metadata.xml https://repo1.maven.org/maven2/com/example/library/1.0.0-SNAPSHOT/library-1.0.0-SNAPSHOT.pom https://repo1.maven.org/maven2/com/example/library/1.0.0-SNAPSHOT/library-1.0.0-SNAPSHOT.aar http://oss.sonatype.org/content/repositories/snapshots/com/example/library/1.0.0-SNAPSHOT/maven-metadata.xml http://oss.sonatype.org/content/repositories/snapshots/com/example/library/1.0.0-SNAPSHOT/library-1.0.0-SNAPSHOT.pom http://oss.sonatype.org/content/repositories/snapshots/com/example/library/1.0.0-SNAPSHOT/library-1.0.0-SNAPSHOT.aar file:/opt/android-sdk-macosx/extras/android/m2repository/com/example/library/1.0.0-SNAPSHOT/maven-metadata.xml file:/opt/android-sdk-macosx/extras/android/m2repository/com/example/library/1.0.0-SNAPSHOT/library-1.0.0-SNAPSHOT.pom file:/opt/android-sdk-macosx/extras/android/m2repository/com/example/library/1.0.0-SNAPSHOT/library-1.0.0-SNAPSHOT.aar file:/opt/android-sdk-macosx/extras/google/m2repository/com/example/library/1.0.0-SNAPSHOT/maven-metadata.xml file:/opt/android-sdk-macosx/extras/google/m2repository/com/example/library/1.0.0-SNAPSHOT/library-1.0.0-SNAPSHOT.pom file:/opt/android-sdk-macosx/extras/google/m2repository/com/example/library/1.0.0-SNAPSHOT/library-1.0.0-SNAPSHOT.aar Required by: project-name:test-app:unspecified
SNAPSHOT, which is trying to use qa , does not exist yet, and this should be good because I am not trying to create a qa flavor. If this SNAPSHOT assembly is present, then everything works fine.
Questions:
- Why are all assembly layouts with their own dependencies allowed?
- How can I create only one fragrance without encountering this problem?
- Is there a better way to do this to be more "Gradley"?
android maven gradle
Sky kelsey
source share