`

Maven中指定得AspectJ依赖无法添加得解决方案

阅读更多

使用Maven长久以来一直遇到这样得一个问题,就是pom文件中加入了aspectj得依赖,但执行mvn eclipse:eclipse后,classpath中确没有加入指定得依赖,很奇怪,开始得解决办法是在自己得mvn私服中deploy aspectj得两个改名后得依赖,原名是:

 

<dependency>
    <groupId>org.aspectj</groupId>
    <artifactId>aspectjrt</artifactId>
    <version>1.6.10</version>
</dependency>

 

<dependency>
    <groupId>org.aspectj</groupId>
    <artifactId>aspectjweaver</artifactId>
    <version>1.6.10</version>
</dependency>

 

至于修改得名称可以随便起名。这样可以曲线解决。

 

但今天看了maven得maven-eclipse-plugin插件得文档找到了这样一个选项:

 

ajdtVersion String - The version of AJDT for which configuration files will be generated. The default value is "1.5", supported versions are "none" (AJDT support disabled), "1.4", and "1.5".
Default value isnone.

 

即eclipse环境中已有AJDT环境,显示得填入none就可以解决了。pom配置文件是:

 

<plugin>
	<artifactId>maven-eclipse-plugin</artifactId>
	<version>2.8</version>
	<configuration>
		<sourceExcludes>
			<sourceExclude>**/.svn/</sourceExclude>
		</sourceExcludes>
		<downloadSources>true</downloadSources>
		<ajdtVersion>none</ajdtVersion>
	</configuration>
</plugin>
 

再次执行mvn eclipse:eclipse即可

 

 

 

 

分享到:
评论
1 楼 fangwei06056115 2014-09-28  

相关推荐

Global site tag (gtag.js) - Google Analytics