I'm trying to implement a Nexus3 format to support Ballerina (/, an integration-specific language) artifacts. I followed the guide in .md. As per the guide, I executed the following command to create a template for Nexus 3.71.0-06:
mvn archetype:generate -DarchetypeArtifactId=nexus-format-archetype -DarchetypeGroupId=org.sonatype.nexus.archetypes -DarchetypeVersion=1.0.65 -DpluginFormat=ballerina -DpluginClass=Ballerina -DnexusPluginsVersion=3.71.0-06
Once the template was generated, I tried to build with Maven. And, I encountered the following error:
[ERROR] 'dependencies.dependency.version' for org.sonatype.nexus:nexus-repository:jar is missing. @ org.sonatype.nexus.plugins:nexus-repository-ballerina:[unknown-version], {path}/nexus-repository-ballerina/nexus-repository-ballerina/pom.xml, line 36, column 17
Then, I added the version to the pom.xml file to resolve the issue:
<dependency>
<groupId>org.sonatype.nexus</groupId>
<artifactId>nexus-repository</artifactId>
<scope>provided</scope>
<version>3.28.1-01</version>
</dependency>
Then, I encountered the following issue:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:1.4.1:enforce (buildsupport-bestpractices) on project nexus-repository-ballerina-parent: Unable to parse configuration of mojo org.apache.maven.plugins:maven-enforcer-plugin:1.4.1:enforce for parameter requireProfileIdsExist: Cannot create instance of interface org.apache.maven.enforcer.rule.api.EnforcerRule: org.apache.maven.enforcer.rule.api.EnforcerRule.<init>() -> [Help 1]
I resolved this issue by changing the enforce-plugin version from 1.4.1 to 3.4.1 and moving the repositories to the profiles section in the pom.xml file in the root directory. Then, I got a different issue:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project nexus-repository-ballerina: Compilation failure: Compilation failure:
[ERROR] /Users/luheerathan/luhee/Ballerina-Out-Of-Project/temp/nexus-repository-ballerina/nexus-repository-ballerina/src/main/java/org/sonatype/nexus/plugins/ballerina/internal/proxy/BallerinaProxyFacetImpl.java:[189,28]
[ERROR] 1. ERROR in /Users/luheerathan/luhee/Ballerina-Out-Of-Project/temp/nexus-repository-ballerina/nexus-repository-ballerina/src/main/java/org/sonatype/nexus/plugins/ballerina/internal/proxy/BallerinaProxyFacetImpl.java (at line 189)
[ERROR] return ballerinaDataAccess.saveAsset(tx, asset, tempBlob, content);
[ERROR] ^^^^^^^^^
[ERROR] The method saveAsset(StorageTx, Asset, Supplier<InputStream>, Payload) in the type BallerinaDataAccess is not applicable for the arguments (StorageTx, Asset, TempBlob, Content)
I don't know how to resolve this. I need some help on,
- Creating a new format.
- Debugging the created plugin? Is there any flag?