3
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Gradle で Maven にデプロイしようとしたら怒られた時の対処法

Posted at

この記事の末尾でも説明したように、gradle-mvn-pushプラグインのuploadArchivesでは、内部的にandroidJavadocsタスクも実行されており、このタスクは、dependenciesによる依存関係を知らないため、Java の標準 API 以外はほとんど解釈できません。そのため、Javadoc の生成時に解決できないシンボルが出現してしまうため、タスクが失敗します。

そこで、以下の解決策があると説明しました。


afterEvaluate {
    androidJavadocs.classpath += files(android.plugin.runtimeJarList)
}

この場合、Android フレームワークの API を解決させるには十分です。
しかし、依然としてdependenciesに記述した依存までは解決してくれません。

そこでどうするかというと、以下のようにします。


afterEvaluate {
    androidJavadocs.classpath += files(android.plugin.runtimeJarList)
    androidJavadocs.classpath += project.android.libraryVariants.toList().first().javaCompile.classpath
}

androidJavadocsタスクのクラスパスに、自分のライブラリが持っているクラスパスを渡します。
これで無事シンボルが解決出来るようになります。

3
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?