Skip to content

Commit 71db139

Browse files
committed
Project Init:
- init gradle - init JSP and servlet plugins - update .gitignore
1 parent 8d9138a commit 71db139

13 files changed

+507
-0
lines changed

.gitattributes

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#
2+
# https://help.github.com/articles/dealing-with-line-endings/
3+
#
4+
# Linux start script should use lf
5+
/gradlew text eol=lf
6+
7+
# These are Windows script files and should use crlf
8+
*.bat text eol=crlf
9+

.gitignore

+28
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# IDE and project settings
2+
.idea
3+
4+
### Java template
15
# Compiled class file
26
*.class
37

@@ -22,3 +26,27 @@
2226
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
2327
hs_err_pid*
2428
replay_pid*
29+
30+
### Gradle template
31+
.gradle
32+
**/build/
33+
!src/**/build/
34+
35+
# Ignore Gradle GUI config
36+
gradle-app.setting
37+
38+
# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
39+
!gradle-wrapper.jar
40+
41+
# Avoid ignore Gradle wrappper properties
42+
!gradle-wrapper.properties
43+
44+
# Cache of project
45+
.gradletasknamecache
46+
47+
# Eclipse Gradle plugin generated files
48+
# Eclipse Core
49+
.project
50+
# JDT-specific (Eclipse Java Development Tools)
51+
.classpath
52+

app/build.gradle

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/*
2+
* This file was generated by the Gradle 'init' task.
3+
*
4+
* This generated file contains a sample Java application project to get you started.
5+
* For more details on building Java & JVM projects, please refer to https://docs.gradle.org/8.8/userguide/building_java_projects.html in the Gradle documentation.
6+
* This project uses @Incubating APIs which are subject to change.
7+
*/
8+
9+
plugins {
10+
id 'org.gretty' version '4.1.4'
11+
id 'java'
12+
id 'war'
13+
}
14+
15+
repositories {
16+
// Use Maven Central for resolving dependencies.
17+
mavenCentral()
18+
}
19+
20+
dependencies {
21+
// This dependency is used by the application.
22+
implementation libs.guava
23+
compileOnly 'javax.servlet:javax.servlet-api:4.0.1'
24+
compileOnly 'javax.servlet.jsp:jsp-api:2.2'
25+
implementation 'javax.servlet:jstl:1.2'
26+
}
27+
28+
sourceSets {
29+
main {
30+
resources {
31+
srcDirs = ['src/main/webapp']
32+
}
33+
}
34+
}
35+
36+
// Apply a specific Java toolchain to ease working on different environments.
37+
java {
38+
toolchain {
39+
languageVersion = JavaLanguageVersion.of(22)
40+
}
41+
}
+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/*
2+
* This source file was generated by the Gradle 'init' task
3+
*/
4+
package org.example;
5+
6+
public class App {
7+
public String getGreeting() {
8+
return "Hello World!";
9+
}
10+
11+
public static void main(String[] args) {
12+
System.out.println(new App().getGreeting());
13+
}
14+
}

app/src/main/webapp/index.jsp

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<%--
2+
Created by IntelliJ IDEA.
3+
User: Rivon
4+
Date: 22/06/2024
5+
Time: 15:30
6+
To change this template use File | Settings | File Templates.
7+
--%>
8+
<%@ page contentType="text/html;charset=UTF-8" %>
9+
<html>
10+
<head>
11+
<title>Title</title>
12+
</head>
13+
<body>
14+
<div> Hello World!</div>
15+
</body>
16+
</html>
+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/*
2+
* This source file was generated by the Gradle 'init' task
3+
*/
4+
package org.example;
5+
6+
import org.junit.jupiter.api.Test;
7+
import static org.junit.jupiter.api.Assertions.*;
8+
9+
class AppTest {
10+
@Test void appHasAGreeting() {
11+
App classUnderTest = new App();
12+
assertNotNull(classUnderTest.getGreeting(), "app should have a greeting");
13+
}
14+
}

gradle.properties

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# This file was generated by the Gradle 'init' task.
2+
# https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_configuration_properties
3+
4+
org.gradle.parallel=true
5+
org.gradle.caching=true
6+

gradle/libs.versions.toml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# This file was generated by the Gradle 'init' task.
2+
# https://docs.gradle.org/current/userguide/platforms.html#sub::toml-dependencies-format
3+
4+
[versions]
5+
guava = "33.0.0-jre"
6+
7+
[libraries]
8+
guava = { module = "com.google.guava:guava", version.ref = "guava" }

gradle/wrapper/gradle-wrapper.jar

42.4 KB
Binary file not shown.
+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
distributionBase=GRADLE_USER_HOME
2+
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
4+
networkTimeout=10000
5+
validateDistributionUrl=true
6+
zipStoreBase=GRADLE_USER_HOME
7+
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)