aliyun / darabonba-java-generator

Darabonba Code Generator for Java
Other
21 stars 5 forks source link

maven 3.x 打包失败 #75

Closed kiwiflydream closed 2 years ago

kiwiflydream commented 3 years ago

感谢提供如此方便的工具,目前在使用过程中遇到了如下问题

生成代码后执行 mvn install 会报如下错误

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-gpg-plugin:1.6:sign (sign-artifacts) on project openapi-sdk: Unable to execute gpg command: Error while executing process. Cannot run program "gpg": error=2, No such file or directory -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

排查后发现生成的 pom.xml 里面生成 bulid 的结构如下:

    <build>
        <plugins>
            <plugin>
            ...
            <plugin>
        <plugins>
      <build>      

这种写法应该是 maven 2.x 时的写法,而 maven 3.x 的结构有变化,应该如下:

<build>
   <pluginManagement>
   <plugins>
      <plugin></plugin>
      ...
       <plugin></plugin>
    </plugins>
</pluginManagement>
</build>

多了一个 pluginManagement

因为 maven 3 已经很普遍在使用了,希望可以加个配置用于兼容 maven 3 结构,感谢👍

yndu13 commented 2 years ago

您好,应该是支持的。您后续还有这个问题的话,可以随时再开个issue~