💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
使用该组件后,工程将完全变为springboot工程 本地开发工程加入BootRun类,执行main方法即可启动工程。 ~~~ apply plugin: "$release_mode" apply plugin: "eclipse" apply plugin: "org.springframework.boot" //编译器选项 [compileJava, compileTestJava]*.options*.encoding = "UTF-8" //工程相关配置 ext { build = "build" webapp = "src/main/webapp" classes = "$webapp/WEB-INF/classes" releasepath = "../release" } //发布版本号 version="$release_version" //spring boot插件 buildscript { repositories { maven {url "$repoUrl"} } dependencies { //spring boot插件 classpath ("org.walkframework:walk-boot-plugin:${walk_version}"){ exclude module : "spring-boot-maven-plugin" } } } //将webapp目录下jsp及其他文件拷贝到META-INF/resources下 bootJar.into("META-INF/resources") { from("$webapp") exclude "WEB-INF" } //maven远程仓库 repositories { //私服设置 maven {url "$repoUrl"} } //依赖管理 dependencies { //加载maven库依赖。格式:groupId:artifactId:version //walk框架相关 compile "org.walkframework:walk-base:${walk_version}" runtime "org.walkframework:walk-base:${walk_version}:walk-webapp@jar" //项目公用jar包 compile ("com.asiainfo.walk.common:biz-common:${biz_common_version}"){transitive = false} //如果使用spring boot compile "org.walkframework:walk-boot:${walk_version}" //打war包时注意:tomcat使用9以下版本需改成compileOnly,9版本不影响 compile "org.apache.tomcat.embed:tomcat-embed-jasper:${tomcat_version}" //jstl runtime "javax.servlet:jstl:${jstl_version}" //logstash日志收集 compile "net.logstash.logback:logstash-logback-encoder:${logstash_version}" //数据库相关 //runtime "com.oracle:ojdbc6:${ojdbc_version}" runtime "mysql:mysql-connector-java:${mysql_connector_java_version}" //测试 testCompile "org.springframework.boot:spring-boot-starter-test:${spring_boot_version}" //walk管理控制台相关 runtime "org.walkframework:walk-console:${walk_version}" //activiti相关,如首次使用需将application.properties文件中spring.activiti.database-schema-update设为true,以便初始化表 compile "org.walkframework:walk-activiti:${walk_version}" //springcloud相关 // compile "com.alibaba.cloud:spring-cloud-starter-alibaba-nacos-config:${alibaba_cloud_version}" // compile "com.alibaba.cloud:spring-cloud-starter-alibaba-nacos-discovery:${alibaba_cloud_version}" // compile "org.springframework.boot:spring-boot-starter-actuator:${spring_boot_version}" } //springcloud相关 //dependencyManagement { // imports { // mavenBom "org.springframework.cloud:spring-cloud-dependencies:${spring_cloud_version}" // } //} //清理目录 task cleanfiles { doFirst { println project.name + " cleanfiles..." delete "bin" delete "logs" delete ".settings" delete ".tmp" } } //类加强 task enhance(type: JavaExec) { println project.name + " enhance..." classpath = sourceSets.main.runtimeClasspath main = "org.walkframework.base.system.translate.enhance.TranslatorEnhancerStarter" } ~~~ 在安装jdk的主机上执行命令即可启动 ~~~ java -jar web-demo.jar ~~~ 其他参数可额外指定。 ~~~ java -jar web-demo.jar --server.port=16101 --walkbatis.isHotDeploy=false --cache.cacheDriver=rediscache ~~~