Use IntelliJ's Swing Designer in Maven

Just a configuration that enables using IntelliJ's Swing in Maven

Recently, I’ve been working on several projects related to Java Swing and Maven, so I tried many tools from popular IDEs to create the Forms & Dialogs.

My favorite was IntelliJ’s Swing Designer because:

  • I mainly use IntelliJ in most of my projects
  • The editor is pretty clean and not too bloated for my workspace
  • The structure has clear separation between code and design (Only provide components variables when needed)

However, the biggest problem was that there was no clear & official tool or tutorial to integrate the forms into my Maven projects.

Then, I found a blog from Tobias Manske on the configuration. You can check it here.

It worked in my case, but I had to run the forms in IntelliJ to get them compiled before running the Maven actions. It means that I still couldn’t use it in a continuous integration (CI) like Github Actions.

So then I dug around the Ant plugin. Finally, it works perfectly now.

Here is my minimal configuration:


<?xml version="1.0" encoding="UTF-8"?>
<project xmlns=""




                                <property name="build.compiler" value="extJavac"/>
                                <path id="j2sp">
                                    <pathelement location="${project.basedir}/src/main/java"/>
                                <taskdef name="javac2" classpathref="maven.compile.classpath" classname="com.intellij.ant.Javac2"/>
                                <javac2 destdir="${project.basedir}/target/classes">
                                    <src refid="j2sp"/>
                                        <path refid="maven.plugin.classpath"/>
                                        <path refid="maven.compile.classpath"/>
                                        <path refid="maven.runtime.classpath"/>