Github android maven plugin

Github android maven plugin

Android Maven Plugin — Sample Projects

This project is deprecated. All sample projects for the Android Maven Plugin as of version 4.0.0-rc.1 are part of the actual plugin codebase and run as integration tests. They can be found in the src/it/projects folder at https://github.com/simpligility/android-maven-plugin.

The following content is mostly historical information and reference:

This project includes a whole number of example projects that use the Android Maven Plugin available at http://simpligility.github.io/android-maven-plugin/.

It serves as samples for users as well as a test cases for the ongoing development of the plugin.

Documentation can be found there as well as in README files in the folders of the different examples.

To run all projects you will need the support library and other libraries from the SDK deployed to your Maven repository. Use the Maven Android SDK Deployer to do that.

Versioning and Downloads

The ‘master’ branch of this project always uses the latest development version of the Android Maven Plugin and as such is always x.y.z-SNAPSHOT.

The ‘stable’ branch uses the latest relase of the plugin that has been pushed to the Central Repository.

There are also branches for specific versions of the Android Maven Plugin with the branch naming equal to the version of the plugin.

You can just download the project as usual from github with

Alternatively downloading of a zip file of a specific branch can be done via specific URL e.g.

List of Projects/Modules

There are a number of sub modules in this project. Here is the description for the top level ones. Details about each one is in the folder for the individual project.

the Android SDK API demo application suite for Android 16

a simple example application

a number of libraries in aar and apklib format being created and used in application examples

a simple example application with some external Java code from a library being used and an instrumentation test project

a number of example libraries and applications using the Android NDK

an example application written in Scala

example applications using the support library

an example application from the gradle samples project from the Android SDK team converted to a Maven based build

Источник

Github android maven plugin

Gradle Android Maven plugin

Modification to the standard Maven plugin to be compatible with android-library projects (aar).

To use the android-maven-plugin, just apply the plugin in your android-library project. Also add the plugin classpath dependency to the buildScript.

You can set the maven groupId and version in the script build.gradle:

The artifactId is set in settings.gradle:

  • For multi-projects build, please refer to issue #9: https://github.com/dcendents/android-maven-plugin/issues/9
  • For proper exclusion in the generated maven pom, use both group and module notation:

Note on Releases

The following table shows the compatibility between the android-maven-plugin and gradle versions. It also lists the plugin name to use:

Plugin Version Plugin Name Gradle Version
1.0 android-maven 1.8+
1.1 android-maven 1.12+
1.2 com.github.dcendents.android-maven 2.2+

Licensed under the Apache License, Version 2.0 (the «License»); you may not use this file except in compliance with the License. You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an «AS IS» BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

About

Maven plugin for gradle compatible with android library projects

Источник

Github android maven plugin

GitHub Maven Plugins

Collection of Maven plugins that integrate with GitHub. These plugins are built on top of API v3 through the GitHub Java library.

Released builds are available from Maven Central.

The plugins support several configuration options that can either be expressed in your project’s POM file or in your settings.xml file. Where you put the plugin settings depends on whether you want a specific setting to be configured globally or on a per-project basis.

All GitHub Maven plugins support the following core configuration elements.

The notation below shows the plugin configuration property name followed by the settings configuration property in parentheses.

  • host ( github.global.host )
    • Domain of GitHub API calls (defaults to api.github.com )
  • oauth2Token ( github.global.oauth2Token )
    • OAuth2 access token for API authentication
    • More about GitHub OAuth support
  • userName ( github.global.userName )
    • GitHub user name used for API authentication
  • password ( github.global.password )
    • GitHub password used for API authentication
  • server ( github.global.server )
    • Id of the server element from the settings.xml . To use standard authentication set the username and password elements in the servers section of your settings.xml file along with an id . Configure an OAuth2 token by leaving the username element blank/missing and just specify the token in the password element.
    • This option should be used instead of configuring any of userName , password or oauth2Token in the plugin configuration element or as a properties.
  • repositoryName
    • Name of repository
  • repositoryOwner
    • Owner of repository

Note: repositoryOwner property and repositoryName are optional and will be inferred from the following properties if not specified

  • project.scm.url
  • project.scm.connection
  • project.scm.developerConnection
  • project.url

