188 Star 769 Fork 170

GVPNutz / nutz

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
maven.man 3.62 KB
一键复制 编辑 原始数据 按行查看 历史
Wendal 提交于 2017-07-17 23:38 . release: 发布1.r.62
#title: Maven基本配置
#index:0,1
#author:wendal(wendal1985@gmail.com)
----------------------------------------------------------------------------------------------------
Nutz核心jar
nutz及周边插件,均已发布到maven中央库库,可以直接配置使用
{{{<XML>
<dependency>
<groupId>org.nutz</groupId>
<artifactId>nutz</artifactId>
<version>1.r.62</version>
</dependency>
}}}
快照库地址 [https://jfrog.nutz.cn/artifactory/snapshots https://jfrog.nutz.cn/artifactory/snapshots]
快照库内包含nutz主库,插件库,等快照jar
----------------------------------------------------------------------------------------------------
常用配置模板
新建项目的参考配置,nutz+mysql+druid,并应用了nutzcn提供的maven镜像服务及快照库.
{{{<XML>
<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>mygroupId</groupId>
<artifactId>myartifactId</artifactId>
<packaging>war</packaging>
<version>1.0-SNAPSHOT</version>
<properties>
<!-- UTF8大法好 -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<!-- 核心jar -->
<dependency>
<groupId>org.nutz</groupId>
<artifactId>nutz</artifactId>
<version>1.r.62</version>
</dependency>
<!-- mysql驱动 -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.40</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
<scope>provided</scope>
</dependency>
<!-- Druid连接池 -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid</artifactId>
<version>1.0.27</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<compilerArgs>
<arg>-parameters</arg>
</compilerArgs>
<useIncrementalCompilation>false</useIncrementalCompilation>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>nutz</id>
<url>https://jfrog.nutz.cn/artifactory/jcenter</url>
</repository>
<repository>
<id>nutz-snapshots</id>
<url>https://jfrog.nutz.cn/artifactory/snapshots</url>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</snapshots>
<releases>
<enabled>false</enabled>
</releases>
</repository>
</repositories>
</project>
}}}
----------------------------------------------------------------------------------------------------
特别提醒
如果配置过镜像库,例如阿里的镜像库, 你的settings.xml里面也许有这样的配置,注意星号
{{{<XML>
<mirror>
<id>nexus-aliyun</id>
<mirrorOf>*</mirrorOf>
<name>Nexus aliyun</name>
<url>http://maven.aliyun.com/nexus/content/groups/public</url>
</mirror>
}}}
这个配置是错误的, 星号代表全部,无论是release还是snapshots都代理, 会导致所有第三方快照库的设置都失效. 要改成
{{{<XML>
<mirror>
<id>nexus-aliyun</id>
<mirrorOf>central</mirrorOf>
<name>Nexus aliyun</name>
<url>http://maven.aliyun.com/nexus/content/groups/public</url>
</mirror>
}}}
Java
1
https://gitee.com/nutz/nutz.git
git@gitee.com:nutz/nutz.git
nutz
nutz
nutz
b04d2655b85c0be3c01e0edecf25b27150cc4101

搜索帮助