Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue occured while using the archetype #52

Open
Thevakumar-Luheerathan opened this issue Feb 5, 2025 · 0 comments
Open

Issue occured while using the archetype #52

Thevakumar-Luheerathan opened this issue Feb 5, 2025 · 0 comments

Comments

@Thevakumar-Luheerathan
Copy link

I'm trying to implement a Nexus3 format to support Ballerina (https://ballerina.io/, an integration-specific language) artifacts. I followed the guide in https://github.com/sonatype-nexus-community/nexus-development-guides/blob/master/docs/format-plugin.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. And, how can I debug the created plugin? Is there any flag?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant