The diagram is as follows:
A (gradle spring-boot api rest) -> A consume to library B
B is published in the local Nexus repository
B is a library (is published in nexus local repository)
- B use gradle spring-boot
- B does not have a main() function
- They are just classes and functions
- The classes are @Services (the annotation)
- can have a configuration class (@Configuration) with a @postConstruct
to publishB:
https://gitlab.com/com.leibnix/championshipfunctions
to consume the artifact (from A api-rest):
https://gitlab.com/com.leibnix/championshipapi
in build.gradle for publish B:
publishing {
publications {
mavenJava(MavenPublication) {
artifactId = 'xxxxx'
from components.java
}
}
repositories {
maven {
name = "NexusLocal"
url = "http://localhost:8081/repository/maven-releases/"
allowInsecureProtocol = true
credentials {
username = "nexususer"
password = "xxxx"
}
}
}
}
A (that consume to B):
repositories {
mavenCentral()
maven {
url "http://localhost:8081/repository/maven-releases/"
allowInsecureProtocol = true // Required because you're using HTTP instead of HTTPS
credentials {
username = 'nexususername'
password = 'xxxx'
}
} // end maven
} // end repositories
dependencies {
implementation 'com.leibnix:championshipfunctions:0.0.4'
}