-
Notifications
You must be signed in to change notification settings - Fork 4.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Publishing artifacts does not put non-jar <type> in the dependencies block #3170
Comments
Could we get an update on this bug? It has been over 8 months without any response. |
We are using
Observe that pom file dependencies say:
and it is missing |
Are you able to reproduce this issue? |
Note this issue is also true for dependencies on projects within the same settings.gradle. For example, if I have a project A and project B, both of them are aars and A depends on B, pom file will not have build type in the pom file. We have to add some pretty hacky code to work around that: |
@gradle/dependency-management Is the |
Any updates on this? |
@marcphilipp Yes it is available, and so is the This means that issue probably is about plugin interactions. @liutikas I can't give you any timeline for getting this fixed. |
@ljacomet could you point me on where the type is available of a Maven dependency? I looked at org.gradle.api.artifacts.ModuleDependency which has getArtifacts(), but sadly the set is empty unless the dependency explicitly adds the type |
To work around the bug gradle/gradle#3170 add explicit mention of dependency type @aar for android library dependencies. This will mean that now pom files will now have correct <type>aar</type> Comparison of old vs new: https://paste.googleplex.com/6020163941957632 Test: ./gradlew createArchive and verify pom file dependencies now have type tag Change-Id: Ia30454a4fba985865ea9b64622e3ba4c3ff67a3d
Could we get an update on this? It would be great to have this resolved. Alternatively, it would be nice to get a response to:
|
Any updates on this? I'm having the same issue |
Unfortunately the issue persists. But there are some updates with Gradle 6 (RC1 available now):
For now, I would recommend the following workaround for maven-publish:
Where |
Any updates here? It would be great to be able to resolve this issue without having to work around it. It is especially problematic now due to configuration caching, as that means you can no longer access |
There is an open Gradle bug that dependencies with AARs are not marked as such in the created POM files (gradle/gradle#3170). This causes issues building ExoPlayer with Maven POMs only. (Issue: #8353). This change adds the workaround suggested on the Gradle bug until the bug is fixed. As we have a mixture of JAR and AAR dependencies, we need to maintain a lookup table to know which dependencies have AARs. The current code throws when a new dependency is added and it's not classified. #minor-release PiperOrigin-RevId: 417797407
There is an open Gradle bug that dependencies with AARs are not marked as such in the created POM files (gradle/gradle#3170). This causes issues building ExoPlayer with Maven POMs only. (Issue: google/ExoPlayer#8353). This change adds the workaround suggested on the Gradle bug until the bug is fixed. As we have a mixture of JAR and AAR dependencies, we need to maintain a lookup table to know which dependencies have AARs. The current code throws when a new dependency is added and it's not classified. #minor-release PiperOrigin-RevId: 417797407
Any plan on fixing this after 5 years? it still causes problems with maven projects |
Friendly bump, we're still suffering from this over at Firebase :') |
We are looking into this. In general, you should not need to resort to re-writing XML in order to publish proper component metadata (as is necessary to resolve this issue) |
Use the new test fixture to verify that maven is able to resolve our published POMs and that the classpath resolved by Maven is the same as the classpath resovled by Gradle. We still need to work #3170 to fully support publishing to Maven
Use the new test fixture to verify that maven is able to resolve our published POMs and that the classpath resolved by Maven is the same as the classpath resovled by Gradle. We still need to work #3170 to fully support publishing to Maven
When publishing an artifact that has dependencies that are not
jar
(aar
in our case), the dependency block in thepom
file does not contain anytype
information.The pom should looks like this:
<type>aar</type>
is missing from the dependency section.Note that Gradle handles this properly, but Maven does not. The fact that the dependency's own
pom
has<packaging>aar</packaging>
does not seem to help, as I would have expected.The text was updated successfully, but these errors were encountered: