最近一段时间以来,项目中使用maven-eclipse-plugin的eclipse:eclipse目标时比较恼人。pom里已经加入了aspectj的依赖,但生成的.classpath里却没有相应的classpathentry。
今天google到了解决办法,有两个:
1. 强制使用上个版本的maven-eclipse-plugin
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.5.1</version>
</plugin>
2. 设置ajdtVersion为none
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-eclipse-plugin</artifactId>
<configuration>
<ajdtVersion>none</ajdtVersion>
</configuration>
</plugin>
Related posts
使用Maven进行Java的web开发,Jetty Plugin是必不可缺的插件,可以极大的提到开发效率。但在Windows环境下会遇到静态文件(html、css、js)被锁定、无法即时更新的问题。要想更新这些文件,只能先停掉Jetty,保存修改,再启动Jetty,非常不方便。
解决办法是这样的:
1、从jetty.jar中解出webdefault.xml(位于org.mortbay.jetty.webapp包下)这个文件,把这个useFileMappedBuffer参数设为false
<init-param>
<param-name>useFileMappedBuffer</param-name>
<!-- change to false -->
<param-value>true</param-value>
</init-param>
2、把修改后的webdefault.xml文件跟pom.xml放在一起
3、修改pom.xml里的Jetty Plugin的配置,加入webdefault.xml
...
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<version>6.1.7</version>
<configuration>
<contextPath>/</contextPath>
<webDefaultXml>webdefault.xml</webDefaultXml>
...
</configuration>
...
</plugin>
...
Related posts
Published on
2 years, 9 months ago in
Dev.
Tags: Java, maven.
使用Artifactiry为自己的开发团队设立了repository镜像。有时需要把本地的一些第三方的jar包发布到服务器,使用maven-deploy-plugin的deploy:deploy-file目标可以完成这个任务。
比如,要发布jta的jar包jta-1.0.1B.jar
$ mvn deploy:deploy-file -DgroupId=javax.transaction \
-DartifactId=jta \
-Dversion=1.0.1B \
-Dpackaging=jar \
-Dfile=~/.m2/repository/javax/transaction/jta/1.0.1B/jta-1.0.1B.jar \
-DrepositoryId=central \
-Durl=http://host.of.your.repository[:port]/artifactory/ibiblio@repo
说明:
- repositoryId在工程的pom文件里设置
- url由Artifactiry的配置决定,注意不能使用virtual repository的地址
- 如果远程repository需要身份验证,用户名和密码需要在maven的settings.xml里设置
参考:
Related posts
Recent Comments