Maven plugin that commits files generated and updates a specific branch reference in a GitHub repository. This plugin can be used to deploy a created Maven site to a gh-pages branch so that it can be served statically as a GitHub Project Page. The plugin has a site goal and is configured with a goal prefix of ghSite .

  • branch
    • Branch ref that will be updated to commit made
    • Default: refs/heads/gh-pages
  • message
    • Message used for commit
  • outputDirectory
    • Directory that includes and excludes will be relative to
    • Defaults to siteOutputDirectory or project.reporting.outputDirectory
  • includes
    • Sub-elements will be treated as patterns to include from the outputDirectory
  • excludes
    • Sub-elements will be treated as patterns to exclude from the outputDirectory
  • path
    • Path relative to the root of the repository that all blobs should be relative to
  • force ( github.site.force )
    • true | false (default: false )
    • Whether to force a ref update, default is fast-forwards only
  • merge ( github.site.merge )
    • true | false (default: false )
    • Whether to merge with the current tree or completely replace the tree that the commit points to
  • dryRun ( github.site.dryRun )
    • true | false (default: false )
    • Log what blobs, tree, and commits would be created without actually creating them
  • noJekyll ( github.site.noJekyll )
    • true | false (default: false )
    • Whether to always create a .nojekyll file at the root of the site if one doesn’t already exist. This setting should be enabled if your site contains any folders that begin with an underscore.

To commit a created site run the following command:

Источник

Github android maven plugin

Deprecated: This plugin is no longer needed since maven-publish is officially supported by AGP.

Use AGP 3.6.0 or newer.

Modification of the standard Maven Publish plugin to be compatible with android-library projects (aar).

Applying the plugin

The android-maven-publish plugin provides a SoftwareComponent similar to the java plugin ( components.java ). The android component is used to determine which aar files are published and which dependencies should be listed in the generated POM file.

If you want to publish custom variants:

Plugin Version Dependency Information Gradle Version
1.0.0 digital.wup:android-maven-publish:1.0.0 2.4 — 3.3
2.0.0 digital.wup:android-maven-publish:2.0.0 3.4 — 4.0
3.0.0 digital.wup:android-maven-publish:3.0.0 3.4 — 4.1
3.1.1 digital.wup:android-maven-publish:3.1.1 4.2 — 4.3.x
3.2.0 digital.wup:android-maven-publish:3.2.0 4.4
3.3.0 digital.wup:android-maven-publish:3.3.0 4.5
3.4.0 digital.wup:android-maven-publish:3.4.0 4.5 — 4.6
3.5.1 digital.wup:android-maven-publish:3.5.1 4.7
3.6.3 digital.wup:android-maven-publish:3.6.3 4.8

About

Modification of the standard Maven Publish plugin to be compatible with android-library projects (aar).

Источник

Github android maven plugin

Maven Android SDK Deployer

Original author including numerous fixes and changes:

Contributors (historical order..):

  • Hugo Josefson hugo@josefson.org — properties plugin usage
  • Jake Wharton jakewharton@gmail.com — 3.2, compatibility v13 and 4.0.3 support
  • https://github.com/holdensmagicalunicorn — spelling fix
  • Guto Maia guto@guto.net- initial USB add on support
  • Lorenzo Villani — initial 4.0 support
  • Paul Merlin http://eskatos.github.com — Google Analytics extra
  • Matteo Panella morpheus@level28.org — Google AdMobs extra, support for 4.1
  • Benoit Billington https://github.com/Shusshu Google Cloud Messaging Client and Server, annotations.jar, 4.2, 4.3, 4.4, APK Expansion, Licensing, 4.4W, L, 5.0, MultiDex, MNC
  • Michael Lake https://github.com/mlake support for Javadoc attachment for platforms
  • Nic Strong http://www.codepoets.co.nz Google Play Services (gms)
  • Matias Dumrauf http://github.com/mdumrauf — Compatibility v7 library support, Google Analytics support for V1 and V2
  • https://github.com/skyisle minor documentation fix
  • Viacheslav Rodionov https://github.com/bepcyc AdbMob update
  • David Venable https://github.com/dlvenable admob update
  • Jenny Loomis Williamson https://github.com/jloomis fix for deployment
  • James Wald https://github.com/jameswald configured groupId and artifactId for support libraries
  • Thomas Prochazka https://github.com/tprochazka javadoc attachment, fix for artifactIds
  • Shairon Toledo http://www.hashcode.eti.br doc update
  • Kohsuke Kawaguchi http://kohsuke.org/ webdav support for deployment
  • Lars Hoss http://cv.woeye.net/ v7 appcompat library support
  • Nemanja Nedic https://github.com/nemanjanedic appcompat javadoc fix
  • Yuvi Panda https://github.com/yuvipanda appcompat fix
  • Sebastian Roth https://github.com/ened added missing google-apis-18 add-on
  • Andreas Gawelczyk https://github.com/andreas- — Compatibility v7 mediarouter
  • Hoyt Summers Pittman https://github.com/secondsun — Google API 19, google play services to > Froyo, update android-maven-plugin
  • Aaron Alaniz https://github.com/aaalaniz — Google Glass Development Kit
  • Heath Borders https://github.com/hborders — documentation update
  • Hoyt Summers Pittman https://github.com/secondsun — javadoc fix for Java 8 support
  • Dieter Adriaenssens https://github.com/ruleant
  • Quentin Rousseau https://github.com/kwent
  • Mingfai Ma https://github.com/mingfai
  • Raphael Ackermann https://github.com/rtack sdk 21 fix for apklibs
  • Daniel Passos https://github.com/danielpassos — Google API 24
  • Edda Björk Konráðsdóttir, Android 7.1 API 25
  • Alexander Berezovsky https://github.com/alezandr — Android API 15 & 25 sources
  • Alix Warnke, Android 8.0 API 26
  • Zsolt Fatér, https://github.com/zsoltii — Android 8.1 API 27, Android 9.0 API 28, adding repositories/extras-m2repository, fixes for add-ons

