<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>jshouse</artifactId>
<groupId>com.quickplan.common</groupId>
<version>1.0</version>
<packaging>jar</packaging>
<name>jshouse</name>
<properties>
</properties>
<build>
<!-- <finalName>jshouse</finalName> -->
<outputDirectory>${project.basedir}/WebRoot/WEB-INF/classes</outputDirectory>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.6.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<encoding>UTF-8</encoding>
<!-- java8 保留参数名编译参数 -->
<compilerArgument>-parameters</compilerArgument>
<compilerArguments>
<verbose />
</compilerArguments>
</configuration>
</plugin>
<!-- jar 包中的配置文件优先级高于 config 目录下的 "同名文件" 因此,打包时需要排除掉 jar 包中来自 src/main/resources
目录的 配置文件,否则部署时 config 目录中的同名配置文件不会生效 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.6</version>
<configuration>
<excludes>
<exclude>*.txt</exclude>
<exclude>*.xml</exclude>
<exclude>*.properties</exclude>
</excludes>
</configuration>
</plugin>
<!-- 使用 mvn clean package 打包 更多配置可参考官司方文档:http://maven.apache.org/plugins/maven-assembly-plugin/single-mojo.html -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<!-- 打包生成的文件名 -->
<finalName>${project.artifactId}</finalName>
<!-- jar 等压缩文件在被打包进入 zip、tar.gz 时是否压缩,设置为 false 可加快打包速度 -->
<recompressZippedFiles>false</recompressZippedFiles>
<!-- 打包生成的文件是否要追加 release.xml 中定义的 id 值 -->
<appendAssemblyId>true</appendAssemblyId>
<!-- 指向打包描述文件 package.xml -->
<descriptors>
<descriptor>package.xml</descriptor>
</descriptors>
<!-- 打包结果输出的基础目录 -->
<outputDirectory>target/</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
</dependencies>
</project>pom.xml↑
<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.0.0 http://maven.apache.org/xsd/assembly-2.0.0.xsd">
<!--
assembly 打包配置更多配置可参考官方文档:
http://maven.apache.org/plugins/maven-assembly-plugin/assembly.html
-->
<id>release</id>
<!--
设置打包格式,可同时设置多种格式,常用格式有:dir、zip、tar、tar.gz
dir 格式便于在本地测试打包结果
zip 格式便于 windows 系统下解压运行
tar、tar.gz 格式便于 linux 系统下解压运行
-->
<formats>
<format>dir</format>
<format>zip</format>
<!-- <format>tar.gz</format> -->
</formats>
<!-- 打 zip 设置为 true 时,会在 zip 包中生成一个根目录,打 dir 时设置为 false 少层目录 -->
<includeBaseDirectory>true</includeBaseDirectory>
<fileSets>
<fileSet>
<directory>${basedir}/WebRoot</directory>
<outputDirectory>WebRoot</outputDirectory>
<excludes>
<exclude>WEB-INF/classes/config.txt</exclude><!-- 去掉开发用的配置文件 -->
<exclude>userfiles/**</exclude><!-- 去掉开发环境中的上传文件 -->
</excludes>
</fileSet>
<!-- 项目根下面的脚本文件 copy 到根目录下 -->
<!-- 脚本文件在 linux 下的权限设为 755,无需 chmod 可直接运行 -->
<fileSet>
<directory>${basedir}</directory>
<outputDirectory></outputDirectory>
<fileMode>755</fileMode>
<includes>
<include>*.bat</include>
<include>*.sh</include>
</includes>
</fileSet>
</fileSets>
<!-- 依赖的 jar 包 copy 到 lib 目录下 -->
<dependencySets>
<dependencySet>
<outputDirectory>WebRoot/WEB-INF/lib</outputDirectory>
</dependencySet>
</dependencySets>
</assembly>package.xml↑
配置内容如上,基本是照抄jfinalmaven的,每次eclipse上运行mvn install之后,除了在项目的target目录生成打包文件以外,电脑本地的maven缓存目录\Maven\repository\里也会出现一个打包后的压缩文件,导致开发项目多了会生成数量容量巨多的release压缩包
试过百度搜索解决方法,但是没有头绪,连准确描述的关键词都没有,搜索很多的帖子讨论的都是不是我所关心的问题
想问一下有没有大佬知道这种现象是哪里出了问题,或者配置不正确
谢谢指教
<build> <plugins> 。。。 <!-- 禁用maven-deploy-plugin --> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-deploy-plugin</artifactId> <version>2.8.2</version> <configuration> <skip>true</skip> </configuration> </plugin> <!-- 禁用maven-install-plugin --> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-install-plugin</artifactId> <version>2.5.2</version> <configuration> <skip>true</skip> </configuration> </plugin> </plugins> </build>
pom.xml↑
已经解决,加入以上两条就不会编译到本地仓库
项目:JFinal