...
- therefore you have to fork the responding odl subproject (we did it directly with github)
- go to your branch/tag of the version you found out before
- apply your fixes
- change for the specific artifact the groupId to yours
deploy your fix
- create oss.sonatype account
- edit your profile and create new access token
- configure your maven settings.xml
Image Added
- create gpg key and publish for your email address (the same with which your sonatype account is registered)
- build local artifacts (these should be there after a build)
- <artifactId>-<version>.jar
- <artifactId>-<version>-javadoc.jar
- <artifactId>-<version>-sources.jar
- sign your artifacts and pom files
Code Block |
---|
gpg -ab {your-project-path}/pom.xml
gpg -ab {your-project-path}/target/{artifactId}-{version}.jar
gpg -ab {your-project-path}/target/{artifactId}-{version}-sources.jar
gpg -ab {your-project-path}/target/{artifactId}-{version}-javadoc.jar |
Code Block |
---|
# deploy bundle with javadoc and sources
mvn gpg:sign-and-deploy-file \
-DpomFile={your-project-path}/pom.xml \
-Dfile={your-project-path}/target/{artifactId}-{version}.jar \
-Dsources={your-project-path}/target/{artifactId}-{version}-sources.jar \
-Djavadoc={your-project-path}/target/{artifactId}-{version}-javadoc.jar \
-Durl=https://oss.sonatype.org/service/local/staging/deploy/maven2 \
-DrepositoryId={your server id of maven settings file}
# deploy jar
mvn gpg:sign-and-deploy-file \
-Dfile={your-project-path}/target/{artifactId}-{version}.jar \
-Durl=https://oss.sonatype.org/service/local/staging/deploy/maven2 \
-DrepositoryId={your server id of maven settings file} \
-DgroupId={groupId} \
-DartifactId={artifactId} \
-Dversion={version} \
-DgeneratePom=false |
- go to oss.sonatype.org and login
- go to Staging Repositories
Image Added
- first check your artifacts on the very bottom and then close your submission (will take a while)
- last step: release artifacts
apply you fix to the distribution
...
Code Block |
---|
# Patch xxx
COPY --chown=odl:odl system/org/opendaylight/{the}/{odl}/{groupId}/{artifactId} $ODL_HOME/system/org/opendaylight/{the}/{odl}/{groupId}/{artifactId}/ |
The versioning problem
There will be maybe the case that you'll have to do a fix for the fix. The problem is that you cannot release an artifact in the offical maven repository twice. The solution is luckily quite simple. Just release it with a new version number and modify the injection of the artifact in the release building pom.xml.
Code Block |
---|
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.1.1</version>
<executions>
<execution>
<id>copy-with-alternalte-repo</id>
<phase>generate-sources</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>{your groupId}</groupId>
<artifactId>{artifactId}</artifactId>
<version>{your deployed newer version}</version>
<outputDirectory>${project.build.directory}/docker-stage/system/org/opendaylight/{the}/{odl}/{groupId}/{artifactId}/{destination version}</outputDirectory>
<destFileName>{artifactId}-${destination version}.jar</destFileName>
</artifactItem>
</artifactItems>
<localRepositoryDirectory>${project.build.directory}/docker-stage/system</localRepositoryDirectory>
</configuration>
</execution>
</executions>
</plugin> |