Carbon UUF Maven Plugin project provides a maven plugin for creating UUF Applications and UUF Components of the Unified UI Framework(UUF).
Carbon UUF Maven Plugin tries to reusing the existing maven plugins where as possible(i.e.Maven-Assembly-Plugin, Maven-Dependency-Plugin). This plugin provides two maven goals;
- create-component : This goal is used for creating UUF Component.
- create-application : This goal is used for creating UUF Application.
A client maven module which needs to create a UUF application and/or component should add the plugin dependency into project pom.xml file.
<plugin>
<groupId>org.wso2.carbon.maven</groupId>
<artifactId>carbon-uuf-maven-plugin</artifactId>
<version>1.0.0-SNAPSHOT</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>create-component</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.wso2.carbon.maven</groupId>
<artifactId>carbon-uuf-maven-plugin</artifactId>
<version>1.0.0-SNAPSHOT</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>create-theme</goal>
</goals>
</execution>
</executions>
</plugin>
This is the way of creating the UUF application. All the Pages
and Fragments
of the current Application will be moved into a component called "root" inside the "/components" folder.
<build>
<plugins>
<plugin>
<groupId>org.wso2.carbon.maven</groupId>
<artifactId>carbon-uuf-maven-plugin</artifactId>
<version>1.0.0-SNAPSHOT</version>
<executions>
<execution>
<id>create</id>
<phase>package</phase>
<goals>
<goal>create-application</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
Following UUF Application reuses the UUF components "base"(org.wso2.uuf.base) and "basicauth"(org.wso2.is.uuf.basicauth) and utilize the theme "dark"(org.wso2.uuf.theme.dark).
<dependencies>
<!-- themes -->
<dependency>
<groupId>org.wso2.uuf</groupId>
<artifactId>org.wso2.uuf.theme.dark</artifactId>
<version>1.0.0-SNAPSHOT</version>
<type>zip</type>
</dependency>
<!-- components -->
<dependency>
<groupId>org.wso2.uuf</groupId>
<artifactId>org.wso2.uuf.base</artifactId>
<version>1.0.0-SNAPSHOT</version>
<type>zip</type>
</dependency>
<dependency>
<groupId>org.wso2.is</groupId>
<artifactId>org.wso2.is.uuf.basicauth</artifactId>
<version>1.0.0-SNAPSHOT</version>
<type>zip</type>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.wso2.carbon.maven</groupId>
<artifactId>carbon-uuf-maven-plugin</artifactId>
<version>1.0.0-SNAPSHOT</version>
<executions>
<execution>
<id>create</id>
<phase>package</phase>
<goals>
<goal>create-application</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
Following UUF Application reuses the UUF Application "pets-store"(org.wso2.uuf.sample.pets-store). In this case, the "root" components of the both applications are merged. When a duplicate occurs target application receives the priority.
<dependencies>
<dependency>
<groupId>org.wso2.uuf.sample</groupId>
<artifactId>org.wso2.uuf.sample.pets-store</artifactId>
<version>1.0.0-SNAPSHOT</version>
<type>zip</type>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.wso2.carbon.maven</groupId>
<artifactId>carbon-uuf-maven-plugin</artifactId>
<version>1.0.0-SNAPSHOT</version>
<executions>
<execution>
<id>create</id>
<phase>package</phase>
<goals>
<goal>create-application</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
If you are using Java classes exported by other OSGi bundles inside your JavaScript files, you need to explicitly mention the package imports inorder to minimize classloading complexisities. For instance;
<properties>
<import.package>
org.wso2.carbon.uuf.*;version=[1.0.0,2.0.0],
org.wso2.msf4j
</import.package>
</properties>
Use Maven snippet:
<dependency>
<groupId>org.wso2.carbon.maven</groupId>
<artifactId>carbon-uuf-maven-plugin</artifactId>
<version>${carbon-uuf-maven-plugin.version}</version>
</dependency>
Use following Maven repository for snapshot versions of Carbon Maven UUF Plugin.
<repository>
<id>wso2.snapshots</id>
<name>WSO2 Snapshot Repository</name>
<url>http://maven.wso2.org/nexus/content/repositories/snapshots/</url>
<snapshots>
<enabled>true</enabled>
<updatePolicy>daily</updatePolicy>
</snapshots>
<releases>
<enabled>false</enabled>
</releases>
</repository>
Use following Maven repository for released stable versions of Carbon Maven UUF Plugin.
<repository>
<id>wso2.releases</id>
<name>WSO2 Releases Repository</name>
<url>http://maven.wso2.org/nexus/content/repositories/releases/</url>
<releases>
<enabled>true</enabled>
<updatePolicy>daily</updatePolicy>
<checksumPolicy>ignore</checksumPolicy>
</releases>
</repository>
Clone this repository first (git clone https://github.com/wso2/carbon-uuf-maven-plugin.git
) and use Maven install to build mvn clean install
.
Pull requests are highly encouraged and we recommend you to create a GitHub issue to discuss the issue or feature that you are contributing to.
Carbon Maven UUF Plugin is available under the Apache 2 License.
Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.