_CORE
AI & Agentic Systems Core Information Systems Cloud & Platform Engineering Data Platform & Integration Security & Compliance QA, Testing & Observability IoT, Automation & Robotics Mobile & Digital Banking & Finance Insurance Public Administration Defense & Security Healthcare Energy & Utilities Telco & Media Manufacturing Logistics & E-commerce Retail & Loyalty
References Technologies Blog Know-how Tools
About Collaboration Careers
CS EN
Let's talk

From Ant to Maven — a build system migration story

22. 02. 2011 2 min read CORE SYSTEMSdevelopment

Apache Ant has served us since the company’s founding. Every project had its own build.xml, carefully maintained by hand, with dozens of targets. With fifteen active projects and six developers it became unmanageable. A new person would spend their entire first day just understanding the build process.

Why Maven and not Gradle?

Gradle exists in 2011, but it is relatively young and almost nobody uses it in the enterprise Java world. Maven 3 is stable, has a huge plugin ecosystem and most IDEs support it out of the box. Convention over configuration is exactly what we need. The standard directory structure (src/main/java, src/test/java) means every developer immediately knows where to find things.

Migration strategy

Migrating all fifteen projects at once would have been madness. We chose a gradual approach: first the company Nexus repository, then shared libraries, smaller projects and finally the large multi-module projects. The entire migration took three months.

Nexus as the company repository

Nexus OSS is the foundation of the entire ecosystem. It acts as a proxy for Maven Central, hosts our internal artifacts and enables staging for the release process. The configuration proxies Maven Central, the JBoss repository and the Oracle Maven repository for JDBC drivers.

The biggest problems

Transitive dependencies. When you add one dependency, Maven automatically downloads all of its dependencies. Result? A WAR file with 200 JARs, some of which conflict. Solution: mvn dependency:tree and liberal use of exclusions. We created a company parent POM with a dependencyManagement section.

Oracle JDBC driver. ojdbc6.jar is not in Maven Central due to licensing restrictions. We had to upload it manually to Nexus.

Multi-module projects

Our largest application had in Ant a single enormous build.xml with 2000 lines. In Maven we split it into modules: core, persistence, service, web, ear. Building the entire project: mvn clean package. Seven minutes including tests. With Ant it was fifteen minutes.

Conclusion

Migrating from Ant to Maven is an investment that pays off within months. A standardized build process, automatic dependency management and integration with the CI server dramatically accelerated our development cycle.

mavenantbuildjava
Share:

CORE SYSTEMS

Stavíme core systémy a AI agenty, které drží provoz. 15 let zkušeností s enterprise IT.

Need help with implementation?

Our experts can help with design, implementation, and operations. From architecture to production.

Contact us