Skip to content

Commit a790730

Browse files
committed
Update command checker to proactively set maven/gradle. Update make -> makeWithRoot to build even when dependencies are missing. Add Integration Tests.
Signed-off-by: Rahul Krishna <[email protected]>
1 parent 5a4ea53 commit a790730

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+2380
-0
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
target/
2+
!target/*.war
3+
!target/liberty/wlp/usr/shared/resources/*
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
target/
2+
pom.xml.tag
3+
pom.xml.releaseBackup
4+
pom.xml.versionsBackup
5+
pom.xml.next
6+
release.properties
7+
dependency-reduced-pom.xml
8+
buildNumber.properties
9+
.mvn/timing.properties
10+
# https://github.com/takari/maven-wrapper#usage-without-binary-jar
11+
.mvn/wrapper/maven-wrapper.jar
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
FROM icr.io/appcafe/open-liberty:kernel-slim-java17-openj9-ubi
3+
4+
COPY --chown=1001:0 /src/main/liberty/config /config
5+
6+
RUN features.sh
7+
8+
COPY --chown=1001:0 target/*.war /config/apps
9+
10+
RUN configure.sh
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
After you generate a starter project, these instructions will help you with what to do next.
2+
3+
The Open Liberty starter gives you a simple, quick way to get the necessary files to start building
4+
an application on Open Liberty. There is no need to search how to find out what to add to your
5+
Maven build files. A simple RestApplication.java file is generated for you to start
6+
creating a REST based application. A server.xml configuration file is provided with the necessary
7+
features for the MicroProfile and Jakarta EE versions that you previously selected.
8+
9+
If you plan on developing and/or deploying your app in a containerized environment, the included
10+
Dockerfile will make it easier to create your application image on top of the Open Liberty Docker
11+
image.
12+
13+
1) Once you download the starter project, unpackage the .zip file on your machine.
14+
2) Open a command line session, navigate to the installation directory, and run `./mvnw liberty:dev` (Linux/Mac) or `mvnw liberty:dev` (Windows).
15+
This will install all required dependencies and start the default server. When complete, you will
16+
see the necessary features installed and the message "server is ready to run a smarter planet."
17+
18+
For information on developing your application in dev mode using Maven, see the
19+
dev mode documentation (https://openliberty.io/docs/latest/development-mode.html).
20+
21+
For further help on getting started actually developing your application, see some of our
22+
MicroProfile guides (https://openliberty.io/guides/?search=microprofile&key=tag) and Jakarta EE
23+
guides (https://openliberty.io/guides/?search=jakarta%20ee&key=tag).
24+
25+
If you have problems building the starter project, make sure the Java SE version on your
26+
machine matches the Java SE version you picked from the Open Liberty starter on the downloads
27+
page (https://openliberty.io/downloads/). You can test this with the command `java -version`.
28+
29+
Open Liberty performs at its best when running using Open J9 which can be obtained via IBM Semeru
30+
(https://developer.ibm.com/languages/java/semeru-runtimes/downloads/). For a full list of supported
31+
Java SE versions and where to obtain them, reference the Java SE support page
32+
(https://openliberty.io/docs/latest/java-se.html).
33+
34+
If you find any issues with the starter project or have recommendations to improve it, open an
35+
issue in the starter GitHub repo (https://github.com/OpenLiberty/start.openliberty.io).
Lines changed: 270 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,270 @@
1+
{
2+
"system_dependency_graph": [],
3+
"symbol_table": {
4+
"/Users/rkrsn/Downloads/gradlew-corrupt-test/src/main/java/com/demo/CurrentTimeServlet.java": {
5+
"file_path": "/Users/rkrsn/Downloads/gradlew-corrupt-test/src/main/java/com/demo/CurrentTimeServlet.java",
6+
"comment": "// Assisted by watsonx Code Assistant ",
7+
"imports": [
8+
"java.io.IOException",
9+
"java.io.PrintWriter",
10+
"java.util.Date",
11+
"javax.servlet.ServletException",
12+
"javax.servlet.annotation.WebServlet",
13+
"javax.servlet.http.HttpServlet",
14+
"javax.servlet.http.HttpServletRequest",
15+
"javax.servlet.http.HttpServletResponse"
16+
],
17+
"type_declarations": {
18+
"com.demo.CurrentTimeServlet": {
19+
"is_nested_type": false,
20+
"is_class_or_interface_declaration": true,
21+
"is_enum_declaration": false,
22+
"is_annotation_declaration": false,
23+
"is_record_declaration": false,
24+
"is_interface": false,
25+
"is_inner_class": false,
26+
"is_local_class": false,
27+
"extends_list": [
28+
"javax.servlet.http.HttpServlet"
29+
],
30+
"comment": "",
31+
"implements_list": [],
32+
"modifiers": [
33+
"public"
34+
],
35+
"annotations": [
36+
"@WebServlet(\"/currentTime\")"
37+
],
38+
"parent_type": "",
39+
"nested_type_declarations": [],
40+
"callable_declarations": {
41+
"doGet(HttpServletRequest, HttpServletResponse)": {
42+
"signature": "doGet(HttpServletRequest, HttpServletResponse)",
43+
"comment": "",
44+
"annotations": [
45+
"@Override"
46+
],
47+
"modifiers": [
48+
"protected"
49+
],
50+
"thrown_exceptions": [
51+
"javax.servlet.ServletException",
52+
"java.io.IOException"
53+
],
54+
"declaration": "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException",
55+
"parameters": [
56+
{
57+
"type": "javax.servlet.http.HttpServletRequest",
58+
"name": "request",
59+
"annotations": [],
60+
"modifiers": []
61+
},
62+
{
63+
"type": "javax.servlet.http.HttpServletResponse",
64+
"name": "response",
65+
"annotations": [],
66+
"modifiers": []
67+
}
68+
],
69+
"code": "{\n response.setContentType(\"text/html\");\n PrintWriter out = response.getWriter();\n out.println(\"<h1>Current Time</h1>\");\n out.println(\"<p>The current date and time is:</p>\");\n out.println(\"<h2>\" + new Date() + \"</h2>\");\n}",
70+
"start_line": 20,
71+
"end_line": 27,
72+
"return_type": "void",
73+
"is_implicit": false,
74+
"is_constructor": false,
75+
"referenced_types": [
76+
"java.io.PrintWriter"
77+
],
78+
"accessed_fields": [],
79+
"call_sites": [
80+
{
81+
"method_name": "setContentType",
82+
"receiver_expr": "response",
83+
"receiver_type": "javax.servlet.http.HttpServletResponse",
84+
"argument_types": [
85+
"java.lang.String"
86+
],
87+
"return_type": "",
88+
"callee_signature": "setContentType(java.lang.String)",
89+
"is_public": true,
90+
"is_protected": false,
91+
"is_private": false,
92+
"is_unspecified": false,
93+
"is_static_call": false,
94+
"is_constructor_call": false,
95+
"start_line": 22,
96+
"start_column": 9,
97+
"end_line": 22,
98+
"end_column": 44
99+
},
100+
{
101+
"method_name": "getWriter",
102+
"receiver_expr": "response",
103+
"receiver_type": "javax.servlet.http.HttpServletResponse",
104+
"argument_types": [],
105+
"return_type": "java.io.PrintWriter",
106+
"callee_signature": "getWriter()",
107+
"is_public": true,
108+
"is_protected": false,
109+
"is_private": false,
110+
"is_unspecified": false,
111+
"is_static_call": false,
112+
"is_constructor_call": false,
113+
"start_line": 23,
114+
"start_column": 27,
115+
"end_line": 23,
116+
"end_column": 46
117+
},
118+
{
119+
"method_name": "println",
120+
"receiver_expr": "out",
121+
"receiver_type": "java.io.PrintWriter",
122+
"argument_types": [
123+
"java.lang.String"
124+
],
125+
"return_type": "",
126+
"callee_signature": "println(java.lang.String)",
127+
"is_public": true,
128+
"is_protected": false,
129+
"is_private": false,
130+
"is_unspecified": false,
131+
"is_static_call": false,
132+
"is_constructor_call": false,
133+
"start_line": 24,
134+
"start_column": 9,
135+
"end_line": 24,
136+
"end_column": 44
137+
},
138+
{
139+
"method_name": "println",
140+
"receiver_expr": "out",
141+
"receiver_type": "java.io.PrintWriter",
142+
"argument_types": [
143+
"java.lang.String"
144+
],
145+
"return_type": "",
146+
"callee_signature": "println(java.lang.String)",
147+
"is_public": true,
148+
"is_protected": false,
149+
"is_private": false,
150+
"is_unspecified": false,
151+
"is_static_call": false,
152+
"is_constructor_call": false,
153+
"start_line": 25,
154+
"start_column": 9,
155+
"end_line": 25,
156+
"end_column": 59
157+
},
158+
{
159+
"method_name": "println",
160+
"receiver_expr": "out",
161+
"receiver_type": "java.io.PrintWriter",
162+
"argument_types": [
163+
"java.lang.String"
164+
],
165+
"return_type": "",
166+
"callee_signature": "println(java.lang.String)",
167+
"is_public": true,
168+
"is_protected": false,
169+
"is_private": false,
170+
"is_unspecified": false,
171+
"is_static_call": false,
172+
"is_constructor_call": false,
173+
"start_line": 26,
174+
"start_column": 9,
175+
"end_line": 26,
176+
"end_column": 50
177+
},
178+
{
179+
"method_name": "<init>",
180+
"receiver_expr": "",
181+
"receiver_type": "java.util.Date",
182+
"argument_types": [],
183+
"return_type": "java.util.Date",
184+
"callee_signature": "Date()",
185+
"is_public": false,
186+
"is_protected": false,
187+
"is_private": false,
188+
"is_unspecified": true,
189+
"is_static_call": false,
190+
"is_constructor_call": true,
191+
"start_line": 26,
192+
"start_column": 30,
193+
"end_line": 26,
194+
"end_column": 39
195+
}
196+
],
197+
"variable_declarations": [
198+
{
199+
"name": "out",
200+
"type": "java.io.PrintWriter",
201+
"initializer": "response.getWriter()",
202+
"start_line": 23,
203+
"start_column": 21,
204+
"end_line": 23,
205+
"end_column": 46
206+
}
207+
],
208+
"cyclomatic_complexity": 1
209+
}
210+
},
211+
"field_declarations": [
212+
{
213+
"comment": "",
214+
"type": "long",
215+
"start_line": 18,
216+
"end_line": 18,
217+
"variables": [
218+
"serialVersionUID"
219+
],
220+
"modifiers": [
221+
"private",
222+
"static",
223+
"final"
224+
],
225+
"annotations": []
226+
}
227+
]
228+
}
229+
},
230+
"is_modified": false
231+
},
232+
"/Users/rkrsn/Downloads/gradlew-corrupt-test/src/main/java/com/demo/rest/RestApplication.java": {
233+
"file_path": "/Users/rkrsn/Downloads/gradlew-corrupt-test/src/main/java/com/demo/rest/RestApplication.java",
234+
"comment": "",
235+
"imports": [
236+
"javax.ws.rs.ApplicationPath",
237+
"javax.ws.rs.core.Application"
238+
],
239+
"type_declarations": {
240+
"com.demo.rest.RestApplication": {
241+
"is_nested_type": false,
242+
"is_class_or_interface_declaration": true,
243+
"is_enum_declaration": false,
244+
"is_annotation_declaration": false,
245+
"is_record_declaration": false,
246+
"is_interface": false,
247+
"is_inner_class": false,
248+
"is_local_class": false,
249+
"extends_list": [
250+
"javax.ws.rs.core.Application"
251+
],
252+
"comment": "",
253+
"implements_list": [],
254+
"modifiers": [
255+
"public"
256+
],
257+
"annotations": [
258+
"@ApplicationPath(\"/api\")"
259+
],
260+
"parent_type": "",
261+
"nested_type_declarations": [],
262+
"callable_declarations": {},
263+
"field_declarations": []
264+
}
265+
},
266+
"is_modified": false
267+
}
268+
},
269+
"version": "1.0.11"
270+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/*
2+
* This file was generated by the Gradle 'init' task.
3+
*/
4+
5+
plugins {
6+
id 'java'
7+
id 'maven-publish'
8+
}
9+
10+
repositories {
11+
mavenLocal()
12+
maven {
13+
url = uri('https://repo.maven.apache.org/maven2/')
14+
}
15+
}
16+
17+
dependencies {
18+
compileOnly 'javax:javaee-api:7.0'
19+
compileOnly 'org.eclipse.microprofile:microprofile:1.4'
20+
}
21+
22+
group = 'com.demo'
23+
version = '1.0-SNAPSHOT'
24+
description = 'my-javaee-mvn'
25+
java.sourceCompatibility = JavaVersion.VERSION_1_8
26+
27+
publishing {
28+
publications {
29+
maven(MavenPublication) {
30+
from(components.java)
31+
}
32+
}
33+
}
34+
35+
tasks.withType(JavaCompile) {
36+
options.encoding = 'UTF-8'
37+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
distributionBase=GRADLE_USER_HOME
2+
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
4+
zipStoreBase=GRADLE_USER_HOME
5+
zipStorePath=wrapper/dists

src/it/resources/test-applications/gradlew-corrupt-test/gradlew

Whitespace-only changes.

0 commit comments

Comments
 (0)