How to add a Maven project as a Gradle dependency? -


how add maven project gradle dependency? have gradle project working on , multi-module maven project import gradle project code dependency. how it?

you can't add maven multi-module project structure dependency directly. can, however, build multi-module project using mvn install install project jars local repository.

then, in build.gradle, need following configuration:

repositories {   mavenlocal() } 

this add local maven repository list of code repositories gradle through artifacts. can declare dependency on module(s) gradle project requires.

dependencies {     compile 'my-group:my-artifact:version',             'my-group:my-other-artifact:version' } 

when multi-module project updates new release version, run mvn install release , update build.gradle needed.

unless developer on both projects, better use private repository nexus or artifactory host maven project , configure gradle pull dependencies there well.

references:

maven local repository in gradle: https://docs.gradle.org/2.4/userguide/dependency_management.html#sub:maven_local

maven dependencies in gradle: https://docs.gradle.org/2.4/userguide/dependency_management.html#sub:module_dependencies


Comments

Popular posts from this blog

java - Run spring boot application error: Cannot instantiate interface org.springframework.context.ApplicationListener -

reactjs - React router and this.props.children - how to pass state to this.props.children -

Excel VBA "Microsoft Windows Common Controls 6.0 (SP6)" Location Changes -