javaee: rewrite JSP validation to run inside external build process and download required JARs (IDEA-206443)

This fixes several issues when validation wasn't performed correctly because required files weren't copied to the artifact; also the validator don't process PSI inside the IDE process to analyze dependencies (it processes class-files inside the build process), this will help to avoid performance issues.

The validator's JARs are removed from Git repository and don't bundled with the product anymore; they are attached as Maven libraries with 'provided' scope to the sources, and downloaded automatically when validation is invoked for the first time. This also helps to avoid issues with updating libraries on which they depend (e.g. Ant).

Tests are rewritten to use a simple mock implementation of Jasper validator; this way they run faster, don't depend on external libraries and don't require specific JDK version (previously it was needed to use Java 6 to run them).
This commit is contained in:
nik
2019-02-07 17:45:05 +03:00
parent 529bfd5ac2
commit 27b10c30d3
49 changed files with 108 additions and 311 deletions
@@ -1,5 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
</web-app>
@@ -1,12 +0,0 @@
<testData>
<delete>
</delete>
<deleted_by_make>
<file path="classes/x/S.class" />
</deleted_by_make>
<recompile>
<file path="root/a.jsp" />
</recompile>
</testData>
@@ -1,5 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
</web-app>
@@ -1,14 +0,0 @@
<%--
Created by IntelliJ IDEA.
User: cdr
Date: Sep 17, 2004
Time: 2:53:58 PM
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@include file="dep.jsp" %>
<%@include file="dep2.jsp" %>
<html>
<head><title>Simple jsp page</title></head>
<body>Place your content here</body>
</html>
@@ -1,36 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<module version="4" relativePaths="true" type="JAVA_MODULE">
<component name="ModuleRootManager" />
<component name="NewModuleRootManager">
<output url="file://$MODULE_DIR$/classes" />
<exclude-output />
<exploded url="file://$MODULE_DIR$/exploded" />
<exclude-exploded />
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/xxx.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntryProperties />
</component>
<component name="FacetManager">
<facet type="web" name="module">
<configuration>
<webroots>
<root url="file://$MODULE_DIR$/root" relative="/" />
</webroots>
<descriptors>
<deploymentDescriptor name="web.xml" url="file://$MODULE_DIR$/WEB-INF/web.xml" version="2.3" />
</descriptors>
</configuration>
</facet>
</component>
</module>
@@ -1,7 +0,0 @@
<%@ page import="x.S"%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<% S.f(); %>
AAAAA
@@ -1,7 +0,0 @@
package x;
//////////
public class S {
public static void f() {
}
}
@@ -1,7 +0,0 @@
package x;
////////// XXXXXXX
public class S {
public static void f() {
}
}
@@ -1,5 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
</web-app>
@@ -1,11 +0,0 @@
<testData>
<delete>
</delete>
<deleted_by_make>
</deleted_by_make>
<recompile>
<file path="root/a.jsp" />
</recompile>
</testData>
@@ -1,5 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
</web-app>
@@ -1,14 +0,0 @@
<%--
Created by IntelliJ IDEA.
User: cdr
Date: Sep 17, 2004
Time: 2:53:58 PM
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@include file="dep.jsp" %>
<%@include file="dep2.jsp" %>
<html>
<head><title>Simple jsp page</title></head>
<body>Place your content here</body>
</html>
@@ -1,60 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<module version="4" relativePaths="true" type="JAVA_MODULE">
<component name="ModuleRootManager" />
<component name="NewModuleRootManager">
<output url="file://$MODULE_DIR$/classes" />
<exclude-output />
<exploded url="file://$MODULE_DIR$/exploded" />
<exclude-exploded />
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/xxx.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntryProperties />
</component>
<component name="VcsManagerConfiguration">
<option name="ACTIVE_VCS_NAME" value="&lt;None&gt;" />
<option name="USE_PROJECT_VCS" value="true" />
</component>
<component name="FacetManager">
<facet type="web" name="module">
<configuration>
<webroots>
<root url="file://$MODULE_DIR$/root" relative="/" />
</webroots>
<packaging>
<containerElement type="module" name="module">
<attribute name="method" value="1" />
<attribute name="URI" value="/WEB-INF/classes" />
</containerElement>
<containerElement type="library" level="module">
<url>jar://$MODULE_DIR$/lib/xxx.jar!/</url>
<attribute name="method" value="1" />
<attribute name="URI" value="/WEB-INF/lib/xxx.jar" />
</containerElement>
</packaging>
<descriptors>
<deploymentDescriptor name="web.xml" url="file://$MODULE_DIR$/WEB-INF/web.xml" version="2.3" />
</descriptors>
<building>
<setting name="EXPLODED_URL" value="file://$MODULE_DIR$/exploded" />
<setting name="EXPLODED_ENABLED" value="true" />
<setting name="JAR_URL" value="file://$MODULE_DIR$/dep/war/module.war" />
<setting name="JAR_ENABLED" value="false" />
<setting name="SYNC_EXPLODED_DIR" value="true" />
<setting name="BUILD_ON_FRAME_DEACTIVATION" value="false" />
<setting name="RUN_JASPER_VALIDATION" value="true" />
</building>
</configuration>
</facet>
</component>
</module>
@@ -1,14 +0,0 @@
<%--
Created by IntelliJ IDEA.
User: cdr
Date: Sep 17, 2004
Time: 2:53:58 PM
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@include file="dep.jsp" %>
<%@include file="dep2.jsp" %>
<html>
<head><title>Simple jsp page</title></head>
<body>Place your content here</body>
</html>
@@ -1,11 +0,0 @@
<testData>
<delete>
</delete>
<deleted_by_make>
</deleted_by_make>
<recompile>
<file path="root/a.jsp" />
</recompile>
</testData>
@@ -1,5 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
</web-app>
@@ -1,14 +0,0 @@
<%--
Created by IntelliJ IDEA.
User: cdr
Date: Sep 17, 2004
Time: 2:53:58 PM
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@include file="dep.jsp" %>
<%@include file="dep2.jsp" %>
<html>
<head><title>Simple jsp page</title></head>
<body>Place your content here</body>
</html>
@@ -1,26 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<module version="4" relativePaths="true" type="JAVA_MODULE">
<component name="ModuleRootManager" />
<component name="NewModuleRootManager">
<output url="file://$MODULE_DIR$/classes" />
<exclude-output />
<exploded url="file://$MODULE_DIR$/exploded" />
<exclude-exploded />
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
<component name="FacetManager">
<facet type="web" name="module">
<configuration>
<webroots>
<root url="file://$MODULE_DIR$/root" relative="/" />
</webroots>
<descriptors>
<deploymentDescriptor name="web.xml" url="file://$MODULE_DIR$/WEB-INF/web.xml" version="2.3" />
</descriptors>
</configuration>
</facet>
</component>
</module>
@@ -1,14 +0,0 @@
<%--
Created by IntelliJ IDEA.
User: cdr
Date: Sep 17, 2004
Time: 2:53:58 PM
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@include file="dep.jsp" %>
<%@include file="dep2.jsp" %>
<html>
<head><title>Simple jsp page</title></head>
<body>Place your content here</body>
</html>