You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
product-iots/modules/distribution/pom.xml

546 lines
19 KiB

<?org.wso2.uesxml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
~
~ WSO2 Inc. licenses this file to you under the Apache License,
~ Version 2.0 (the "License"); you may not use this file except
~ in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing,
~ software distributed under the License is distributed on an
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
~ KIND, either express or implied. See the License for the
~ specific language governing permissions and limitations
~ under the License.
-->
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>org.wso2.iot</groupId>
<artifactId>wso2iot-parent</artifactId>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>wso2iot</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>WSO2 IoT Server - Distribution</name>
<description>WSO2 IoT Server Distribution</description>
9 years ago
<modules>
<module>src/statistics/carbonapps</module>
</modules>
<dependencies>
<dependency>
<groupId>com.h2database.wso2</groupId>
<artifactId>h2-database-engine</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>buildnumber-maven-plugin</artifactId>
<version>${maven-buildnumber-plugin.version}</version>
<configuration>
<format>{0,date,dd MMM yyyy}</format>
<items>
<item>timestamp</item>
</items>
<doCheck>false</doCheck>
<doUpdate>false</doUpdate>
</configuration>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>create</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<inherited>false</inherited>
<executions>
<execution>
<id>2-unpack-wso2carbon</id>
<phase>package</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.wso2.carbon</groupId>
<artifactId>wso2carbon-core</artifactId>
<version>${carbon.kernel.version}</version>
<type>zip</type>
<overWrite>true</overWrite>
<outputDirectory>target</outputDirectory>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<!-- Creating Device Management schema -->
<id>create-device-mgt-schema</id>
<phase>package</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<property name="db.dir"
value="target/wso2carbon-core-${carbon.kernel.version}/repository/database"/>
<property name="userid" value="wso2carbon"/>
<property name="password" value="wso2carbon"/>
<property name="dbURL"
value="jdbc:h2:file:${basedir}/${db.dir}/WSO2DM_DB;DB_CLOSE_ON_EXIT=FALSE"/>
<sql driver="org.h2.Driver" url="${dbURL}" userid="${userid}"
password="${password}"
autocommit="true" onerror="continue">
<classpath refid="maven.dependency.classpath"/>
<classpath refid="maven.compile.classpath"/>
<classpath refid="maven.runtime.classpath"/>
<fileset
file="${basedir}/../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/dbscripts/cdm/h2.sql"/>
</sql>
</tasks>
</configuration>
</execution>
<execution>
<!-- Creating API Management schema -->
<id>create-api-mgt-schema</id>
<phase>package</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<property name="db.dir"
value="target/wso2carbon-core-${carbon.kernel.version}/repository/database"/>
<property name="userid" value="wso2carbon"/>
<property name="password" value="wso2carbon"/>
<property name="dbURL"
value="jdbc:h2:file:${basedir}/${db.dir}/WSO2AM_DB;DB_CLOSE_ON_EXIT=FALSE"/>
<sql driver="org.h2.Driver" url="${dbURL}" userid="${userid}"
password="${password}"
autocommit="true" onerror="continue">
<classpath refid="maven.dependency.classpath"/>
<classpath refid="maven.compile.classpath"/>
<classpath refid="maven.runtime.classpath"/>
<fileset
file="${basedir}/../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/dbscripts/apimgt/h2.sql"/>
</sql>
</tasks>
</configuration>
</execution>
<execution>
<id>3-extract-apps-from-components</id>
<phase>package</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<property name="tempdir" value="target/apps-temp"/>
<property name="jardir" value="target/jars"/>
<!--<property name="shindig.version" value="2.5.0-beta5" />-->
<mkdir dir="${tempdir}"/>
<mkdir dir="${tempdir}/wso2iot-${project.version}/repository/components"/>
<mkdir dir="${tempdir}/wso2iot-${project.version}/repository/deployment/server"/>
<mkdir dir="${tempdir}/wso2iot-${project.version}/repository/deployment/server/webapps"/>
<unzip dest="${tempdir}">
<fileset dir="target">
<include name="wso2iot-${project.version}.zip"/>
</fileset>
</unzip>
<copy todir="target/wso2carbon-core-${carbon.kernel.version}/repository/components"
overwrite="true">
<fileset
dir="${tempdir}/wso2iot-${project.version}/repository/components"/>
</copy>
<!--testing -->
<!--<unzip src="target/shindig/WEB-INF/lib/shindig-common-${shindig.version}.jar" dest="${jardir}/shindig-common-${shindig.version}">
<patternset>
<exclude name="**/shindig.properties" />
</patternset>
</unzip>
<copy file="src/repository/conf/shindig.properties" todir="${jardir}/shindig-common-${shindig.version}" />
<delete file="target/shindig/WEB-INF/lib/shindig-common-${shindig.version}.jar" />
<zip destfile="target/shindig/WEB-INF/lib/shindig-common-${shindig.version}.jar" basedir="${jardir}/shindig-common-${shindig.version}" />
<delete>
<fileset dir="target/shindig/WEB-INF/lib" includes="slf4j*" />
</delete>
<copy file="src/repository/resources/shindig/index.jsp" todir="target/shindig" />-->
<concat destfile="target/wso2carbon-core-${carbon.kernel.version}/repository/log4j.properties">
og4j.logger.net.sf.ehcache=ERROR
</concat>
<delete file="target/wso2iot-${project.version}.zip"/>
<!--<delete dir="${tempdir}"/>-->
</tasks>
</configuration>
</execution>
<execution>
<id>copy_modules_apps</id>
<phase>package</phase>
<configuration>
<tasks>
<mkdir dir="target/wso2carbon-core-${carbon.kernel.version}/repository/deployment/server/webapps"/>
<!--Make samples directory for distribution-->
<mkdir dir="target/wso2carbon-core-${carbon.kernel.version}/samples"/>
<mkdir dir="target/wso2carbon-core-${carbon.kernel.version}/statistics"/>
<mkdir dir="target/wso2carbon-core-${carbon.kernel.version}/repository/resources/sketches"/>
<mkdir dir="target/wso2carbon-core-${carbon.kernel.version}/repository/resources/scripts"/>
<mkdir dir="target/wso2carbon-core-${carbon.kernel.version}/repository/components/lib"/>
<!--Copy samples to distribution-->
<copy todir="target/wso2carbon-core-${carbon.kernel.version}/samples"
overwrite="true">
<fileset dir="../samples">
<exclude name="**/*.iml"/>
<exclude name="**/.DS_Store"/>
<exclude name="**/target/"/>
</fileset>
</copy>
<copy todir="target/wso2carbon-core-${carbon.kernel.version}/repository/resources/sketches"
overwrite="true">
<fileset dir="src/sketches"/>
</copy>
<copy todir="target/wso2carbon-core-${carbon.kernel.version}/repository/resources/scripts"
overwrite="true">
<fileset dir="src/scripts"/>
</copy>
<copy todir="target/wso2carbon-core-${carbon.kernel.version}/statistics"
overwrite="true">
<fileset dir="src/statistics/carbonapps">
<exclude name="**/*.iml"/>
<exclude name="**/.DS_Store"/>
<exclude name="**/target/"/>
</fileset>
</copy>
<fileset dir="../samples">
<exclude name="**/*.iml"/>
<exclude name="**/.DS_Store"/>
<exclude name="**/target/"/>
</fileset>
<copy todir="target/wso2carbon-core-${carbon.kernel.version}/repository/components/lib">
<fileset dir="src/lib"/>
</copy>
<copy todir="target/wso2carbon-core-${carbon.kernel.version}/repository/conf/datasources"
overwrite="true">
<fileset dir="src/repository/conf/datasources"/>
<!-- Copy master-datasources.xml and cdm-datasources.xml to target -->
</copy>
<!--<copy todir="target/wso2carbon-core-${carbon.kernel.version}/modules" overwrite="true">
<fileset dir="src/repository/modules"></fileset>
</copy>
<copy todir="target/wso2carbon-core-${carbon.kernel.version}/repository/deployment/server/jaggeryapps" overwrite="true">
<fileset dir="../apps"></fileset>
</copy>
<copy todir="target/wso2carbon-core-${carbon.kernel.version}/repository/components/plugins" overwrite="true">
<fileset dir="src/repository/components/patches/apimgt"></fileset>
</copy>-->
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
<execution>
<id>install_libs</id>
<phase>package</phase>
<configuration>
<tasks>
<echo message="Downloading lib source...." />
<mkdir dir="target/libs-temp"/>
<exec dir="target/libs-temp" executable="sh">
<arg line="-c 'svn checkout https://github.com/wso2-incubator/iot-server-appliances/trunk/org.wso2.carbon.devicemgt.grant --non-interactive --trust-server-cert'" />
</exec>
<echo message="building libraries from source" />
<exec dir="target/libs-temp/org.wso2.carbon.devicemgt.grant" executable="sh">
<arg line="-c 'mvn clean install'" />
</exec>
<copy todir="target/wso2carbon-core-${carbon.kernel.version}/repository/components/lib/"
overwrite="true">
<fileset
dir="target/libs-temp/org.wso2.carbon.devicemgt.grant/target/" includes="*.jar"/>
</copy>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
<execution>
<id>clean_target</id>
<phase>install</phase>
<configuration>
<!--<tasks>-->
<!--<delete dir="target/jars"/>-->
<!--<delete dir="target/*.xml"/>-->
<!--<delete dir="target/archive-tmp"/>-->
<!--<delete dir="target/dependency-maven-plugin-markers"/>-->
<!--<delete dir="target/maven-archiver"/>-->
<!--<delete dir="target/wso2carbon-core-${carbon.kernel.version}"/>-->
<!--<delete file="target/wso2iot-${project.version}.jar"/>-->
<!--<delete dir="target/sources"/>-->
<!--<delete dir="target/site"/>-->
<!--<delete dir="target/shindig" />-->
<!--<delete dir="target/jaxwebapps"/>-->
<!--</tasks>-->
<tasks>
<delete dir="target/archive-tmp"/>
<delete dir="target/dependency-maven-plugin-markers"/>
<delete dir="target/maven-archiver"/>
<delete dir="target/wso2carbon-core-${carbon.platform.version}"/>
<delete dir="target/sources"/>
<delete dir="target/site"/>
<delete dir="src/site"/>
<delete dir="target/antrun"/>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<!--<version>2.5.2</version>-->
<executions>
<execution>
<id>1-pre-dist</id>
<phase>test</phase>
<!--we are creating a temporary carbon distribution for document extracting purposes during the test phase-->
<goals>
<goal>attached</goal>
</goals>
<configuration>
<appendAssemblyId>false</appendAssemblyId>
<filters>
<filter>${basedir}/src/assembly/filter.properties</filter>
</filters>
<descriptors>
<descriptor>${basedir}/src/assembly/dist.xml</descriptor>
</descriptors>
</configuration>
</execution>
<execution>
<id>2-dist</id>
<phase>package</phase>
<goals>
<goal>attached</goal>
</goals>
<configuration>
<appendAssemblyId>false</appendAssemblyId>
<filters>
<filter>${basedir}/src/assembly/filter.properties</filter>
</filters>
<descriptors>
<descriptor>${basedir}/src/assembly/bin.xml</descriptor>
</descriptors>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.google.code.maven-replacer-plugin</groupId>
<artifactId>replacer</artifactId>
<version>1.5.2</version>
<executions>
<!-- Replace Datasource, Scope mpl classes and OAuth callback class in identity.xml -->
<execution>
<id>replace-for-identity</id>
<phase>prepare-package</phase>
<goals>
<goal>replace</goal>
</goals>
<configuration>
<file>${basedir}/../p2-profile-gen/target/wso2carbon-core-${carbon.platform.version}/repository/conf/identity/identity.xml</file>
<replacements>
<replacement>
<xpath>/Server/JDBCPersistenceManager/DataSource/Name</xpath>
<token>(jdbc/WSO2CarbonDB)</token>
<value>jdbc/WSO2AM_DB</value>
</replacement>
<replacement>
<xpath>/Server/OAuth/SupportedGrantTypes/SupportedGrantType</xpath>
<token>(org.wso2.carbon.identity.oauth2.token.handlers.grant.AuthorizationCodeGrantHandler)</token>
<value>org.wso2.carbon.apimgt.keymgt.handlers.ExtendedAuthorizationCodeGrantHandler</value>
</replacement>
<replacement>
<xpath>/Server/OAuth/SupportedGrantTypes/SupportedGrantType</xpath>
<token>(org.wso2.carbon.identity.oauth2.token.handlers.grant.PasswordGrantHandler)</token>
<value>org.wso2.carbon.apimgt.keymgt.handlers.ExtendedPasswordGrantHandler</value>
</replacement>
<replacement>
<xpath>/Server/OAuth/SupportedGrantTypes/SupportedGrantType</xpath>
<token>(org.wso2.carbon.identity.oauth2.token.handlers.grant.ClientCredentialsGrantHandler)</token>
<value>org.wso2.carbon.apimgt.keymgt.handlers.ExtendedClientCredentialsGrantHandler</value>
</replacement>
<replacement>
<xpath>/Server/OAuth/SupportedGrantTypes/SupportedGrantType</xpath>
<token>(org.wso2.carbon.identity.oauth2.token.handlers.grant.saml.SAML2BearerGrantHandler)</token>
<value>org.wso2.carbon.apimgt.keymgt.handlers.ExtendedSAML2BearerGrantHandler</value>
</replacement>
<replacement>
<xpath>/Server/OAuth/OAuthCallbackHandlers</xpath>
<token>(org.wso2.carbon.identity.oauth.callback.DefaultCallbackHandler)</token>
<value>org.wso2.carbon.apimgt.keymgt.util.APIManagerOAuthCallbackHandler</value>
</replacement>
</replacements>
</configuration>
</execution>
<!-- Replace the Datasource in the thrift-authentication.xml file -->
<execution>
<id>replace-for-thrift</id>
<phase>prepare-package</phase>
<goals>
<goal>replace</goal>
</goals>
<configuration>
<file>${basedir}/../p2-profile-gen/target/wso2carbon-core-${carbon.platform.version}/repository/conf/identity/thrift-authentication.xml</file>
<replacements>
<replacement>
<xpath>/Server/JDBCPersistenceManager/DataSource/Name</xpath>
<token>(jdbc/WSO2CarbonDB)</token>
<value>jdbc/WSO2AM_DB</value>
</replacement>
</replacements>
</configuration>
</execution>
<execution>
<id>replace-for-api-publisher</id>
<phase>prepare-package</phase>
<goals>
<goal>replace</goal>
</goals>
<configuration>
<file>${basedir}/../p2-profile-gen/target/wso2carbon-core-${carbon.platform.version}/repository/deployment/server/jaggeryapps/api-publisher/site/conf/site.json</file>
<replacements>
<replacement>
<token>(/publisher)</token>
<value>/api-publisher</value>
</replacement>
</replacements>
</configuration>
</execution>
<execution>
<id>replace-for-api-store</id>
<phase>prepare-package</phase>
<goals>
<goal>replace</goal>
</goals>
<configuration>
<file>${basedir}/../p2-profile-gen/target/wso2carbon-core-${carbon.platform.version}/repository/deployment/server/jaggeryapps/api-store/site/conf/site.json</file>
<replacements>
<replacement>
<token>(/store)</token>
<value>/api-store</value>
</replacement>
</replacements>
</configuration>
</execution>
</executions>
</plugin>
<!-- Add the scope validator to the identity.xml file -->
<plugin>
<groupId>com.google.code.maven-config-processor-plugin</groupId>
<artifactId>config-processor-maven-plugin</artifactId>
<version>2.6</version>
<executions>
<execution>
<id>add-scope-validator</id>
<phase>prepare-package</phase>
<goals>
<goal>process</goal>
</goals>
<configuration>
<failOnMissingXpath>false</failOnMissingXpath>
<transformations>
<transformation>
<input>${basedir}/../p2-profile-gen/target/wso2carbon-core-${carbon.platform.version}/repository/conf/identity/identity.xml</input>
<output>../../p2-profile-gen/target/wso2carbon-core-${carbon.platform.version}/repository/conf/identity/identity.xml</output>
<config>identity_config_change.xml</config>
</transformation>
</transformations>
<namespaceContexts>
<s>http://wso2.org/projects/carbon/carbon.xml</s>
</namespaceContexts>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<executions>
<execution>
<id>auto-clean</id>
<phase>initialize</phase>
<goals>
<goal>clean</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>