今天用maven管理项目,折腾半天,打包成功,具体做法如下:先编译(如果有额外的配置文件,请将配置文件放在编译后的classes文件下对应的文件下面)---打包----ok!
我想只需要修改你的jar仓库和相应依赖的jar,直接按照上面所说的去做,maven打包应该是没有多大的问题的;
maven收索jar,
one-jar: plugin 不需要将依赖的jar解开,直接打包到目标jar
com.jolira onejar-maven-plugin 1.4.4 true onejar one-jar
当然项目中有json lib,注意他的依赖的配置 我是上当了!
4.0.0 gameServer gameServer 1.0 maven Maven Repository Switchboard default http://repo1.maven.org/maven2 false sourceforge http://oss.sonatype.org/content/groups/sourceforge/ true true springsource-repo SpringSource Repository http://repo.springsource.org/release org.springframework spring-context 3.2.1.RELEASE org.springframework spring-aop 3.2.1.RELEASE org.springframework spring-aspects 3.2.1.RELEASE asm asm-commons 3.3.1 org.springframework spring-beans 3.2.1.RELEASE org.springframework spring-context-support 3.2.1.RELEASE org.springframework spring-core 3.2.1.RELEASE org.springframework spring-expression 3.2.1.RELEASE org.springframework spring-instrument 3.2.1.RELEASE org.springframework spring-instrument-tomcat 3.2.1.RELEASE org.springframework spring-jdbc 3.2.1.RELEASE org.springframework spring-jms 3.2.1.RELEASE org.springframework spring-orm 3.2.1.RELEASE org.springframework spring-oxm 3.2.1.RELEASE org.springframework spring-tx 3.2.1.RELEASE org.springframework spring-webmvc 3.2.1.RELEASE org.springframework spring-web 3.2.1.RELEASE org.springframework spring-webmvc-portlet 3.2.1.RELEASE commons-beanutils commons-beanutils 1.8.0 javax.annotation jsr250-api 1.0 commons-collections commons-collections 3.2.1 commons-lang commons-lang 2.3 commons-logging commons-logging 1.1.1 log4j log4j 1.2.17 mysql mysql-connector-java 5.1.21 com.jolbox bonecp 0.7.1.RELEASE org.slf4j slf4j-api 1.6.4 compile true org.slf4j slf4j-log4j12 1.7.2 commons-logging commons-logging 1.1.1 compile true org.mybatis mybatis 3.2.0 org.mybatis mybatis-spring 1.2.0 dom4j dom4j 1.6.1 net.sf.json-lib json-lib 2.4 jdk15 net.sf.ezmorph ezmorph 1.0.6 com.google.collections google-collections 1.0 net.sourceforge.jexcelapi jxl 2.6.3 server src org.apache.maven.plugins maven-compiler-plugin org.apache.maven.plugins maven-jar-plugin 2.4 launcher.Launcher org.apache.maven.plugins maven-assembly-plugin 2.3 false jar-with-dependencies launcher.Launcher make-assembly package assembly