Build hygiene: normalize text, package module sources, pin serialVersionUID, drop unused test deps - #182
Closed
VolodymyrLinuxovich wants to merge 4 commits into
Closed
Build hygiene: normalize text, package module sources, pin serialVersionUID, drop unused test deps#182VolodymyrLinuxovich wants to merge 4 commits into
VolodymyrLinuxovich wants to merge 4 commits into
Conversation
) - Add .gitattributes (LF text, CRLF only for Windows command scripts such as a future Maven wrapper, binary for images and archives) and a minimal .editorconfig (UTF-8, LF, indentation for Java, Python and YAML). - Renormalize core/pom.xml, the only CRLF text file, to LF. With CR ignored, its diff is only the XML declaration line. - Declare UTF-8 in the ten XML files that declared US-ASCII or ISO-8859-1 (POMs, site descriptors, checkstyle.xml). All of them are pure ASCII, so no content byte changes. - Remove the unused root META-INF/MANIFEST.MF, a stale bnd 1.50 manifest for 1.2.1 that nothing references; the build writes its manifests to target/classes. - Clear the executable bit on pom.xml, the only executable file. - Replace five overlapping target patterns in .gitignore with target/. The one binary fixture (src/site/resources/images/owasp.jpg) is untouched.
maven-source-plugin packages the project's compile source roots, and src/main/java9 was only a root of the separate compile-java-9 execution, so no sources JAR contained module-info.java. - build-helper-maven-plugin 3.6.2 (pinned in pluginManagement) adds src/main/java9 as a project source root at generate-sources. - The Java 8 default-compile execution now reads only src/main/java, so the descriptor never reaches Java 8 compilation. compile-java-9 is unchanged. - Javadoc (source level 8) excludes module-info.java. The binary JARs are unchanged: they still contain only META-INF/versions/9/module-info.class. The packaged-consumer preparation now also checks that each sources JAR contains module-info.java, the artifact's own package sources, and no class files.
…ASP#123) The class relied on the JVM-computed serialVersionUID. serialver gives -1517019963198920181L for every released core from 1.2 through 1.4.0 and for the current class, so declaring that value keeps serialized instances compatible while protecting it from future structural changes. UnsupportedContextExceptionTest pins the value and round-trips an instance. Manually, an instance serialized with the released 1.4.0 JAR deserializes with this class.
) javax.servlet:javax.servlet-api (jsp) and jakarta.servlet: jakarta.servlet-api (jakarta) were test-scoped, but no test or packaged check uses them. dependency:analyze reports both as unused declared dependencies. Without them, core, jsp and jakarta pass clean verify, including the parameterized tag contracts, the TLD descriptor tests and ModulePathIT. The packaged-consumer preparation and its 15 guard tests also pass. The packaged-consumer harness keeps its own Servlet API JARs in compatibility/dependencies, where the module-path and Felix consumers do need them. The optional jakarta-test application is unchanged.
Contributor
Author
|
Closing as superseded by #184, which covers #123. Thanks! Keeping One item from this PR isn't in #184: the two test-scoped Servlet API dependencies,
If you'd like that removal, I can open a two-file PR against current |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #123.
Build hygiene for batch 04, as four independent commits. BSN declarations are out of scope; #137/#174 already handled them.
1. Line endings, encodings, legacy files (
725b80a).gitattributes: LF for text; CRLF only for*.cmd/*.bat(for a future Maven wrapper, Pin Maven bootstrap and toolchain policy; evaluate verified dependency trust separately #122); binary for images and archives..editorconfig: UTF-8, LF, and indentation for Java, Python and YAML. It deliberately leaves out trim and final-newline rules to avoid churn.core/pom.xmlwas the only CRLF text file and is renormalized to LF. With CR ignored, its diff is only the XML declaration line.git ls-files --eolnow reports no CRLF or mixed files.US-ASCIIorISO-8859-1(POMs,src/site/site.xmldescriptors,checkstyle.xml) now declareUTF-8. All ten are pure ASCII, so only the declaration line changes.META-INF/MANIFEST.MF, a stale bnd 1.50 manifest for 1.2.1 that nothing references. The build writes manifests totarget/classes.pom.xml, the only executable file. The Python scripts weren't executable, so nothing else changed..gitignore: five overlappingtargetpatterns become onetarget/.src/site/resources/images/owasp.jpg) is untouched.2. Module descriptors in the sources JARs (
88ffa45)module-info.java.maven-source-pluginpackages the project's compile source roots, andsrc/main/java9was only a root of thecompile-java-9execution.build-helper-maven-plugin3.6.2, pinned inpluginManagement, addssrc/main/java9as a project source root.default-compilenow reads onlysrc/main/java, so the descriptor never reaches Java 8 compilation.compile-java-9is unchanged.module-info.java, in both the build and the reporting configuration.META-INF/versions/9/module-info.class.consumers.py preparenow checks that each sources JAR containsmodule-info.java, its own package's sources, and no class files. All four pass; onmainthe descriptor was missing from all four.3.
UnsupportedContextExceptionserialization (2d709d4)serialvergives-1517019963198920181Lfor every released core from 1.2 through 1.4.0 (1.2, 1.2.1, 1.2.2, 1.2.3, 1.3.0, 1.3.1 and 1.4.0) and for the current class. That value is now declared explicitly.UnsupportedContextExceptionTestpins the value and round-trips an instance.4. Unused test dependencies (
22757e1)javax.servlet:javax.servlet-api(jsp, test scope) andjakarta.servlet:jakarta.servlet-api(jakarta, test scope).dependency:analyzereports both as unused declared dependencies.clean verify, including the parameterized tag contracts, the TLD descriptor tests,ModulePathITand Test every packaged taglib binding through real JSP engines #179's packaged JSP-engine runs.compatibility/dependencies, where the Felix and module-path consumers need them. The optionaljakarta-testapp is unchanged, per the note about not unifying its newer Servlet stack with the library baselines.Intentionally unchanged
ESAPI.enableLegCannonModeAndGetMyAssFired.justification=is left as is. The issue says to correct it only if fixture cleanup needs it, and it's empty and untouched here. Unsafe-method opt-ins stay empty and disabled, astestDelegatedSqlEncodingHonorsEsapiPolicyalready asserts for ESAPI 2.7.Verification
Rebased onto
mainate6bbebe(#179). Locally on JDK 17:mvn clean verify: all modules pass, including Test every packaged taglib binding through real JSP engines #179's Tomcat 9 and Jakarta engine rendering.python3 -m unittest discover -s scripts/tests: 10 tests pass.consumers.py prepare, including the new sources-JAR check: passes.unittest discover -s compatibility/tests: 15 guard tests pass.consumers.py run --runtime 17: all four consumers pass on classpath, module path, and Felix R6 and R8.scripts/check-taglib-parity.py: 34 files pass.This is byte-affecting cleanup, so it should land before the final #103 reproducibility baseline, per the issue.