【问题标题】:How to change default properties in Maven Release Plugin for WSDL builds如何在 Maven 发布插件中更改 WSDL 构建的默认属性
【发布时间】:2015-05-14 03:28:34
【问题描述】:

我需要修改 mvn release:prepare 和 mvn release:perform 的默认属性。我正在尝试构建的源代码有一个 WSDL 文件。

生成的 JAR 文件是非 maven 格式,这是通过两步构建过程实现的,使用它我可以生成基于 maven 的 WSDL 编译的 JAR 文件。

mvn exec:exec
mvn install:install-file -DgroupId=com.stackoverflow.abc -DartifactId=xyz -Dversion=${BUILD_VERSION} -Dpackaging=jar -Dfile=path-of-jar -DpomFile=path-of-pom.xml

这仅使用 MAINFEST.MF 构建 JAR 文件,没有 pom.properties 和 pom.xml,我要做的是将非 maven 格式生成的 JAR 转换为 maven 格式。

当我尝试使用 release:prepare 和 release:perform 时,我无法覆盖 mvn install:install-file 中使用的默认属性,并且无法使用 pom 属性生成 JAR

有没有一种方法可以覆盖 mvn release 插件属性来帮助我构建 JAR 文件?

用于构建 WSDL 的插件:

<plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>exec-maven-plugin</artifactId>
            <extensions>false</extensions>
            <version>1.2.1</version>

            <configuration>
            <executable>java</executable>
                <arguments>
                    <argument>-classpath</argument>
                    <classpath />
                    <argument>com.sforce.ws.tools.wsdlc</argument>
                    <argument>src/main/resources//Enterprise.wsdl</argument>
                    <argument>target/wsdl-${version}.jar</argument>
                </arguments>
            </configuration>
</plugin>

我尝试使用的是:

mvn -s settings.xml -Dusername=${svn_user} -Dpassword=${svn_password} release:prepare exec:exec release:perform  -DgroupId=com.stackoverflow.abc -DartifactId=xyz -Dversion=${BUILD_VERSION} -Dpackaging=jar -Dfile=${WORKSPACE}/target/wsdl-${BUILD_VERSION}.jar -DpomFile=${WORKSPACE}/pom.xml

【问题讨论】:

    标签: eclipse maven wsdl maven-release-plugin


    【解决方案1】:

    需要以下插件来构建 WSDL 文件,发布通常的 mvn clean install 应该可以完成这项工作

        <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <extensions>false</extensions>
                <version>1.2.1</version>
                <executions>
                    <execution>
                      <id>custom-compile</id>
                      <phase>compile</phase>
                      <goals>
                        <goal>exec</goal>
                      </goals>
                    </execution>
                </executions>
                <configuration>
                <executable>java</executable>
                    <arguments>
                        <argument>-classpath</argument>
                        <classpath />
                        <argument>com.sforce.ws.tools.wsdlc</argument>
                        <argument>src/main/resources/com/salesforce/wsdl/abc.wsdl</argument>
                        <!-- <argument>target/salesforce-wsdl-${project.version}.jar</argument> -->
                        <argument>target/salesforce-wsdl.jar</argument>
                    </arguments>
                </configuration>
            </plugin>
    

    【讨论】:

      猜你喜欢
      • 2013-11-12
      • 1970-01-01
      • 1970-01-01
      • 2011-10-02
      • 1970-01-01
      • 1970-01-01
      • 2012-04-06
      • 2023-04-06
      • 1970-01-01
      相关资源
      最近更新 更多