0%

AtomicInteger

AtomicInteger,一个提供原子操作的Integer的类。在Java语言中,++i和i++操作并不是线程安全的,在使用的时候,不可避免的会用到synchronized关键字。而AtomicInteger则通过一种线程安全的加减操作接口。

阅读全文 »

Purging local repository dependencies

The purpose of thedependency:purge-local-repositorygoal is to purge (delete and optionally re-resolve) artifacts from the local maven repository. This page describes some of the configuration options available to the plugin.

1
mvn dependency:purge-local-repository
阅读全文 »

**-DskipTests**,不执行测试用例,但编译测试用例类生成相应的class文件至target/test-classes下。

**-Dmaven.test.skip=true**,不执行测试用例,也不编译测试用例类。

也可以在pom.xml文件中修改

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<plugin>  
<groupId>org.apache.maven.plugin</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.1</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.5</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>

pom.xml配置

1
2
3
4
5
6
7
8
9
10
11
12
<distributionManagement>
<repository>
<id>releases</id>
<name>Internal Releases</name>
<url>http://121.40.185.58:8081/nexus/content/repositories/thirdparty</url>
</repository>
<snapshotRepository>
<id>releases</id>
<name>Internal Releases</name>
<url>http://121.40.185.58:8081/nexus/content/repositories/thirdparty</url>
</snapshotRepository>
</distributionManagement>

setting.xml文件配置

1
2
3
4
5
<server>  
<id>releases</id>
<username>admin</username>
<password>admin123</password>
</server>