chrisbanes/gradle-mvn-push

Publish to my local maven repo.

yogurtearl opened this issue · 6 comments

Is there a way to publish to my local maven repo?

yes. set the RELEASE_REPOSITORY_URL and/or SNAPSHOT_REPOSITORY_URL to the corresponding local maven url, e.g.

RELEASE_REPOSITORY_URL=http://localhost:8080/repository/internal/
SNAPSHOT_REPOSITORY_URL=http://localhost:8080/repository/snapshots/

I am not running a repo server.
I was wondering about publishing to this: ~/.m2/repository/

You could use the android-maven-plugin:

// root build.gradle
buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:0.12.2'
        classpath 'com.github.dcendents:android-maven-plugin:1.0'
    }
}
// library build.gradle
apply plugin: 'android-maven'
version = "1.0.0"
group = "com.example"
archivesBaseName = "awesome-library"

As part of this, you get access to the gradle maven plugin, and one of it's tasks https://docs.gradle.org/current/userguide/maven_plugin.html#N139B5 is install so

$ ./gradlew install

should do it

Not sure why yet, but install seems to not pull in all transitive dependencies. The generated pom file is incomplete

@yogurtearl @alopix @johnjohndoe @caseykulm You can publish to your local maven repo with https://github.com/Vorlonsoft/GradleMavenPush. Please read README.md before use it.

6. Build and Deploy/Install

You can now build and deploy on JCenter, Maven Central or Corporate staging/snapshot servers:

$ gradle deployOnServerRepository

Build and install on local Maven (~/.m2/repository/):

$ gradle installOnLocalRepository

Build and deploy on local Maven (~/.m2/repository/):

$ gradle deployOnLocalRepository