How to overwrite artifactId for Android Gradle library project?

喜夏-厌秋 提交于 2019-12-06 06:48:31

问题


I created an Android library project using Android Studio with the following directory structure:

├── build.gradle
├── gradle
├── gradle.properties
├── gradlew
├── gradlew.bat
├── local.properties
├── settings.gradle
├── FooBar.iml
└── FooBar Library

When I want to publish the library to my local Maven repository I encounter the following error:

Execution failed for task ':Foobar Library:publishMavenPublicationToMavenLocal'.
> Failed to publish publication 'maven' to repository 'MavenLocal'
   > Invalid publication 'maven': 
     artifactId is not a valid Maven identifier ([A-Za-z0-9_\-.]+).

Please notice that the folder "FooBar Library" contains a space. How can I set the artifactId for Gradle so I can overwrite the default artifactId?


Side note: If you are using uploadArchives in favor of maven-publish you can rename the artifactId setting archivesBaseName as follows:

archivesBaseName = "foobar-library"

来源:https://stackoverflow.com/questions/21800033/how-to-overwrite-artifactid-for-android-gradle-library-project

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!