简体   繁体   English

是否可以在构建时编译所有 JSP 并将它们交付到 WAR 的 /classes 文件夹中?

[英]Is it possible to compile all the JSPs at build time and deliver them in the /classes folder of the WAR?

I have a Java / Spring MVC web app in a WAR file.我在 WAR 文件中有一个 Java / Spring MVC web 应用程序。

The WAR file will be downloaded by corporate customers, so I need to obfuscate the classes in the WAR. WAR 文件将由企业客户下载,因此我需要对 WAR 中的类进行混淆处理。 The obfuscater I'm using (Allatori) nicely obfuscates all of the classes in the /classes folder in the WAR.我使用的混淆器 (Allatori) 很好地混淆了 WAR 中 /classes 文件夹中的所有类。

The problem is, the JSPs (which are uncompiled) are referencing the Java classes by their original (unobfuscated) names.问题是,JSP(未编译)通过其原始(未混淆)名称引用 Java 类。

I'm thinking if the JSPs were compiled and in the /classes folder, the obfuscater would get those too.我在想如果 JSP 被编译并且在 /classes 文件夹中,混淆器也会得到这些。

My question is... is there a way to compile the JSPs at build time and have them included in the /classes folder?我的问题是......有没有办法在构建时编译 JSP 并将它们包含在 /classes 文件夹中?

You can use The Apache Sling JSPC Maven Plugin which does exactly what you need.您可以使用Apache Sling JSPC Maven 插件,它可以满足您的需求。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM