maven 使用

原文链接: https://www.cnblogs.com/zhangwuji/p/10040834.html?tdsourcetag=s_pcqq_aiomsg

maven 打包依赖
https://www.cnblogs.com/zhangwuji/p/10040834.html?tdsourcetag=s_pcqq_aiomsg

maven-enforcer-plugin (goal “enforce”) is ignored by m2e.

http://blog.csdn.net/jdwl20090304/article/details/40107269

maven打包可运行的JAR

http://blog.163.com/coffee_hc/blog/static/4485331920121274422988/

java运行jar命令提示没有主清单属性
http://jingyan.baidu.com/article/db55b60990f6084ba30a2fb8.html

打包时跳过test
http://www.cnblogs.com/lixuwu/p/5941363.html

解决Maven报Plugin execution not covered by lifecycle configuration

http://blog.csdn.net/xxd851116/article/details/25197373

Java/Scala混合项目maven打包

mvn clean scala:compile compile package

Maven打包过程中跳过测试
http://blog.csdn.net/redstarofsleep/article/details/46518585

maven冲突

package macros contains object and package with same name:blackbox one of them needs to be removed from classpath

这有可能是scala中的Object和添加的依赖有冲突,比如,本次遇到的冲突就是和下面的依赖有冲突,跟scope标签没关系,也跟scala编译器的配置没关系


		
			org.apache.spark
			spark-mllib_2.10
			2.2.0
			provided
		

请使用 -source 7 或更高版本以启用 diamond 运算符


				maven-compiler-plugin
				3.5.1
				
					1.8
					1.8
				
				
					
						default-compile
						compile
						
							compile
						
					
					
						default-testCompile
						test-compile
						
							testCompile
						
					
				
			

maven-assembly-plugin


				org.apache.maven.plugins
				maven-jar-plugin
				3.0.2
				
					
						
							true
							lib/
							org.neo4j.test.Neo4jTest
						
					
				
				
			
			
				org.apache.maven.plugins
				maven-assembly-plugin
				3.0.0
				
					
						jar-with-dependencies
						package
						
						
							
								src/assembly/jar-assembly.xml
							
							
								
									true
									lib/
									org.neo4j.test.Neo4jTest
								
							
						
					
				
			

maven 打包后,通过可以得到src/main/resources下的资源,这是将src/main/resources下的资源打入jar包后,通过以下方法得到

PropertyConfigurator.configure(this.getClass().getClassLoader().getResource("log4j.properties"));

如果maven打包后,没有把src/main/resources下的资源打入jar包,从另外的配置文件读取,是这样的,读取的jar里的

String path="conf/log4j.properties";
InputStream in=this.getClass().getClassLoader().getResourceAsStream(path);

maven 使用_第1张图片

你可能感兴趣的:(maven)