Maven打包项目配置
来源:互联网 发布:频繁项集 知乎 编辑:程序博客网 时间:2024/06/15 15:00
Maven打包项目配置
1.pom.xml中关于build的配置,如下:
<build> <!-- 编译环境(版本) --> <pluginManagement><plugins><plugin><artifactId>maven-compiler-plugin</artifactId><version>2.3.2</version><configuration><source>1.7</source><target>1.7</target><compilerArgument></compilerArgument></configuration></plugin></plugins></pluginManagement> <plugins> <!-- 打包jar文件时,配置manifest文件,加入lib包的jar依赖 --> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> <configuration> <archive> <manifest> <addClasspath>true</addClasspath> <classpathPrefix>lib/</classpathPrefix> <mainClass>com.supre.springboot.App</mainClass> </manifest> <manifestEntries><Class-Path>./</Class-Path></manifestEntries> </archive> </configuration> <executions> <execution> <phase>package</phase> <goals> <goal>jar</goal> </goals> <configuration> <classesDirectory>${basedir}/target/classes</classesDirectory> <finalName>${project.artifactId}-${project.version}</finalName> <outputDirectory>${basedir}/target/maven-archiver</outputDirectory> <excludes> <exclude>*.properties</exclude> </excludes> </configuration> </execution> </executions> </plugin> <!-- 拷贝依赖的jar包到lib目录 --> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-dependency-plugin</artifactId> <executions> <execution> <id>copy</id> <phase>package</phase> <goals> <goal>copy-dependencies</goal> </goals> <configuration> <outputDirectory>${project.build.directory}/maven-archiver/lib</outputDirectory> </configuration> </execution> </executions> </plugin> <!-- 拷贝配置文件到 打包的根目录下 --> <plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-antrun-plugin</artifactId><executions><execution><id>copy-files</id><phase>compile</phase><goals><goal>run</goal></goals><configuration><target name="copy files"><copy file="${basedir}/src/main/resource/application.properties"tofile="${project.build.directory}/maven-archiver/application.properties" /><copy file="${basedir}/src/main/resource/log4j.properties"tofile="${project.build.directory}/maven-archiver/log4j.properties" /></target></configuration></execution></executions></plugin> <!-- 导资源文件 未生效 <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-resources-plugin</artifactId> <executions> <execution> <id>copy-resources</id> <phase>package</phase> <goals> <goal>copy-resources</goal> </goals> <configuration> <outputDirectory>${basedir}/target/maven-archiver</outputDirectory> <resources> <resource> <directory>${basedir}/src/main/resources</directory> <filtering>true</filtering> <includes> <include>*.properties</include> </includes> </resource> </resources> </configuration> </execution> </executions> </plugin> --> </plugins> </build>
0 0
- maven项目打包配置
- Maven打包项目配置
- Jenkins配置-打包部署maven项目
- maven 项目打包war文件 xml配置
- Maven配置和打包以及使用Eclipse构建Maven项目
- Maven 项目打包发布
- maven项目打包异常
- Maven项目打包杂谈
- Maven 项目打包发布
- Maven 项目打包发布
- maven项目打包步骤
- maven项目打包
- maven项目打包命令
- maven项目打包运行
- maven项目打包注意事项
- maven打包项目
- maven项目打包
- maven项目打包
- SpringMVC访问静态资源
- 字符串反转
- 【SqlServer】字符串拆分需求实现
- 读配置文件
- 20170120
- Maven打包项目配置
- 文件读取方法(txt.excel)
- shell 脚本php自动部署
- Nginx重试引发Http请求重复执行
- CSS(6)布局初步
- ViewController dealloc 不执行
- 对页端开发高性能(交互/动画) Mobile WebApp 的一些思考
- 分布式锁实现方式三 基干Memcache mutex设计模式
- 获取数据库增量数据的几种方式