Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/wcf/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 如何使用maven打包开关站应用程序_Java_Maven_Switchyard - Fatal编程技术网

Java 如何使用maven打包开关站应用程序

Java 如何使用maven打包开关站应用程序,java,maven,switchyard,Java,Maven,Switchyard,如何将开关站应用程序打包为与Maven的另一个项目有依赖关系的应用程序?目前,我正在努力使事情按照这里的解释进行 但并没有结果,在日志文件中启动应用程序时,我看到 Caused by: java.lang.NoClassDefFoundError: com/aspiderngi/common/switchyard/InventoryRequest Caused by: java.lang.ClassNotFoundException: com.aspiderngi.common.switchy

如何将开关站应用程序打包为与Maven的另一个项目有依赖关系的应用程序?目前,我正在努力使事情按照这里的解释进行

但并没有结果,在日志文件中启动应用程序时,我看到

Caused by: java.lang.NoClassDefFoundError: com/aspiderngi/common/switchyard/InventoryRequest
Caused by: java.lang.ClassNotFoundException: com.aspiderngi.common.switchyard.InventoryRequest from...
无论如何都有可能实现吗

pom.xml:


4.0.0
开关站
0.0.1-快照
开关站:sy示例
sy示例
2.0.0.1决赛
1.7
1.7
战争
org.开关站
开关站物料清单
${switchyard.version}
聚甲醛
进口
com.aspiderngi
常见的人工制品
0.0.1-快照
org.switchyard.components
开关站组件
org.switchyard.components
开关站组件
org.switchyard.components
开关站组件
org.开关站
开关站api
org.开关站
开关站变换
org.开关站
开关站验证
org.开关站
开关站试验
测试
org.switchyard.components
开关站组件测试混合cdi
测试
org.switchyard.components
开关站组件bean
org.开关站
开关站插件
${switchyard.version}
配置
org.switchyard.transform.config.model.TransformSwitchYardScanner
maven战争插件
假的
WEB-INF/lib/*.jar,
WEB-INF/classes/META-INF/switchyard.xml
目标/类/META-INF
WEB-INF
switchyard.xml

您可以使用Maven Shade插件:

例如:

<project>
  ...
  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-shade-plugin</artifactId>
        <version>2.4.1</version>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
            <configuration>
              <shadedArtifactAttached>true</shadedArtifactAttached>
              <shadedClassifierName>jackofall</shadedClassifierName> <!--     Any name that makes sense -->
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  ...
</project>

...
org.apache.maven.plugins
maven阴影插件
2.4.1
包裹
阴凉处
真的
杰克福尔
...

请尝试一下。依赖项目必须有自己的pom.xml(子项) 将此子pom包括到父pom中。并在父pom.xml中包含以下代码 这将直接在服务器中部署应用程序 从cmd中的项目根目录执行以下命令: 1.mvn清洁 2.mvn依赖项:解析 3.mvn安装

如果您使用的是Eclipse,请使用maven update。然后作为maven安装运行

<build>
        <plugins>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.1</version>
                <configuration>
                    <source>1.7</source>
                    <target>1.7</target>
                    <debug>true</debug>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.jboss.as.plugins</groupId>
                <artifactId>jboss-as-maven-plugin</artifactId>
                <configuration>
                    <skip>false</skip>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.switchyard</groupId>
                <artifactId>switchyard-plugin</artifactId>
                <version>${switchyard.version}</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>configure</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <scannerClassNames>
                        <param>org.switchyard.transform.config.model.TransformSwitchYardScanner</param>
                    </scannerClassNames>

                </configuration>
            </plugin>
            <plugin>
                <groupId>org.jboss.as.plugins</groupId>
                <artifactId>jboss-as-maven-plugin</artifactId>
                <executions>
                    <execution>

                        <phase>install</phase>
                        <goals>
                            <goal>deploy</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

maven编译器插件
3.1
1.7
1.7
真的
org.jboss.as.plugins
jboss作为maven插件
假的
org.开关站
开关站插件
${switchyard.version}
配置
org.switchyard.transform.config.model.TransformSwitchYardScanner
org.jboss.as.plugins
jboss作为maven插件
安装
部署
如果您使用的是Bean,那么包括

<scannerClassNames>
          <param>org.switchyard.transform.config.model.BeanSwitchYardScanner</param>
    </scannerClassNames>

org.switchyard.transform.config.model.BeanSwitchYardScanner

请向我们展示您的
pom.xml
我已经用pom更新了问题,您能更准确一点吗?我是否需要使用其他插件,如war插件或开关站插件?当我运行mvn包时,我会得到无法部署或解压缩的war文件。