The Maven Android SDK Deployer is a helper maven project that can be used to install the libraries necessary to build Android applications with Maven and the Android Maven Plugin directly from your local Android SDK installation.

The dependencies can also be used from other build tools such as Gradle, Ant/Ivy or SBT.

ATTENTION! Currently some android.jar artifacts are available in Maven central and unless you use maps or usb related dependencies, android 3.0+, the compatibility library jar files or insist on using the original jar files from the local SDK install, you might not need this tool anymore.

You will however need this tool to access the latest Android 4.2 release or to work around bugs like missing JSON libraries in some older artifacts deployed to Maven central. If you use this tool make sure your dependencies are as documented here.

The android.jar artifacts in Maven central are available with the groupId com.google.android , whereas this tool uses groupId android to avoid overlap.

Download the latest Android SDK from http://developer.android.com/sdk/index.html following the instructions there.

Apache Maven 3.1.1 or higher is required!

For the default usage of the deployer install all platforms and add-on apis, ensure that all folder in the platforms folder have names like android-3, android-4 and so on.

If you find names using the platform version (e.g. 15) in the folder name reinstall that platform from the android tool.

In a similar manner the folder names in add-ons have to use the pattern addon-google_apis-google-3 up to addon-google_apis-google-15.

If the folder names are different reinstall the add-ons as well

Set up the environment variable ANDROID_HOME to contain the absolute folder you just installed the SDK to (e.g. under bash: export ANDROID_HOME=/opt/android_sdk_linux) and ensure that the folder for ANDROID_HOME and all files within are readable by the current user

Run the command

in the root folder of this project (same as README you are just reading) to install all platforms and add-on apis

To install only a certain sdk level use

As a result you should find the android.jar and maps.jar and a number of other libraries in your users local repository (

/.m2/repository/) and you can therefore use the following dependencies in your project

For the core platforms providing the Android API use

with versions of

For the maps add ons use a dependency

with versions of 7_r1, 8_r2, 11_r1, 12_r1, 13_r1, 14_r2, 15_r2, 16_r3, 17_r3, 18_r3, 19_r10, 21_r1

For the usb add on

with versions of 10_r2, 12_r1, 13_r1, 14_r2, 15_r2, 16_r3, 17_r3, 18_r3, 19_r4, 21_r1

Android SDK Maven Repositories

The Maven repositories from the Android SDK for Google and Android are copied to the local repository or uploaded to a remote repository manager just like they are in the SDK and contain all components from these repositories. Currently they are in the package space com.android.support and com.google.android and present the preferred components for usage. Specifically the various compatibility and support libraries as Android Archives:

with versions 18.0.0, 19.0.0, 19.0.1, 19.1.0, 20.0.0, 21.0.0, 21.0.2, 21.0.3

with versions 21.0.0, 21.0.2, 21.0.3

with versions 13.0.0, 18.0.0, 19.0.0, 19.0.1, 19.1.0, 20.0.0, 21.0.0, 21.0.2, 21.0.3

with versions 21.0.0, 21.0.2, 21.0.3

with versions 18.0.0, 19.0.0, 19.0.1, 19.1.0, 20.0.0, 21.0.0, 21.0.2, 21.0.3

with versions 21.0.0, 21.0.2, 21.0.3

with versions 21.0.0, 21.0.2, 21.0.3

with versions 13.0.0, 18.0.0, 19.0.0, 19.0.1, 19.1.0, 20.0.0, 21.0.0, 21.0.2, 21.0.3

