配置maven仓库 手写maven项目 配置maven打包
生活随笔
收集整理的這篇文章主要介紹了
配置maven仓库 手写maven项目 配置maven打包
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
配置maven倉庫 手寫maven項目 配置maven打包
- 操作錄像
- maven環境變量
- maven倉庫
- maven標準pom.xml
- maven打包插件
- 附錄:FreeBSD默認環境變量
操作錄像
配置maven倉庫-手寫maven項目-配置maven打包
視頻傳送門: https://www.bilibili.com/video/BV1Mt4y1z7eV/
maven環境變量
export MAVEN_HOME=/home/ray/maven export PATH=$PATH:$MAVEN_HOME/binmaven倉庫
<!-- 阿里云倉庫 --> <mirror><id>alimaven</id><mirrorOf>central</mirrorOf><name>aliyun maven</name><url>http://maven.aliyun.com/nexus/content/repositories/central/</url> </mirror> <!-- 中央倉庫1 --> <mirror><id>repo1</id><mirrorOf>central</mirrorOf><name>Human Readable Name for this Mirror.</name><url>http://repo1.maven.org/maven2/</url> </mirror> <!-- 中央倉庫2 --> <mirror><id>repo2</id><mirrorOf>central</mirrorOf><name>Human Readable Name for this Mirror.</name><url>http://repo2.maven.org/maven2/</url> </mirror>maven標準pom.xml
<?xml version="1.0" encoding="UTF-8"?><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><groupId>org.ray</groupId><artifactId>helloworld</artifactId><version>1.0-SNAPSHOT</version><name>helloworld</name><!-- FIXME change it to the project's website --><url>http://www.example.com</url><properties><project.build.sourceEncoding>UTF-8</project.build.sourceEncoding><maven.compiler.source>1.8</maven.compiler.source><maven.compiler.target>1.8</maven.compiler.target></properties><dependencies><dependency><groupId>junit</groupId><artifactId>junit</artifactId><version>4.11</version><scope>test</scope></dependency></dependencies><build></build> </project>maven打包插件
<plugins><plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-shade-plugin</artifactId><executions><execution><phase>package</phase><goals><goal>shade</goal></goals><configuration><transformers><transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"><mainClass>org.ray.helloworld.Main</mainClass></transformer></transformers></configuration></execution></executions></plugin> </plugins>附錄:FreeBSD默認環境變量
/usr/local/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin總結
以上是生活随笔為你收集整理的配置maven仓库 手写maven项目 配置maven打包的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 各类开源协议
- 下一篇: FastDFS分布式文件系统介绍及单机版