Skip to content

Migrate build system from Ant to Maven (Phase 2: Maven Central deps) #19

Description

@JDziurlaj

Migrate build system from Ant to Maven

Background

The project currently uses Apache Ant (build.xml) for compilation and packaging. Moving to Maven will enable:

  • Automatic dependency resolution from Maven Central (replacing the checked-in JARs in lib/)
  • Standard lifecycle management (mvn clean package, mvn install, etc.)
  • IDE integration (IntelliJ, Eclipse, VS Code) via standard pom.xml
  • Reproducible builds without vendored binaries
  • Easy dependency-version upgrades

Ant target → Maven lifecycle mapping

Ant target Maven equivalent
build (default) mvn package
buildFiles (javac, debug) mvn compile via maven-compiler-plugin
buildReleaseFiles (javac, optimised) Maven profile release with <optimize> flag (deprecated in javac 9+; omit)
jar (copy resources + JAR) mvn package via maven-jar-plugin + maven-resources-plugin
createBuildFolder / removeBuildFolder mvn clean via maven-clean-plugin
run mvn exec:java via exec-maven-plugin
zip mvn package -P zip via maven-assembly-plugin
exe (launch4j Windows exe) launch4j-maven-plugin
createInstaller / runInstallJammer No direct Maven equivalent; InstallJammer is abandoned — replace with izpack-maven-plugin or distribute the ZIP only
uploadToGoogleDownloads Obsolete (Google Code shut down) — remove

Dependency analysis

Available on Maven Central

All coordinates below can be used directly in <dependencies>:

lib/ JAR groupId artifactId version Notes
xercesImpl.jar xerces xercesImpl 2.12.2 Upgrade; bundled ver has Spec-Version 1.2 (Xerces2-J 2.x)
xml-apis.jar xml-apis xml-apis 1.4.01
jaxp.jar built into JDK javax.xml.* is in the JDK since Java 1.4; remove
avalon-framework.jar avalon-framework avalon-framework 4.1.5
jaxen-1.1.1.jar jaxen jaxen 1.1.1
castor.jar org.codehaus.castor castor 0.9.4.3 Very old; consider castor-xml 1.4.1
dom4j.jar dom4j dom4j 1.6.1
jcalendar.jar com.toedter jcalendar 1.3.2
batik-awt-util.jar org.apache.xmlgraphics batik-awt-util 1.6 Full batik suite at this groupId
batik-bridge.jar org.apache.xmlgraphics batik-bridge 1.6
batik-css.jar org.apache.xmlgraphics batik-css 1.6
batik-dom.jar org.apache.xmlgraphics batik-dom 1.6
batik-ext.jar org.apache.xmlgraphics batik-ext 1.6
batik-extension.jar org.apache.xmlgraphics batik-extension 1.6
batik-gui-util.jar org.apache.xmlgraphics batik-gui-util 1.6
batik-gvt.jar org.apache.xmlgraphics batik-gvt 1.6
batik-parser.jar org.apache.xmlgraphics batik-parser 1.6
batik-rasterizer.jar org.apache.xmlgraphics batik-rasterizer 1.6
batik-script.jar org.apache.xmlgraphics batik-script 1.6
batik-squiggle.jar org.apache.xmlgraphics batik-squiggle 1.6
batik-svg-dom.jar org.apache.xmlgraphics batik-svg-dom 1.6
batik-svggen.jar org.apache.xmlgraphics batik-svggen 1.6
batik-swing.jar org.apache.xmlgraphics batik-swing 1.6
batik-transcoder.jar org.apache.xmlgraphics batik-transcoder 1.6 Also covers pdf-transcoder.jar
batik-util.jar org.apache.xmlgraphics batik-util 1.6
batik-xml.jar org.apache.xmlgraphics batik-xml 1.6
batik.jar org.apache.xmlgraphics batik-all 1.6 Aggregate; may replace individual batik-*
serializer.jar xalan serializer 2.7.2
fop.jar fop fop 0.20.5
jing.jar com.thaiopensource jing 20091111
trang.jar com.thaiopensource trang 20091111
saxon9he.jar net.sf.saxon Saxon-HE 9.9.1-8 Exact bundled ver unknown; 9.x series
bsf.jar bsf bsf 2.4.0
resolver.jar xml-resolver xml-resolver 1.2
xalan.jar xalan xalan 2.7.2
xsltc.jar xalan xalan 2.7.2 Bundled inside xalan; no separate artifact needed
saxon.jar net.sourceforge.saxon saxon 6.5.5 Very old XSLT 1.0 processor
mail.jar javax.mail mail 1.4.7 Or com.sun.mail:javax.mail:1.6.2
activation.jar javax.activation activation 1.1.1
js.jar rhino js 1.7R2 Or org.mozilla:rhino:1.7.14
saaj-api.jar javax.xml.soap javax.xml.soap-api 1.3.5
saaj-impl.jar com.sun.xml.messaging.saaj saaj-impl 1.3.28
xmlsec.jar xml-security xmlsec 1.1.0 Or org.apache.santuario:xmlsec:3.0.3
wsdl4j.jar wsdl4j wsdl4j 1.6.3
commons-logging.jar commons-logging commons-logging 1.1
commons.jar commons-cli commons-cli 1.0 Contains org.apache.commons.cli.*
commons-net.jar commons-net commons-net 1.4.1
commons-httpclient.jar commons-httpclient commons-httpclient 3.0.1
jakarta-slide-webdav.jar slide slide-webdavlib 2.1 Project is retired
nekohtml.jar net.sourceforge.nekohtml nekohtml 0.9.5
poi.jar poi poi 2.5.1
xbean.jar org.apache.xmlbeans xmlbeans 2.0.0
xbean_xpath.jar org.apache.xmlbeans xmlbeans-xpath 2.0.0
looks-1.3rc.jar com.jgoodies looks 1.3.1 Use looks.jar (2.1.3) instead
looks.jar com.jgoodies looks 2.1.3
l2fprod-common-directorychooser.jar com.l2fprod l2fprod-common-directorychooser 7.3
l2fprod-common-totd.jar com.l2fprod l2fprod-common-totd 7.3
rome-0.9.jar rome rome 0.9
rome-fetcher-0.9.jar rome rome-fetcher 0.9
jdom.jar jdom jdom 1.0
isorelax.jar isorelax isorelax 20030108
soap.jar soap soap 2.3.1 Apache SOAP
jh.jar javax.help javahelp 2.0.05
kunststoff.jar com.incors.plaf kunststoff 2.0.2

