In fact we found some issues for SDNC which are only fixable in the opendaylight artifacts, we have to provide some fixes for the ONAP SDNC distribution. The problem is that the in opendaylight used eclipse license is not okay for the ONAP project so that we have to publish and deploy the code somewhere else. 

Hint: The goal always should be to bring the fix into the opendaylight project!

The artifacts we provide will be deployed to official maven central with our sonatype account. 

Example

public void initWithDefaultUsers(String domainID) throws IDMStoreException {
    String newDomainID = initDomainAndRolesWithoutUsers(domainID);
    if (newDomainID != null) {
        createUser(newDomainID, getPropertyOrDefault("${ODL_ADMIN_USERNAME}", "admin"),
                getPropertyOrDefault("${ODL_ADMIN_PASSWORD}", "admin"), true);
    }
}


Steps

find correct artifact version


the code

deploy your fix


apply you fix to the distribution

    <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 version}</version>
                            <outputDirectory>${project.build.directory}/docker-stage/system/org/opendaylight/{the}/{odl}/{groupId}/{artifactId}/{version}</outputDirectory>
                        </artifactItem>
                    </artifactItems>
                    <localRepositoryDirectory>${project.build.directory}/docker-stage/system</localRepositoryDirectory>
                </configuration>
            </execution>
        </executions>
    </plugin>
# 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.

    <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>