【问题标题】:WSO2ESB - Building a CAR file with MavenWSO2ESB - 使用 Maven 构建 CAR 文件
【发布时间】:2014-10-21 04:03:30
【问题描述】:

使用 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 多模块项目”,并选择了我的 Config、Resources 和 Composite 项目作为子项目。然后我启动了“mvn clean install”命令,但在 ESB Config Project 上仍然出现错误(target/capp 文件夹中没有 POM)。

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

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

谢谢

【问题讨论】:

    标签: maven wso2esb wso2developerstudio


    【解决方案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

    【讨论】:

      【解决方案2】:

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

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

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

      【讨论】:

        猜你喜欢
        • 2022-06-14
        • 2023-01-12
        • 1970-01-01
        • 1970-01-01
        • 2016-10-13
        • 2013-02-03
        • 1970-01-01
        • 1970-01-01
        • 2013-07-07
        相关资源
        最近更新 更多