plugins {
id 'java 'id 'idea'
}
jar{
string somestr=' '
configurations.runtime.each{somestr=somestr+" lib\\"+it.name}manifest{
attributes ' Main-Class ' : ' HexUtil’// packagenameattributes 'Class-Path ' : somestr
}
}
task copyJar(type: Copy){
from configurations.runtimeinto ( ' build/libs/lib')
}
task release(type: Copy,dependsOn: [ build,copyJar]){
}
完成,直接运行任务gradle release就看见目录下生成的包了。
写一个.bat命令吧。Assembly code
@echo off set MY_CLASSPATH=. set MY_CLASSPATH=%MY_CLASSPATH%d:\lib1\my1.jar set MY_CLASSPATH=%MY_CLASSPATH%d:\lib2\my2.jar set MY_CLASSPATH=%MY_CLASSPATH%d:\lib2\my3.jar set MY_CLASS=org.希赛.Hello java -cp "%MY_CLASSPATH%" %MY_CLASS%
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)