
Maven
totally123
这个作者很懒,什么都没留下…
展开
-
Maven install jar包到本地仓库
mvn install:install-file -Dfile=cache-1.0.jar -DgroupId=com.wanmei -DartifactId=cache -Dversion=1.0 -Dpackaging=jar原创 2017-03-02 14:12:07 · 430 阅读 · 0 评论 -
Maven项目读取resources目录下文件
要取编译后的路径,而不是你看到的src/main/resources的路径。如下:URL url = MyTest.class.getClassLoader().getResource("userFile.properties");File file = new File(url.getFile());或者InputStream is = MyTest.class.ge...原创 2017-06-07 16:21:43 · 19507 阅读 · 0 评论 -
Maven 项目打不同名称的war包
问题描述:I have two profiles in my pom.xml for our application…dev (for use on a developer’s)prod (production).When we run our maven build all three profiles output a war file with the same name. I woul转载 2017-08-15 17:36:18 · 1495 阅读 · 0 评论 -
Maven打包跳过单元测试
Maven在打包时可以使用两种方式来跳过单元测试:-DskipTests-Dmaven.test.skip=true两者的区别如下:skipTests:不执行测试用例,但编译测试用例类生成相应的class文件至target/test-classes下,执行结果如下:[INFO] --- maven-resources-plugin:2.6:testResources (default-test原创 2017-11-20 10:45:29 · 1589 阅读 · 0 评论 -
Maven利用profile打不同环境的包
需求1:有时会打不同环境的包,如测试、正式等;有时会要排除一些静态资源。解决:使用maven-war-plugin插件加warSourceExcludes和packagingExcludes这两个参数来配置。这两个参数的官网解释如下:warSourceExcludes:The comma separated list of tokens to exclude when copying t...转载 2018-01-08 17:14:21 · 1154 阅读 · 0 评论