with versions 13.0.0, 18.0.0, 19.0.0, 19.0.1, 19.1.0, 20.0.0, 21.0.0, 21.0.2, 21.0.3

Besides the artifacts provided for the compatibility libraries from the Android SDK Maven Repositories the following are also provided. For the compatibility extra (ATTENTION! Do NOT use provided scope!!)

If you find that the above fails due to conflicts, your project and it’s dependencies may both depend on the compatibility extra. The first option is to add an clause to each dependency that uses the library, as described here. This works with command line builds but it may not work with your IDE.

Then override support-v4 or support-v13 during installation:

In order to use v7 extra, both dependencies (apklib & jar) are needed

For the v7 appcompat library additional dependencies (apklib & jar) are required (Deprecated)

The v7 appcompat library an Android Archive dependency (aar) as provided by the Android SDK Google repository

with versions 18.

For the v7 gridlayout library additional dependencies (apklib & jar) are required (Deprecated)

For the v7 gridlayout library an additional dependency (aar) is required

For the v7 mediarouter library additional dependencies (apklib & jar) are required (Deprecated)

For the uiautomator jar

with versions 4.1.2_r4, 4.2.2_r2, 4.3_r2, 4.4.2_r3

For the Google Play Services extra (ATTENTION! Do NOT use provided scope!!) (Deprecated)

For the Google Play Services extra (ATTENTION! Do NOT use provided scope!!)

For the Google Play APK Expansion extra (ATTENTION! Do NOT use provided scope!!)

For the Google Play Licensing extra (ATTENTION! Do NOT use provided scope!!)

To install only a specific module use

in any parent folder of the desired package and then the usual 1 mvn clean install

For example to install only the compatibility v4 extra you can do the following

Similar for only API level 12 add on use

The same could be done with deploy

How To Use for Deploying Onto Remote Server

The above deployment works fine for one machine, but what if you need to supply a whole team of developers and a cluster of build machines with the artifacts? Then it is best to deploy to a repository manager like Sonatype Nexus.

As a condition you need to have a repository server used by all those machines and the following process will deploy to this server, which will in turn provide the artifacts to all the machines.

Edit the repo.url property in the pom.xml to point to the repository you want to publish to. The recommended practice is to have a separate repository for the Android components and expose it via a repository group. The repository needs to be in Maven 2 format and use a release policy (not snapshots). For repeated runs of the deployer, you need to ensure to allow redeployment into the specific repository. By default this is not the case for release repositories!

Then add a server with the credentials to your settings.xml.

Run the command

in the root folder of this project (same as README you are just reading), you can also use the same profile options for the different api level. As a result you should find the artifact in the repository of your remote server

For more information about this stuff look at the documentation for the maven-deploy-plugin.

It is possible to create javadoc artifacts for the platforms where available in the sdk. To call it use

and the respective javadoc jars will be created and also installed. This also works for deployment to a repository server

Please direct any questions to the community at the Maven Android Developers mailing list at http://groups.google.com/group/maven-android-developers

  • Platforms and Add on folder names changes in SDK

When updating an existing android sdk install the add-ons subfolder can sometimes be reused and their contents be updates so you could end up with e.g. the google maps-4r2 in a folder named google_apis-4_r01. To work around this just uninstall the affected add-on and reinstall it with the android sdk tool.

Similarly the platform specific folder used to be e.g. android-1.5 and is now android-3 using the api level as the numeric identifier. If your SDK install uses the old folder names for any platform simply reinstall that platform with the android tool.

In a similar manner the folder for the support libraries in the the sdk used to be compatibility and is now support

The Add ons used different folder names as well. The Maven Android SDK Deployer’ is adapted to the lastet naming scheme. To do that yourself remove all «Google APIs by Google Inc» in the android SDK manager and install them again.

Similar problem occurs with the extras version identifier. If the folders naming is 100% allright and you receive the messages about not finding some artifacts — remove extras and reinstall them back. That’s because Google changed the version identifier naming policy. For example for support extras it was 19, now it’s 19.0.1

If you find any problems or would like to suggest a feature, please feel free to file an issue on github at http://github.com/mosabua/maven-android-sdk-deployer/issues

Potential todo items

add custom pom files for install/deploy that eg. define dependency from maps to android jar

maybe some sort of reporting of errors, failures and success as well

About

A tool to install components of the Android SDK into a Maven repository or repository manager to use with the Android Maven Plugin, Gradle and other tools.

Источник

Читайте также:  Android activity flag clear top
Оцените статью