All Downloads are FREE. Search and download functionalities are using the official Maven repository.

archetype-resources.frontend.pom.xml Maven / Gradle / Ivy

The newest version!
<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <parent>
    <groupId>${groupId}</groupId>
    <artifactId>${rootArtifactId}.parent</artifactId>
    <version>${version}</version>
    <relativePath>../parent/pom.xml</relativePath>
  </parent>

  <groupId>${groupId}</groupId>
  <artifactId>${artifactId}</artifactId>
  <version>${version}</version>
  <packaging>pom</packaging>

  <name>${projectName} Frontend</name>

  <properties>
## renovate: datasource=node-version depName=node
    <nodejs.version>v22.11.0</nodejs.version>
  </properties>

  <build>

    <plugins>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-clean-plugin</artifactId>
        <configuration>
          <filesets>
            <fileset>
              <directory>../bundles/core/src/main/webapp/clientlibs-root</directory>
            </fileset>
          </filesets>
        </configuration>
      </plugin>

      <!-- Use NPM and Webpack to build frontend -->
#if ( $optionNodeJsPlugin == "y" )
      <plugin>
        <groupId>io.wcm.maven.plugins</groupId>
        <artifactId>nodejs-maven-plugin</artifactId>
        <executions>
          <execution>
            <phase>compile</phase>
            <goals><goal>run</goal></goals>
          </execution>
        </executions>
        <configuration>
          <nodeJsVersion>${nodejs.version}</nodeJsVersion>
          <tasks>
            <npmInstallTask>
              <workingDirectory>${project.basedir}</workingDirectory>
            </npmInstallTask>
            <nodeJsTask>
              <workingDirectory>${project.basedir}</workingDirectory>
              <moduleName>npm</moduleName>
              <executableName>npm-cli</executableName>
              <arguments>
                <argument>run</argument>
                <argument>build:clientlibs</argument>
              </arguments>
            </nodeJsTask>
          </tasks>
        </configuration>
      </plugin>
#else
      <plugin>
        <groupId>com.github.eirslett</groupId>
        <artifactId>frontend-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>install node and npm</id>
            <goals>
              <goal>install-node-and-npm</goal>
            </goals>
            <phase>process-resources</phase>
            <configuration>
              <nodeVersion>${nodejs.version}</nodeVersion>
            </configuration>
          </execution>
          <execution>
            <id>npm install</id>
            <goals>
              <goal>npm</goal>
            </goals>
            <phase>process-resources</phase>
            <configuration>
              <arguments>install</arguments>
            </configuration>
          </execution>
          <execution>
            <id>npm production</id>
            <goals>
              <goal>npm</goal>
            </goals>
            <phase>process-resources</phase>
            <configuration>
              <arguments>run build:clientlibs</arguments>
            </configuration>
          </execution>
        </executions>
      </plugin>
#end

      <!-- Do not generate eclipse project files -->
      <plugin>
        <groupId>io.wcm.devops.maven.plugins</groupId>
        <artifactId>eclipse-maven-plugin</artifactId>
        <configuration>
          <skip>true</skip>
        </configuration>
      </plugin>

    </plugins>
  </build>

#if ( $optionNodeJsPlugin == "y" && $optionAemVersion == "cloud" )
  <profiles>
    <!-- Profile gets active when building in Cloud Manager -->
    <profile>
      <id>cmBuild</id>
      <activation>
        <property>
          <name>env.CM_BUILD</name>
        </property>
      </activation>

      <!-- Proxy repository to download NodeJS binaries -->
      <repositories>
        <repository>
          <id>maven-nodejs-proxy</id>
          <url>https://maven-nodejs-proxy.pvtool.org/</url>
          <layout>default</layout>
          <releases>
            <enabled>true</enabled>
          </releases>
          <snapshots>
            <enabled>false</enabled>
          </snapshots>
        </repository>
      </repositories>

    </profile>
  </profiles>

#end
</project>




© 2015 - 2025 Weber Informatics LLC | Privacy Policy