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 <jonkoops@gmail.com>
  • Loading branch information
jonkoops committed Dec 4, 2024
1 parent e488f34 commit e865e74
Show file tree
Hide file tree
Showing 7 changed files with 76 additions and 40 deletions.
6 changes: 4 additions & 2 deletions js/apps/account-ui/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,10 @@
</resources>
<plugins>
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<artifactId>maven-clean-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>
Expand Down
6 changes: 4 additions & 2 deletions js/apps/admin-ui/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,10 @@
</resources>
<plugins>
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<artifactId>maven-clean-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>
Expand Down
5 changes: 0 additions & 5 deletions js/libs/keycloak-js/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,6 @@
<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>pnpm-pack</id>
<phase>package</phase>
Expand Down
12 changes: 11 additions & 1 deletion js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,17 @@
"type": "module",
"packageManager": "pnpm@9.14.4+sha512.c8180b3fbe4e4bca02c94234717896b5529740a6cbadf19fa78254270403ea2f27d4e1d46a08a0f56c89b63dc8ebfd3ee53326da720273794e6200fcf0d184ab",
"scripts": {
"prepare": "cd .. && husky js/.husky"
"prepare": "cd .. && husky js/.husky",
"build": "wireit"
},
"wireit": {
"build": {
"dependencies": [
"./apps/account-ui:build",
"./apps/admin-ui:build",
"./themes-vendor:build"
]
}
},
"devDependencies": {
"@eslint/compat": "^1.2.3",
Expand Down
77 changes: 51 additions & 26 deletions js/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,32 +38,6 @@
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>${frontend.plugin.version}</version>
<executions>
<execution>
<goals>
<goal>install-node-and-pnpm</goal>
</goals>
</execution>
<execution>
<id>pnpm-install</id>
<goals>
<goal>pnpm</goal>
</goals>
<configuration>
<arguments>install --prefer-offline --frozen-lockfile --ignore-scripts</arguments>
<workingDirectory>${maven.multiModuleProjectDirectory}/js</workingDirectory>
</configuration>
</execution>
<execution>
<id>pnpm-build</id>
<goals>
<goal>pnpm</goal>
</goals>
<configuration>
<arguments>build</arguments>
</configuration>
</execution>
</executions>
<configuration>
<nodeVersion>${node.version}</nodeVersion>
<pnpmVersion>${pnpm.version}</pnpmVersion>
Expand All @@ -73,5 +47,56 @@
</plugin>
</plugins>
</pluginManagement>

<plugins>
<plugin>
<!-- Clean child modules from parent, as we trigger the build here for parallelization. -->
<artifactId>maven-clean-plugin</artifactId>
<configuration>
<filesets>
<fileset>
<directory>apps/account-ui/target</directory>
</fileset>
<fileset>
<directory>apps/admin-ui/target</directory>
</fileset>
<fileset>
<directory>themes-vendor/target</directory>
</fileset>
</filesets>
</configuration>
</plugin>
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>${frontend.plugin.version}</version>
<inherited>false</inherited>
<executions>
<execution>
<goals>
<goal>install-node-and-pnpm</goal>
</goals>
</execution>
<execution>
<id>pnpm-install</id>
<goals>
<goal>pnpm</goal>
</goals>
<configuration>
<arguments>install --prefer-offline --frozen-lockfile --ignore-scripts</arguments>
</configuration>
</execution>
<execution>
<id>pnpm-build</id>
<goals>
<goal>pnpm</goal>
</goals>
<configuration>
<arguments>build</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
6 changes: 4 additions & 2 deletions js/themes-vendor/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@
<build>
<plugins>
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<artifactId>maven-clean-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@
<wildfly.plugin.version>5.0.0.Final</wildfly.plugin.version>
<nexus.staging.plugin.version>1.6.13</nexus.staging.plugin.version>
<nexus3.staging.plugin.version>1.0.7</nexus3.staging.plugin.version>
<frontend.plugin.version>1.15.0</frontend.plugin.version>
<frontend.plugin.version>1.15.1</frontend.plugin.version>
<docker.maven.plugin.version>0.40.3</docker.maven.plugin.version>
<verifier.plugin.version>1.1</verifier.plugin.version>
<shade.plugin.version>3.4.1</shade.plugin.version>
Expand Down Expand Up @@ -1035,7 +1035,7 @@
<version>${project.version}</version>
<type>zip</type>
</dependency>
<dependency>
<dependency>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-saml-wildfly-subsystem</artifactId>
<version>${project.version}</version>
Expand Down

0 comments on commit e865e74

Please sign in to comment.