如何在WSDL版本的Maven Release Plugin中更改默认属性

时间:2015-05-14 03:28:35

标签: eclipse maven wsdl maven-release-plugin

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

生成的JAR文件采用非maven格式,这是通过2步构建过程实现的,使用此方法我可以生成基于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发布插件属性,这有助于我构建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

1 个答案:

答案 0 :(得分:0)

下面的插件需要构建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>
相关问题