maven pom使用

2 篇文章 0 订阅

一 pom引入本地包

  <dependency>
		<groupId>oracle</groupId>
		<artifactId>ojdbc6</artifactId>
		<version>11.2.0.3</version>
		<scope>system</scope>
		<systemPath>${project.basedir}/src/lib/ojdbc6-11.2.0.3.jar</systemPath>
</dependency>

二 跳过test打包

 <properties>
        <skipTests>true</skipTests>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
 </properties>

三 设置mapper.xml不在resource文件下

还需要对应的yml配置 设置mybatis

mapper-locations: classpath*:com/包名/包名/dao/*Mapper.xml

<build>,
	<resources>
	    <resource>
	        <directory>src/main/java</directory>
	        <includes>
	            <include>**/*.xml</include>
	        </includes>
	        <filtering>true</filtering>
	    </resource>
	</resources>
</build>	

设置jdk版本

每个模块都需要添加

  <properties>
        <java.version>1.8</java.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    </properties>

仓库地址

<repositories>
        <repository>
            <id>nexus-aliyun</id>
            <name>Nexus aliyun</name>
            <layout>default</layout>
            <url>http://maven.aliyun.com/nexus/content/groups/public</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
            <releases>
                <enabled>true</enabled>
            </releases>
        </repository>
    </repositories>
  	 
	 <!--配置阿里云镜像-->
    <mirror>
      <id>nexus-aliyun</id>
      <mirrorOf>central</mirrorOf>
      <name>Nexus aliyun</name>
      <url>http://maven.aliyun.com/nexus/content/groups/public</url>
     </mirror>
	 

配置打包名称

  <build>
        <finalName>${project.artifactId}-1.1.0</finalName>
    </build>

自定义pom版本依赖

<elasticsearch.version>7.7.0</elasticsearch.version>

常用依赖

<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-lang3 -->
<dependency>
    <groupId>org.apache.commons</groupId>
    <artifactId>commons-lang3</artifactId>
    <version>3.11</version>
</dependency>

修改版本

升级

## mvn versions:set -DnewVersion=1.0.3-SNAPSHOT
mvn versions:set -DnewVersion=1.0.1

回退

mvn versions:revert

版本读取

上面的版本优先读取

安装本地jar包

mvn install:install-file -Dfile=C:\Users\Administrator\Desktop\netpay.jar -DgroupId=CCBSign -DartifactId=RSASig -Dversion=1.0 -Dpackaging=jar

私服


指令

mvn -pl   指定模块打包

mvn -U 强制刷新本地仓库不存在release版和所有的snapshots版本。
-B,-批处理模式以非交互方式运行(批处理)模式(禁用输出颜色)

-f,-file 强制使用备用POM文件(或带有pom.xml的目录),pom文件路径必须紧跟在 -f 参数后面
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值