Maven如何打包成jar,如何指定main函数的入口,以及生成对应的lib

maven

	
		


		
		
			
				
				
					org.eclipse.m2e
					lifecycle-mapping
					1.0.0
					
						
							
								
									
										org.apache.maven.plugins
										maven-dependency-plugin
										[2.0,)
										
											copy-dependencies
										
									
									
										
									
								
							
						
					
				
			
		
		
			
			
				org.apache.maven.plugins
				maven-jar-plugin
				
					target/classes/
					
						
							
							tpri.mina.execute.Main
							
							false
							true
							lib/
						
						
							.
						
					
				
			
			
				org.apache.maven.plugins
				maven-dependency-plugin
				
					
						copy-dependencies
						package
						
							copy-dependencies
						
						
							jar
							jar
							false
							
								${project.build.directory}/lib
							
						
					
				
			
		
	
可以再MANIFEST.MF中查看到对应多了几个lib和main入口

Manifest-Version: 1.0
Built-By: hasee
Build-Jdk: 1.7.0_17
Class-Path: . lib/netty-all-5.0.0.Alpha1.jar lib/jboss-marshalling-1.3
 .0.CR9.jar lib/jboss-marshalling-serial-1.3.0.CR9.jar
Created-By: Apache Maven 3.2.5
Main-Class: tpri.mina.execute.Main
Archiver-Version: Plexus Archiver


你可能感兴趣的:(maven)