2

使用 WSO2 Developer Studio(版本 3.7.0),我在“ESB 配置项目”中创建了一个带有序列的 WSO2 ESB 代理服务,该代理服务使用位于“注册表资源项目”中的 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 多模块项目”,如下所示:maven build for WSo2 artifacts,但我没有找到任何解决方案使其工作:

按照本文档中的步骤(https://docs.wso2.com/display/DVS310/Using+Maven+with+Developer+Studio?src=search),我创建了一个“Maven 多模块项目”,并选择了我的配置, 资源和复合项目作为孩子。然后我启动了“mvn clean install”命令,但仍然在 ESB Config Project 上收到错误(target/capp 文件夹中没有 POM)。

实际上,我只是没有找到有关这些错误的任何信息,并且不明白为什么 WSO2 记录的解决方案对我不起作用。

有人对此有什么建议吗?WSO2 Developer Studio 如何生成 .car 文件?

谢谢

4

2 回答 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 表示无法运行指定的程序,即使它在 PATH 上

于 2015-07-06T18:12:44.950 回答
0

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

我试图用 WSO2 Developer Studio 3.7.0 创建我所有的 maven 项目,尽管该示例说使用版本 3.2.0。随着 WSO2 的 maven 插件版本的变化,它现在对我来说很好,使用插件 v2.0.4 执行 maven 安装。

而一个maven多模块项目最后也只是一个带模块的maven项目,这样就OK了。

于 2014-08-29T11:50:22.410 回答