Reputation: 3641
I have a module with some POJO classes that is marked at gradle as apply plugin: 'java' .Is there a way to reuse it at another project ? Everything i tried failed . (I dont want to copy pasta it)
Upvotes: 0
Views: 2679
Reputation: 234
I was facing the same issue recently.
This is how I resolved the code redundancy problem:
`
apply plugin: 'maven'
group = 'com.<example>'
version = '1.0'
uploadArchives {
repositories {
mavenDeployer {
repository(url: "file:///Users/<myuser>/.m2/repository")
}
}
}
`
Hope this helps.
Upvotes: 1
Reputation: 13
Here are two other questions on the same matter.
How do I add a library project to Android Studio?
Personally I didn't use any of the two provided methods. I built my project as a JAR, added it to the 'libs' folder, right clicked on it and clicked 'Add as library' and then finally added the dependency in the gradle file like so:
dependencies {
compile files('libs/MyJAR.jar')
}
Upvotes: 0