Skip to content

Commit

Permalink
Build JavaScript projects in parallel from root POM
Browse files Browse the repository at this point in the history
Closes keycloak#35365

Signed-off-by: Jon Koops <[email protected]>
  • Loading branch information
jonkoops committed Nov 29, 2024
1 parent e8e1a5b commit 6a9a29e
Show file tree
Hide file tree
Showing 7 changed files with 225 additions and 208 deletions.
59 changes: 25 additions & 34 deletions js/apps/account-ui/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,21 +54,31 @@
<build>
<plugins>
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<executions>
<execution>
<id>lib-build</id>
<goals>
<goal>pnpm</goal>
</goals>
<configuration>
<arguments>build</arguments>
<environmentVariables>
<LIB>true</LIB>
</environmentVariables>
</configuration>
</execution>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<executions>
<execution>
<id>lib-build</id>
<goals>
<goal>pnpm</goal>
</goals>
<configuration>
<arguments>build</arguments>
<environmentVariables>
<LIB>true</LIB>
</environmentVariables>
</configuration>
</execution>
<execution>
<id>pack</id>
<phase>package</phase>
<goals>
<goal>pnpm</goal>
</goals>
<configuration>
<arguments>pack --pack-destination=target</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
Expand All @@ -82,24 +92,5 @@
<directory>maven-resources</directory>
</resource>
</resources>

<plugins>
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<executions>
<execution>
<id>pack</id>
<phase>package</phase>
<goals>
<goal>pnpm</goal>
</goals>
<configuration>
<arguments>pack --pack-destination=target</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
28 changes: 10 additions & 18 deletions js/apps/admin-ui/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,16 @@
</environmentVariables>
</configuration>
</execution>
<execution>
<id>pack</id>
<phase>package</phase>
<goals>
<goal>pnpm</goal>
</goals>
<configuration>
<arguments>pack --pack-destination=target</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
Expand All @@ -82,23 +92,5 @@
<directory>maven-resources</directory>
</resource>
</resources>
<plugins>
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<executions>
<execution>
<id>pack</id>
<phase>package</phase>
<goals>
<goal>pnpm</goal>
</goals>
<configuration>
<arguments>pack --pack-destination=target</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
78 changes: 44 additions & 34 deletions js/libs/keycloak-admin-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,50 @@
<description>A JavaScript client to interact with Keycloak's Administration API.</description>
<packaging>pom</packaging>

<profiles>
<profile>
<id>jboss-release</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>create-target-dir</id>
<phase>prepare-package</phase>
<configuration>
<target>
<mkdir dir="./target" />
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<executions>
<execution>
<id>pack</id>
<phase>package</phase>
<goals>
<goal>pnpm</goal>
</goals>
<configuration>
<arguments>pack --pack-destination=target</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>

<build>
<plugins>
<plugin>
Expand All @@ -24,40 +68,6 @@
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>create-target-dir</id>
<phase>prepare-package</phase>
<configuration>
<target>
<mkdir dir="./target"/>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<executions>
<execution>
<id>pack</id>
<phase>package</phase>
<goals>
<goal>pnpm</goal>
</goals>
<configuration>
<arguments>pack --pack-destination=target</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
125 changes: 65 additions & 60 deletions js/libs/keycloak-js/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,71 @@
<description>A client-side JavaScript OpenID Connect library that can be used to secure web applications.</description>
<packaging>pom</packaging>

<profiles>
<profile>
<id>jboss-release</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>create-target-dir</id>
<phase>prepare-package</phase>
<configuration>
<target>
<mkdir dir="./target" />
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<executions>
<execution>
<id>pack</id>
<phase>package</phase>
<goals>
<goal>pnpm</goal>
</goals>
<configuration>
<arguments>pack --pack-destination=target</arguments>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<executions>
<execution>
<id>attach-artifacts</id>
<phase>package</phase>
<goals>
<goal>attach-artifact</goal>
</goals>
<configuration>
<artifacts>
<artifact>
<file>target/keycloak-js-${project.version.npm}.tgz</file>
<type>tar.gz</type>
</artifact>
</artifacts>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>

<build>
<plugins>
<plugin>
Expand All @@ -24,66 +89,6 @@
<skip>false</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>create-target-dir</id>
<phase>prepare-package</phase>
<configuration>
<target>
<mkdir dir="./target"/>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<executions>
<execution>
<!-- Skip execution of build with an empty phase. -->
<id>pnpm-build</id>
<phase/>
</execution>
<execution>
<id>pack</id>
<phase>package</phase>
<goals>
<goal>pnpm</goal>
</goals>
<configuration>
<arguments>pack --pack-destination=target</arguments>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<executions>
<execution>
<id>attach-artifacts</id>
<phase>package</phase>
<goals>
<goal>attach-artifact</goal>
</goals>
<configuration>
<artifacts>
<artifact>
<file>target/keycloak-js-${project.version.npm}.tgz</file>
<type>tar.gz</type>
</artifact>
</artifacts>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Loading

0 comments on commit 6a9a29e

Please sign in to comment.