Not on Maven Central — requires manual handling

lib/ JAR Package Recommendation
bounce.jar org.bounce.* Not published to Maven Central. Keep as system scope or install to local repo. See https://bounce.sourceforge.net/
MDateSelector.jar mseries.ui.* Not published. Keep as system scope or install to local repo
AppleJavaExtensions.jar com.apple.* Apple stub library for non-Mac compiles. Available as com.apple:AppleJavaExtensions:1.4 on some mirrors; otherwise use system scope. Only needed on non-macOS builds
jdic.jar org.jdesktop.jdic.* JDIC project is abandoned. Keep as system scope or remove if functionality unused
jisp.jar com.coyotegulch.jisp.* Not published. Keep as system scope
JbcGrid.jar Not present in lib/ — referenced in build.xml but missing. Remove from dependency list
JbcBeansEvaluation.jar Not present in lib/ — referenced in build.xml but missing. Remove from dependency list

Implementation tasks

  1. Create pom.xml with:

    • Java 8 source/target (or higher — verify compatibility)
    • All Maven Central dependencies above
    • system-scope entries for the 5 JARs not on Maven Central
    • maven-compiler-plugin for buildFiles / buildReleaseFiles
    • maven-jar-plugin with the Manifest.mf main class and Class-Path
    • maven-resources-plugin to copy icon/resource directories (currently done in the jar Ant target)
    • maven-assembly-plugin for the zip target (binary distribution)
    • launch4j-maven-plugin for the exe target (Windows executable)
    • exec-maven-plugin for the run target
    • Remove uploadToGoogleDownloads target (Google Code is shut down)
    • Remove createInstaller / runInstallJammer targets (InstallJammer is abandoned)
  2. Install non-Central JARs to the project's local file-based Maven repository (mvn install:install-file) or use system scope with path relative to ${project.basedir}/lib/.

  3. Verify compile with mvn compile

  4. Verify package with mvn package — should produce xngr-editor.jar

  5. Verify assembly — test maven-assembly-plugin produces the ZIP distribution

  6. Remove lib/ from VCS once all resolvable dependencies are declared in pom.xml (or add the 5 non-Central JARs to a lib/ sub-repo and keep only those)


Notes

  • The Batik 1.6 JARs bundled in lib/ had corrupted MANIFEST.MF Class-Path entries (Windows-style \ continuations) that break Java 9+. The Maven Central artifacts for Batik 1.6 do not have this bug.
  • looks-1.3rc.jar and looks.jar are both present; only looks.jar (2.1.3) should be kept.
  • jaxp.jar (version 1.1) is entirely superseded by the JDK and can be dropped.
  • Two JARs (JbcGrid.jar, JbcBeansEvaluation.jar) are referenced in build.xml but are not present in lib/ — the build still succeeds, so these references should simply be removed from the pom.xml.
  • Consider upgrading old dependencies (Batik 1.6 → 1.17, FOP 0.20.5 → 2.9, POI 2.5 → 5.x, etc.) in a follow-up PR once the Maven migration is stable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions