How to add a maven manifest to an AAR which specifies dependencies

前端 未结 1 698
太阳男子
太阳男子 2021-01-13 05:53

I was (finally) able to publish my Android library to an AWS S3 maven repository using this guide. It\'s published as an AAR instead of JAR file, which means that even thoug

相关标签:
1条回答
  • 2021-01-13 06:28

    You should be able to resolve this by changing your POM XML generation so that the <packaging> section is setup as aar rather than pom:

    <?xml version="1.0" encoding="UTF-8"?>
    <project xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <modelVersion>4.0.0</modelVersion>
      <groupId>com.humanvideoboard</groupId>
      <artifactId>hvb_library</artifactId>
      <version>1.0</version>
      <packaging>aar</packaging>
    

    However, now that I'm re-examining this, the cause for why it works with transitive dependencies is by the use of implementation vs api when building the library or when building the thing which is using the library. If your library is exposing types from its dependencies as part of its public API, then those build dependencies need to be handled correctly in your library build. See this page for more information.

    0 讨论(0)
提交回复
热议问题