首页 文章

WSO2ESB - 使用Maven构建CAR文件

提问于
浏览
1

使用WSO2 Developer Studio(版本3.7.0),我在“ESB Config Project”中创建了一个带有序列的WSO2 ESB代理服务,该代理服务使用位于“Registry Resources Project”中的wsdl文件 . 我还创建了一个“复合应用程序项目”来生成我的.car文件(包括代理服务,序列和资源),并在我的WSO2 ESB安装中成功部署了该文件 .

现在我尝试使用maven命令生成(然后部署).car文件 .

我首先尝试了这个解决方案:https://docs.wso2.com/display/DVS370/Deploying+a+CAR+File+with+the+Maven+Plug-In . 在我的ESB配置项目上执行命令"mvn clean install"时,出现此错误:

[ERROR] The goal you specified requires a project to execute but there is no POM in this directory ([ESB Config Project Path]\target\capp). 
Please verify you invoked Maven from the correct directory. -> [Help 1]

实际上,安装目标配置为在“target / capp”目录中执行:

<directory>target/capp</directory>
<plugins>
  <plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>exec-maven-plugin</artifactId>
    <version>1.2</version>
    <extensions>true</extensions>
    <executions>
      <execution>
        <id>install</id>
        <phase>install</phase>
        <goals>
          <goal>exec</goal>
        </goals>
        <configuration>
          <executable>mvn</executable>
          <workingDirectory>${project.build.directory}</workingDirectory>
          <arguments>
            <argument>clean</argument>
            <argument>install</argument>
            <argument>-Dmaven.test.skip=${maven.test.skip}</argument>
          </arguments>
        </configuration>
      </execution>
...

然后我尝试创建"Maven Multi Module Project",如下所示:maven build for WSo2 artifacts,但我没有找到任何解决方案使它工作:

按照本文档中的步骤(https://docs.wso2.com/display/DVS310/Using+Maven+with+Developer+Studio?src=search),我创建了一个"Maven Multi Module Project",并选择了我的Config,Resources和Composite项目作为子项 . 然后我启动了"mvn clean install"命令,但仍然在ESB Config Project上得到错误(目标/ capp文件夹中没有POM) .

实际上,我只是没有找到关于这些错误的任何信息,也不明白为什么WSO2文档解决方案对我不起作用 .

有没有人对此提出建议? WSO2 Developer Studio如何生成.car文件?

谢谢

2 回答

  • 1

    我找到了这个问题的另一个答案 . exec-maven-plugin版本似乎有些错误 . WSO2 Developer Studio 3.7.0在创建项目时添加了错误版本(1.2) . 您只需要更改工件:

    <groupId>org.codehaus.mojo</groupId>
    <artifactId>exec-maven-plugin</artifactId>
    <version>1.2</version>
    

    至:

    <groupId>org.codehaus.mojo</groupId>
    <artifactId>exec-maven-plugin</artifactId>
    <version>1.4.0</version>
    

    将此视为补充信息:exec-maven-plugin says cannot run specified program, even though it is on the PATH

  • 0

    我终于成功生成了一个.car文件并创建了一个maven多模块项目 .

    我试图用WSO2 Developer Studio 3.7.0创建我所有的maven项目,尽管样本说使用版本3.2.0 . 随着WSO2的maven插件版本发生变化,它现在可以正常工作,使用插件v2.0.4执行maven安装 .

    而maven多模块项目最终只是一个带模块的maven项目,所以没关系 .

相关问题