maven - 使用 maven pom.xml 生成包含 WAR 文件的 Ear 文件
问题描述
我有一个应用程序的 EAR,我需要使用我自己的代码来扩展这个应用程序,该代码被打包为一个 WAR。是否有 maven 插件可以帮助我将 WAR 放入 EAR 中?
需要自动生成包含war文件的ear文件的解决方案
4.0.0 com.spring.example 示例 1 耳朵示例
<!-- Add Spring Web and MVC dependencies -->
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>4.3.9.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>4.3.9.RELEASE</version>
</dependency>
<!-- Servlet -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<version>2.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>com.spring.example</groupId>
<artifactId>example</artifactId>
<version>1</version>
<type>war</type>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.6.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-ear-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<finalName>spring-mvc-example</finalName>
<modules>
<webModule>
<groupId>com.spring.example</groupId>
<artifactId>example</artifactId>
<uri>example.war</uri>
<bundleFileName>sexample.war</bundleFileName>
</webModule>
</modules>
</configuration>
maven-war-plugin 3.0.0 WebContent ${project.artifactId} 并在依赖生成war文件的行出现错误。所以我在哪里失踪请帮助我。
解决方案
推荐阅读
- angular - 角垫选择
- php - Wordpress XAMPP Apache 无法启动
- r - 在控制图 RStudio 中修改轴
- git - 如何在不删除本地更改的情况下删除所有未推送的提交
- awk - 删除文本文件中 url 字符串的空间
- flutter - 使用 bloc_test 库和去抖动时间测试 LoginBloc
- reactjs - Chart.js 中未填充基于 MongoDB 的数据
- android - 安卓。RxJava 2:并行多个网络调用
- reactjs - Google Apps 脚本和 React.js:删除 https://mygoogleappapi.com/exec 405(不允许的方法)
- python - golang 正则表达式可以处理类似于 python 的“二进制”正则表达式吗?