Skip to content

Commit

Permalink
XWIKI-12788: Introduce skin extension plugins for webjar resources
Browse files Browse the repository at this point in the history
  • Loading branch information
manuelleduc committed Feb 2, 2024
1 parent af6b5ab commit d589b50
Show file tree
Hide file tree
Showing 6 changed files with 649 additions and 269 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
<?xml version="1.0" encoding="UTF-8"?>

<!--
* See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-->

<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>
<parent>
<groupId>org.xwiki.platform</groupId>
<artifactId>xwiki-platform-notifications</artifactId>
<version>16.1.0-SNAPSHOT</version>
</parent>
<packaging>webjar</packaging>
<artifactId>xwiki-platform-notifications-webjar</artifactId>
<name>XWiki Platform - Notifications - WebJar</name>
<properties>
<!-- Name to display by the Extension Manager -->
<xwiki.extension.name>Notifications WebJar</xwiki.extension.name>
<!-- Vite is already taking care of minification and bundling in an efficient way. -->
<xwiki.minification.skip>true</xwiki.minification.skip>
</properties>
<dependencies>
<dependency>
<groupId>org.webjars.npm</groupId>
<artifactId>vue</artifactId>
<version>2.7.16</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.xwiki.platform</groupId>
<artifactId>xwiki-platform-livedata-webjar</artifactId>
<version>${project.version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>jquery</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>bootstrap-switch</artifactId>
<scope>runtime</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<executions>
<execution>
<id>copy-vue-resources</id>
<phase>validate</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/vue</outputDirectory>
<resources>
<resource>
<directory>src/main/vue</directory>
</resource>
</resources>
</configuration>
</execution>
<execution>
<!-- Copy the generated Vue components to the WebJar folder. -->
<id>copy-vue-components</id>
<phase>process-resources</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.build.outputDirectory}/META-INF/resources/webjars/${project.artifactId}/${project.version}</outputDirectory>
<resources>
<resource>
<directory>${project.build.directory}/vue/dist</directory>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<!-- Skip jsHint because we use ESLint through the frontend-maven-plugin -->
<plugin>
<groupId>org.xwiki.contrib</groupId>
<artifactId>jshint-maven-plugin</artifactId>
<executions>
<execution>
<id>default-lint</id>
<phase>none</phase>
</execution>
</executions>
</plugin>
<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>
<configuration>
<nodeVersion>v20.11.0</nodeVersion>
<npmVersion>10.3.0</npmVersion>
</configuration>
</execution>
<execution>
<id>npm-install</id>
<goals>
<goal>npm</goal>
</goals>
<configuration>
<arguments>ci</arguments>
</configuration>
</execution>
<execution>
<id>npm-run-build</id>
<goals>
<goal>npm</goal>
</goals>
<configuration>
<arguments>run build</arguments>
</configuration>
</execution>
<execution>
<id>npm-run-lint</id>
<goals>
<goal>npm</goal>
</goals>
<configuration>
<arguments>run lint</arguments>
</configuration>
<phase>test</phase>
</execution>
</executions>
<configuration>
<workingDirectory>${project.build.directory}/vue</workingDirectory>
</configuration>
</plugin>
</plugins>
</build>
</project>
Loading

0 comments on commit d589b50

Please sign in to comment.