GradleWebApp | 使用Gradle 构建Struts2、Springframework和hibernate 框架的Java EE 项目模板 | Build Tool library
kandi X-RAY | GradleWebApp Summary
kandi X-RAY | GradleWebApp Summary
#使用Gradle 构建JavaWebApp Gradle是很强大的构建工具,不过如果你在天朝,你可能需要一个强大的网络环境。 本项目不具备太大实战意义,只是探索性地使用Gradle 构建Java Web项目,本人自己也只是使用它当学生和测试的模板。 本项目还在不间断施工中,请多多包涵。 如果在「食用」过程中发现Gradle build起来真TM恶心,建议赶紧回头使用Maven,Maven 在天朝使用确实更加顺畅。 ##Gradle的基本结构 一般使用Gradle 来构建一个项目,首先会有一个project文件夹,然后在project文件夹中会有一个或者多个module。project表示一个工作空间,而其中的module则是具体的应用,也可以是应用所依赖的library。 ###settings.gradle 在此文件中使用include ':folder' 语句配置某个文件夹为module文件夹,只有在这里配置了,开发工具才会增目标文件夹中运行build.gradle文件构建module。 ###build.gradle Gradle项目中使用build.gradle 文件对项目进行构建:. 2、module 中的build.gradle 配置module 的构建。 ##SSH module 这是一个Gradle 构建的Struts2 Hiberante4 Springframeworks4 应用,详细配置请查看其中的build.gradle 文件。该module基本已经填完坑,可以拉下来直接运行。. Good luck! ##SpringWebMVC 请参考这个仓库:##构建War 项目 当你在module 的build.gradle中添加了war 插件(apply plugin: 'war')时,IDE会识别该module 为Java Web项目, 你可以使用一些配置来定义War包的结构,比如:. ``groovy configurations { moreLibs // 配置该module 在构建时,既加载dependencies中的依赖,还加载「散装」的jar包 }. war { from '/src/main/webapp' // 指定WebRoot 路径 webInf { from '/src/main/webapp/WEB-INF/' } // 指定 WEB-INF 文件夹路径. classpath fileTree('lib') // 指定 WEB-INF/lib 文件夹路径. classpath configurations.moreLibs // build 「散装」的jar包 webXml = file('/src/main/webapp/WEB-INF/web.xml') // WEB-INF/web.xml 文件路径 }.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Get response json string
GradleWebApp Key Features
GradleWebApp Examples and Code Snippets
Community Discussions
Trending Discussions on GradleWebApp
QUESTION
I'm using IntelliJ to create one of my first web apps. I'd like to use Gradle to solve my dependencies. Depending on how I create the project, it is structured differently.
I was wondering whether there is a recommended project structure for web apps. Where to put the static pages? Where to put the classes? Where the other resources (like images)? And where to put other framework-specific files, like the build.gradle file?
Right now I see three alternatives:
If I create the project as a Java web application (File -> New Project -> check Java::JavaEE::Web Application -> Next etc...) I get the following project structure:
...ANSWER
Answered 2017-Jan-10 at 13:20Also found these two related stackExchange questions:
Not combined with gradle though...
However, finally came up with this project structure:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install GradleWebApp
You can use GradleWebApp like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the GradleWebApp component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page