Skip to content

Commit 8f916c4

Browse files
ludochgae-java-bot
authored andcommitted
Compile App Engine JSPs with Jasper JDTCompiler and remove Apache Ant support.
PiperOrigin-RevId: 999408105 Change-Id: I5bcbb38da2660defaf09abc34d81acc78b0b3e69
1 parent 45bc77a commit 8f916c4

20 files changed

Lines changed: 220 additions & 681 deletions

File tree

‎THIRD-PARTY.txt‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ The repository contains 3rd-party code under the following licenses:
1111

1212
Apache License, Version 2.0
1313

14-
* Apache Ant Core (org.apache.ant:ant:1.10.15 - https://ant.apache.org/)
15-
* Apache Ant Launcher (org.apache.ant:ant-launcher:1.10.15 - https://ant.apache.org/)
1614
* Apache Commons Codec (commons-codec:commons-codec:1.19.0 - https://commons.apache.org/proper/commons-codec/)
1715
* Apache Commons Collections (org.apache.commons:commons-collections4:4.4 - https://commons.apache.org/proper/commons-collections/)
1816
* Apache Commons Lang (org.apache.commons:commons-lang3:3.13.0 - https://commons.apache.org/proper/commons-lang/)

‎api_dev/pom.xml‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -138,11 +138,6 @@
138138
<artifactId>appengine-resources</artifactId>
139139
</dependency>
140140
<!-- Test dependencies. -->
141-
<dependency>
142-
<groupId>org.apache.ant</groupId>
143-
<artifactId>ant</artifactId>
144-
<scope>test</scope>
145-
</dependency>
146141
<dependency>
147142
<groupId>com.google.guava</groupId>
148143
<artifactId>guava-testlib</artifactId>

‎api_dev/src/test/java/com/google/appengine/tools/development/AppEngineWebXmlTest.java‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@
1616

1717
package com.google.appengine.tools.development;
1818

19+
import static java.nio.charset.StandardCharsets.UTF_8;
20+
1921
import com.google.common.io.Resources;
22+
import java.io.ByteArrayInputStream;
2023
import java.io.IOException;
2124
import java.io.InputStream;
2225
import javax.xml.XMLConstants;
@@ -25,7 +28,6 @@
2528
import javax.xml.validation.SchemaFactory;
2629
import javax.xml.validation.Validator;
2730
import junit.framework.TestCase;
28-
import org.apache.tools.ant.filters.StringInputStream;
2931
import org.xml.sax.SAXException;
3032

3133
/**
@@ -82,7 +84,7 @@ public void setUp() {
8284

8385
private void assertGoodXml(String xml) {
8486
try {
85-
InputStream inputStream = new StringInputStream(xml);
87+
InputStream inputStream = new ByteArrayInputStream(xml.getBytes(UTF_8));
8688
validator.validate(new StreamSource(inputStream));
8789
} catch (SAXException e) {
8890
fail(e.getMessage());
@@ -93,7 +95,7 @@ private void assertGoodXml(String xml) {
9395

9496
private void assertBadXml(String xml) throws Exception {
9597
try {
96-
InputStream inputStream = new StringInputStream(xml);
98+
InputStream inputStream = new ByteArrayInputStream(xml.getBytes(UTF_8));
9799
validator.validate(new StreamSource(inputStream));
98100
fail("Expected failure.");
99101
} catch (SAXException e) {

‎api_dev/src/test/java/com/google/appengine/tools/development/DispatchXsdTest.java‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@
1717
package com.google.appengine.tools.development;
1818

1919
import static com.google.common.truth.Truth.assertWithMessage;
20+
import static java.nio.charset.StandardCharsets.UTF_8;
2021

2122
import com.google.common.io.Resources;
23+
import java.io.ByteArrayInputStream;
2224
import java.io.IOException;
2325
import java.io.InputStream;
2426
import javax.xml.XMLConstants;
@@ -27,7 +29,6 @@
2729
import javax.xml.validation.SchemaFactory;
2830
import javax.xml.validation.Validator;
2931
import junit.framework.TestCase;
30-
import org.apache.tools.ant.filters.StringInputStream;
3132
import org.xml.sax.SAXException;
3233
import org.xml.sax.SAXParseException;
3334

@@ -240,7 +241,7 @@ private Validator getValidator() {
240241

241242
private void validate(String xml, String expectedSaxParserExceptionMessage) {
242243
try {
243-
InputStream inputStream = new StringInputStream(xml);
244+
InputStream inputStream = new ByteArrayInputStream(xml.getBytes(UTF_8));
244245
getValidator().validate(new StreamSource(inputStream));
245246
if (expectedSaxParserExceptionMessage != null) {
246247
fail("Validator should complain.");

‎api_dev/src/test/java/com/google/appengine/tools/development/DosXmlTest.java‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@
1717
package com.google.appengine.tools.development;
1818

1919
import static com.google.common.truth.Truth.assertThat;
20+
import static java.nio.charset.StandardCharsets.UTF_8;
2021

2122
import com.google.common.io.Resources;
23+
import java.io.ByteArrayInputStream;
2224
import java.io.IOException;
2325
import java.io.InputStream;
2426
import javax.xml.XMLConstants;
@@ -27,7 +29,6 @@
2729
import javax.xml.validation.SchemaFactory;
2830
import javax.xml.validation.Validator;
2931
import junit.framework.TestCase;
30-
import org.apache.tools.ant.filters.StringInputStream;
3132
import org.xml.sax.SAXException;
3233
import org.xml.sax.SAXParseException;
3334

@@ -92,7 +93,7 @@ public void setUp() {
9293

9394
public void testGoodXml() {
9495
try {
95-
InputStream inputStream = new StringInputStream(SIMPLE_XML);
96+
InputStream inputStream = new ByteArrayInputStream(SIMPLE_XML.getBytes(UTF_8));
9697
validator.validate(new StreamSource(inputStream));
9798
} catch (SAXException e) {
9899
fail(e.getMessage());
@@ -103,7 +104,7 @@ public void testGoodXml() {
103104

104105
public void testBadXmlEntry() {
105106
try {
106-
InputStream inputStream = new StringInputStream(BAD_XML_ENTRY);
107+
InputStream inputStream = new ByteArrayInputStream(BAD_XML_ENTRY.getBytes(UTF_8));
107108
validator.validate(new StreamSource(inputStream));
108109
fail("Validator should complain.");
109110
} catch (SAXParseException e) {
@@ -121,7 +122,7 @@ public void testBadXmlEntry() {
121122

122123
public void testMissingSubnetXmlEntry() {
123124
try {
124-
InputStream inputStream = new StringInputStream(MISSING_SUBNET_XML_ENTRY);
125+
InputStream inputStream = new ByteArrayInputStream(MISSING_SUBNET_XML_ENTRY.getBytes(UTF_8));
125126
validator.validate(new StreamSource(inputStream));
126127
fail("Validator should complain.");
127128
} catch (SAXParseException e) {

‎api_dev/src/test/java/com/google/appengine/tools/development/QueueXmlTest.java‎

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@
1717
package com.google.appengine.tools.development;
1818

1919
import static com.google.common.truth.Truth.assertThat;
20+
import static java.nio.charset.StandardCharsets.UTF_8;
2021

2122
import com.google.common.io.Resources;
23+
import java.io.ByteArrayInputStream;
2224
import java.io.IOException;
2325
import java.io.InputStream;
2426
import javax.xml.XMLConstants;
@@ -27,7 +29,6 @@
2729
import javax.xml.validation.SchemaFactory;
2830
import javax.xml.validation.Validator;
2931
import junit.framework.TestCase;
30-
import org.apache.tools.ant.filters.StringInputStream;
3132
import org.xml.sax.SAXException;
3233
import org.xml.sax.SAXParseException;
3334

@@ -325,7 +326,7 @@ public void setUp() {
325326

326327
public void testGoodXml() {
327328
try {
328-
InputStream inputStream = new StringInputStream(SIMPLE_XML);
329+
InputStream inputStream = new ByteArrayInputStream(SIMPLE_XML.getBytes(UTF_8));
329330
validator.validate(new StreamSource(inputStream));
330331
} catch (SAXException | IOException e) {
331332
fail(e.getMessage());
@@ -334,7 +335,8 @@ public void testGoodXml() {
334335

335336
public void testGoodXmlWithStorageLimit() {
336337
try {
337-
InputStream inputStream = new StringInputStream(SIMPLE_XML_WITH_STORAGE_LIMIT);
338+
InputStream inputStream =
339+
new ByteArrayInputStream(SIMPLE_XML_WITH_STORAGE_LIMIT.getBytes(UTF_8));
338340
validator.validate(new StreamSource(inputStream));
339341
} catch (SAXException | IOException e) {
340342
fail(e.getMessage());
@@ -343,7 +345,7 @@ public void testGoodXmlWithStorageLimit() {
343345

344346
public void testComplexXml() {
345347
try {
346-
InputStream inputStream = new StringInputStream(COMPLEX_XML);
348+
InputStream inputStream = new ByteArrayInputStream(COMPLEX_XML.getBytes(UTF_8));
347349
validator.validate(new StreamSource(inputStream));
348350
} catch (SAXException | IOException e) {
349351
fail(e.getMessage());
@@ -352,7 +354,7 @@ public void testComplexXml() {
352354

353355
public void testBadXmlEntry() {
354356
try {
355-
InputStream inputStream = new StringInputStream(BAD_XML_ENTRY);
357+
InputStream inputStream = new ByteArrayInputStream(BAD_XML_ENTRY.getBytes(UTF_8));
356358
validator.validate(new StreamSource(inputStream));
357359
fail("Validator should complain.");
358360
} catch (SAXParseException e) {
@@ -368,7 +370,7 @@ public void testBadXmlEntry() {
368370

369371
public void testBadMode() {
370372
try {
371-
InputStream inputStream = new StringInputStream(BAD_XML_MODE);
373+
InputStream inputStream = new ByteArrayInputStream(BAD_XML_MODE.getBytes(UTF_8));
372374
validator.validate(new StreamSource(inputStream));
373375
fail("Validator should complain.");
374376
} catch (SAXParseException e) {
@@ -384,7 +386,7 @@ public void testBadMode() {
384386

385387
public void testBadName() {
386388
try {
387-
InputStream inputStream = new StringInputStream(BAD_XML_NAME);
389+
InputStream inputStream = new ByteArrayInputStream(BAD_XML_NAME.getBytes(UTF_8));
388390
validator.validate(new StreamSource(inputStream));
389391
fail("Validator should complain.");
390392
} catch (SAXParseException e) {
@@ -400,7 +402,7 @@ public void testBadName() {
400402

401403
public void testBadRate() {
402404
try {
403-
InputStream inputStream = new StringInputStream(BAD_XML_RATE);
405+
InputStream inputStream = new ByteArrayInputStream(BAD_XML_RATE.getBytes(UTF_8));
404406
validator.validate(new StreamSource(inputStream));
405407
fail("Validator should complain.");
406408
} catch (SAXParseException e) {
@@ -416,7 +418,8 @@ public void testBadRate() {
416418

417419
public void testBadMaxConcurrentRequests() {
418420
try {
419-
InputStream inputStream = new StringInputStream(BAD_XML_MAX_CONCURRENT_REQUESTS);
421+
InputStream inputStream =
422+
new ByteArrayInputStream(BAD_XML_MAX_CONCURRENT_REQUESTS.getBytes(UTF_8));
420423
validator.validate(new StreamSource(inputStream));
421424
fail("Validator should complain.");
422425
} catch (SAXParseException e) {
@@ -430,7 +433,7 @@ public void testBadMaxConcurrentRequests() {
430433

431434
public void testBadStorageLimit() {
432435
try {
433-
InputStream inputStream = new StringInputStream(BAD_XML_STORAGE_LIMIT);
436+
InputStream inputStream = new ByteArrayInputStream(BAD_XML_STORAGE_LIMIT.getBytes(UTF_8));
434437
validator.validate(new StreamSource(inputStream));
435438
fail("Validator should complain.");
436439
} catch (SAXParseException e) {
@@ -446,7 +449,8 @@ public void testBadStorageLimit() {
446449

447450
public void testMultipleStorageLimit() {
448451
try {
449-
InputStream inputStream = new StringInputStream(BAD_XML_MULTIPLE_STORAGE_LIMIT);
452+
InputStream inputStream =
453+
new ByteArrayInputStream(BAD_XML_MULTIPLE_STORAGE_LIMIT.getBytes(UTF_8));
450454
validator.validate(new StreamSource(inputStream));
451455
fail("Validator should complain.");
452456
} catch (SAXParseException e) {
@@ -462,7 +466,7 @@ public void testMultipleStorageLimit() {
462466

463467
public void testBadRetryParameters() {
464468
try {
465-
InputStream inputStream = new StringInputStream(BAD_RETRY_PARAMETERS_XML);
469+
InputStream inputStream = new ByteArrayInputStream(BAD_RETRY_PARAMETERS_XML.getBytes(UTF_8));
466470
validator.validate(new StreamSource(inputStream));
467471
fail("Validator should complain.");
468472
} catch (SAXParseException e) {
@@ -476,7 +480,8 @@ public void testBadRetryParameters() {
476480

477481
public void testBadRetryParametersInAclXml() {
478482
try {
479-
InputStream inputStream = new StringInputStream(BAD_RETRY_PARAMETERS_IN_ACL_XML);
483+
InputStream inputStream =
484+
new ByteArrayInputStream(BAD_RETRY_PARAMETERS_IN_ACL_XML.getBytes(UTF_8));
480485
validator.validate(new StreamSource(inputStream));
481486
fail("Validator should complain.");
482487
} catch (SAXParseException e) {
@@ -492,7 +497,8 @@ public void testBadRetryParametersInAclXml() {
492497

493498
public void testBadUserEmailInRetryParameters() {
494499
try {
495-
InputStream inputStream = new StringInputStream(BAD_USER_EMAIL_IN_RETRY_PARAMETERS_XML);
500+
InputStream inputStream =
501+
new ByteArrayInputStream(BAD_USER_EMAIL_IN_RETRY_PARAMETERS_XML.getBytes(UTF_8));
496502
validator.validate(new StreamSource(inputStream));
497503
fail("Validator should complain.");
498504
} catch (SAXParseException e) {
@@ -508,13 +514,14 @@ public void testBadUserEmailInRetryParameters() {
508514
}
509515

510516
public void testOkEmptyAcl() throws Exception {
511-
InputStream inputStream = new StringInputStream(OK_EMPTY_ACL_XML);
517+
InputStream inputStream = new ByteArrayInputStream(OK_EMPTY_ACL_XML.getBytes(UTF_8));
512518
validator.validate(new StreamSource(inputStream));
513519
}
514520

515521
public void testMultipleRetryParameters() {
516522
try {
517-
InputStream inputStream = new StringInputStream(MULTIPLE_RETRY_PARAMETERS_XML);
523+
InputStream inputStream =
524+
new ByteArrayInputStream(MULTIPLE_RETRY_PARAMETERS_XML.getBytes(UTF_8));
518525
validator.validate(new StreamSource(inputStream));
519526
fail("Validator should complain.");
520527
} catch (SAXParseException e) {

‎lib/tools_api/pom.xml‎

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,6 @@
3131
<url>https://github.com/GoogleCloudPlatform/appengine-java-standard/</url>
3232

3333
<dependencies>
34-
<dependency>
35-
<groupId>org.apache.ant</groupId>
36-
<artifactId>ant</artifactId>
37-
<optional>true</optional>
38-
</dependency>
3934
<dependency>
4035
<groupId>org.slf4j</groupId>
4136
<artifactId>slf4j-api</artifactId>
@@ -263,12 +258,6 @@
263258
<include>org/antlr/runtime/**</include>
264259
</includes>
265260
</filter>
266-
<filter>
267-
<artifact>org.apache.ant:ant</artifact>
268-
<includes>
269-
<include>org/apache/tools/ant/**</include>
270-
</includes>
271-
</filter>
272261
<filter>
273262
<artifact>org.apache.httpcomponents:httpclient</artifact>
274263
<includes>
@@ -300,7 +289,6 @@
300289
<include>commons-codec:commons-codec:*</include>
301290
<include>commons-logging:commons-logging:*</include>
302291
<include>org.antlr:antlr-runtime:*</include>
303-
<include>org.apache.ant:ant</include>
304292
<include>org.apache.httpcomponents:httpclient</include>
305293
<include>org.apache.httpcomponents:httpcore:*</include>
306294
<!-- Jetty here for mimetype only, can be 12.1.x -->

‎lib/tools_api/src/main/java/com/google/appengine/tools/admin/AppAdminFactory.java‎

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -57,18 +57,6 @@ public void setJavaExecutable(File java) {
5757
appOptions.setJavaExecutable(java);
5858
}
5959

60-
/**
61-
* Specifies the location of a javac executable, used when compiling JSPs. By default, the system
62-
* property {@code java.home} is used to identify the currently-running JVM. If that pathname ends
63-
* with "jre", then its parent is used instead as a hoped-for JDK root. If that directory contains
64-
* a file named {@code bin/javac} (Unix) or {@code bin\\javac.exe} (Windows), that is returned.
65-
*
66-
* @param javac the Java compiler executable to be used.
67-
*/
68-
public void setJavaCompiler(File javac) {
69-
appOptions.setJavaCompiler(javac);
70-
}
71-
7260
/**
7361
* Requests that *.jsp files should be compiled into Java byte code, or if false should be left
7462
* untouched.

0 commit comments

Comments
 (0)