首页 > 代码库 > Gradle 创建Web项目
Gradle 创建Web项目
apply plugin: ‘java‘apply plugin: ‘war‘apply plugin: ‘eclipse-wtp‘apply plugin: ‘maven‘ def projectName = "finance-site"version = ‘0.0.1-SNAPSHOT‘sourceCompatibility = 1.7webAppDirName = ‘WebContent‘ [compileJava, javadoc, compileTestJava]*.options*.encoding = ‘UTF-8‘ //源码结构sourceSets { main { java { srcDir ‘src/main/java‘ } resources { srcDir ‘src/main/resources‘ } }} //在线仓库repositories { maven { url ‘http://maven.oschina.net/content/groups/public/‘ } mavenCentral() } //项目依赖dependencies { providedRuntime project(‘:core-service-interface‘) providedCompile ‘javax.servlet:servlet-api:2.5‘ providedRuntime ‘javax.servlet:jstl:1.2‘ providedRuntime ‘org.freemarker:freemarker:2.3+‘ providedRuntime ‘commons-fileupload:commons-fileupload:1.2.2‘ providedRuntime ‘org.springframework:spring-webmvc:3.2.4.RELEASE‘ providedRuntime "org.springframework:spring-web:3.2.4.RELEASE" providedRuntime ‘org.springframework:spring-context-support:3.2.4.RELEASE‘ testCompile(‘junit:junit:4.7‘)} //eclipse 配置eclipse { wtp { contextPath = "WebContent" deployName = "finance" component { resource sourcePath: ‘src/main/java‘, deployPath: ‘/WEB-INF/classes‘ resource sourcePath: ‘WebContent‘, deployPath: ‘/‘ resource sourcePath: ‘/remote‘, deployPath: ‘/WEB-INF/classes‘ } }} uploadArchives { repositories { mavenDeployer { repository(url: "http://192.168.2.167:8888/nexus/content/repositories/snapshots/") { authentication(userName: "admin", password: "admin123") pom.groupId = "com.ff" pom.version = version pom.artifactId = projectName } } }}build.dependsOn uploadArchives /*-----------发布编码 --------------- */task publishCode << { /*copy { from into } */}/*-----------发布测试 --------------- */task publishTest << {}/*-----------发布线上 --------------- */task publishOnline << {}
Gradle 创建Web项目
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。