You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

求助:Nexus3自定义Ballerina格式插件开发与编译问题排查

Nexus3 Ballerina制品格式插件开发问题求助

我正在为Nexus3开发支持Ballerina(一款集成专用语言)的制品格式插件,按照官方格式插件开发指南操作,执行以下命令为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

生成模板后执行Maven构建,遇到第一个错误:

[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

我在pom.xml中添加版本信息解决了该问题:

<dependency>
  <groupId>org.sonatype.nexus</groupId>
  <artifactId>nexus-repository</artifactId>
  <scope>provided</scope>
  <version>3.28.1-01</version>
</dependency>

随后遇到第二个错误:

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

我将enforce-plugin版本从1.4.1改为3.4.1,并将仓库配置移至根目录pom.xml的profiles部分,解决了该问题,但又出现新的编译错误:

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

目前我卡在这个编译错误上,寻求以下帮助:

  • 如何正确创建Nexus3新格式插件;
  • 如何调试已创建的插件,是否有相关调试参数?

内容的提问来源于stack exchange,提问作者LUHEERATHAN THEVAKUMAR

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.14 15:27:39