GradleWebApp | #Build Tool | 使用Gradle 构建Struts2、Springframework和hibernate 框架的Java EE 项目模板

 by   ShinChven Java Updated: 2 years ago - Current License: Proprietary

Download this library from

Build Applications

kandi X-RAY | GradleWebApp REVIEW AND RATINGS

#使用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 请参考这个仓库:https://github.com/ShinChven/SpringApp ##构建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 文件路径 }.

kandi-support
Support

  • GradleWebApp has a low active ecosystem.
  • It has 24 star(s) with 9 fork(s).
  • It had no major release in the last 12 months.
  • On average issues are closed in 2037 days.
  • It has a neutral sentiment in the developer community.

quality kandi
Quality

  • GradleWebApp has 0 bugs and 0 code smells.

security
Security

  • GradleWebApp has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
  • GradleWebApp code analysis shows 0 unresolved vulnerabilities.
  • There are 0 security hotspots that need review.

license
License

  • GradleWebApp has a Proprietary License.
  • Proprietary licenses can be open source with a non SPDX compliant license, or non open source licenses, and you need to review them closely before use.

build
Reuse

  • GradleWebApp releases are not available. You will need to build from source code and install.
  • Build file is available. You can build the component from source.
  • GradleWebApp saves you 68 person hours of effort in developing the same functionality from scratch.
  • It has 178 lines of code, 4 functions and 7 files with 0 % test coverage
  • It has low code complexity. Code complexity directly impacts maintainability of the code.
Top functions reviewed by kandi - BETA

kandi has reviewed GradleWebApp and discovered the below as its top functions. This is intended to give you an instant insight into GradleWebApp implemented functionality, and help decide if they suit your requirements.

  • Generate JSON string
  • Gets the property name .
  • Set the name .

GradleWebApp Key Features

使用Gradle 构建Struts2、Springframework和hibernate 框架的Java EE 项目模板

GradleWebApp examples and code snippets

  • default
  • Java web app recommended project structure

default

<p>
在配置好war 以后,Gradle build 时会自动生成这样的项目结构:<p>
    一般你的工程结构需要是:<p>
       src/main/java           -- java 代码<p>
       src/main/resources      -- 配置文件<p>
       src/main/webapp         -- WebRoot<p>
       build.gradle            -- gradle 构建脚本<p>
       settings.gradle         -- gradle 项目设置,在其中你可以配置目录下哪些文件夹是一个module<p>
       关于工程结构的配置请参照DEMO中build.gradle的war{}部分,<p>
       详情请查看gradle 的war 插件页面: http://www.gradle.org/docs/current/userguide/war_plugin.html<p>




Java web app recommended project structure

|-- Reference.iml
|-- gradle.build
|-- src
|   |-- java
|   |   `-- servlets
|   |       `-- AServlet.java
|   `-- test
|       `-- java
`-- web
    |-- WEB-INF
    |   `-- web.xml
    |-- resources
    |   `-- AnImage.jpg
    `-- index.html

COMMUNITY DISCUSSIONS

Top Trending Discussions on GradleWebApp
  • Java web app recommended project structure
Top Trending Discussions on GradleWebApp

QUESTION

Java web app recommended project structure

Asked 2017-Jan-10 at 13:20

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:

|-- WebApp.iml
|-- src
`-- web
    |-- WEB-INF
    |   `-- web.xml
    `-- index.jsp

If I create a Gradle project (File -> New Project -> check Gradle::Java and Gradle::Web -> Next etc...) I get the following structure:

|-- build
|   `-- tmp
|       `-- war
|           `-- MANIFEST.MF
|-- build.gradle
|-- GradleWebApp.iml
|-- out
|-- settings.gradle
`-- src
    `-- main
        `-- webapp
            `-- index.jsp

Before using IntelliJ I manually deployed a basic application to my local tomcat. The project structure was the following:

|-- WEB-INF
|   |-- classes
|   |   `-- servletsPkg
|   |       `-- AServlet.class
|   |-- src
|   |   `-- servletsPkg
|   |       `-- AServlet.java
|   `-- web.xml
|-- images
|   `-- an_image.jpg
|-- index.html
`-- styles.css

ANSWER

Answered 2017-Jan-10 at 13:20

Also found these two related stackExchange questions:

Not combined with gradle though...

However, finally came up with this project structure:

|-- Reference.iml
|-- gradle.build
|-- src
|   |-- java
|   |   `-- servlets
|   |       `-- AServlet.java
|   `-- test
|       `-- java
`-- web
    |-- WEB-INF
    |   `-- web.xml
    |-- resources
    |   `-- AnImage.jpg
    `-- index.html

Resembles most to the Java Web App initial structure. Went for this because it seemed to separate better the static part of the application from the java classes. I like thinking that the classes are the (only?) real "src" of the project.

Please let me know if there is anything that seems wrong with it.

Source https://stackoverflow.com/questions/41550866

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

For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .

Implement GradleWebApp faster with kandi.

  • Use the support, quality, security, license, reuse scores and reviewed functions to confirm the fit for your project.
  • Use the, Q & A, Installation and Support guides to implement faster.

Discover Millions of Libraries and
Pre-built Use Cases on kandi