+

In 2021 I worked in a small team of students on an old fashioned Java swing application. To design our forms rather fast, we chose to opt for the IJ-GUI designer.

+

That was a rather annoying mistake, trying to package that thing just hours before the deadline. +We then opted to just let IntelliJ compile the .forms into .java directly, which then cluttered our version control.

+

So today I present you a minimal pom.xml compiling forms on the fly. A complete minimal working example can be found on my private git: git.tobiasmanske.de

+
+ +
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+
+
<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <groupId>de.tobiasmanske</groupId>
+  <artifactId>example</artifactId>
+  <version>1.0-SNAPSHOT</version>
+
+  <properties>
+    <maven.compiler.source>11</maven.compiler.source>
+    <maven.compiler.target>11</maven.compiler.target>
+    <intellij.version>203.7148.57</intellij.version>
+  </properties>
+
+  <repositories>
+    <repository>
+      <id>jetbrains.releases</id>
+      <url>https://www.jetbrains.com/intellij-repository/releases</url>
+    </repository>
+    <repository>
+      <id>jetbrains.3rdparty</id>
+      <url>https://dl.bintray.com/jetbrains/intellij-third-party-dependencies</url>
+    </repository>
+  </repositories>
+
+  <build>
+    <plugins>
+      <plugin>
+        <artifactId>maven-antrun-plugin</artifactId>
+        <version>3.0.0</version>
+        <executions>
+          <execution>
+            <phase>compile</phase>
+            <configuration>
+              <target>
+                <property name="compile_classpath" refid="maven.runtime.classpath"/>
+                <path id="j2cp">
+                  <pathelement path="${compile_classpath}"/>
+                </path>
+                <path id="j2sp">
+                  <pathelement location="${project.basedir}/src/main/java"/>
+                </path>
+                <taskdef name="javac2" classpathref="j2cp" classname="com.intellij.ant.Javac2"/>
+                <javac2 destdir="${project.basedir}/target/classes">
+                  <classpath refid="j2cp"/>
+                  <src refid="j2sp"/>
+                </javac2>
+              </target>
+            </configuration>
+            <goals>
+              <goal>run</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+  <dependencies>
+    <dependency>
+      <groupId>com.jetbrains.intellij.java</groupId>
+      <artifactId>java-gui-forms-rt</artifactId>
+      <version>${intellij.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>com.jetbrains.intellij.java</groupId>
+      <artifactId>java-compiler-ant-tasks</artifactId>
+      <version>${intellij.version}</version>
+    </dependency>
+  </dependencies>
+</project>
+
+
+

That’s all for today, I hope this helped you, so that you don’t struggle with it for as long.

+ +