因为我们开发是用的eclipse,里面有工程文件.project这种文件,运行release:prepare的时候报异常:
Cannot prepare the release because you have local modifications
提示你有文件没有提交,正常的文件可以提交,但是这种文件我们得让插件自己过滤掉。
配置如下:


Java代码 复制代码  收藏代码
  1. <plugin>   
  2.                 <groupId>org.apache.maven.plugins</groupId>   
  3.                 <artifactId>maven-release-plugin</artifactId>   
  4.                  <version>2.2.1</version>   
  5.                 <configuration>   
  6.                     <tagBase>https://127.0.0.1/svn/maven_svn/tags/</tagBase>   
  7.                     <checkModificationExcludes>   
  8.                         <checkModificationExclude>.project</checkModificationExclude>   
  9.                         <checkModificationExclude>.classpath</checkModificationExclude>   
  10.                     </checkModificationExcludes>   
  11.                 </configuration>   
  12.             </plugin>  
<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-release-plugin</artifactId>
				 <version>2.2.1</version>
				<configuration>
					<tagBase>https://127.0.0.1/svn/maven_svn/tags/</tagBase>
					<checkModificationExcludes>
						<checkModificationExclude>.project</checkModificationExclude>
						<checkModificationExclude>.classpath</checkModificationExclude>
					</checkModificationExcludes>
				</configuration>
			</plugin>

或者
Java代码 复制代码  收藏代码
  1. <plugin>   
  2.                 <groupId>org.apache.maven.plugins</groupId>   
  3.                 <artifactId>maven-release-plugin</artifactId>   
  4.                  <version>2.2.1</version>   
  5.                 <configuration>   
  6.                     <tagBase>https://127.0.0.1/svn/maven_svn/tags/</tagBase>   
  7. <checkModificationExcludeList>.project,.classpath</checkModificationExcludeList>   
  8.                 </configuration>   
  9.             </plugin>  

更多推荐