entaxy-public/platform/runtime/modules/atlasmap/entaxy-atlasmap-plugin/pom.xml
2024-12-14 04:07:49 +03:00

524 lines
25 KiB
XML

<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>ru.entaxy.esb.platform.runtime.modules</groupId>
<artifactId>atlasmap</artifactId>
<version>1.10.0</version>
</parent>
<groupId>ru.entaxy.esb.platform.runtime.modules.atlasmap</groupId>
<artifactId>entaxy-atlasmap-plugin</artifactId>
<packaging>war</packaging>
<name>ENTAXY :: UI :: HAWTIO :: ENTAXY ATLASMAP</name>
<description>ENTAXY :: UI :: HAWTIO :: ENTAXY ATLASMAP</description>
<properties>
<!-- filtered plugin properties, we don't define plugin-scripts here
as we build that dynamically using maven-antrun-plugin below. -->
<!-- plugin-context is what context this plugin will handle requests on
in the application server -->
<plugin-context>/entaxy-atlasmap</plugin-context>
<!-- plugin-name is the name of our plugin, affects the name used for
the plugin's mbean -->
<plugin-name>entaxy-atlasmap</plugin-name>
<!-- plugin-domain is currently unused, we just define it to an empty
string -->
<plugin-domain/>
<!-- this lets this plugin deploy nicely into karaf, these get used
for the ImportPackage directive for maven-bundle-plugin -->
<bundle.osgi.import.pkg>
javax.management;resolution:=optional,
org.slf4j;resolution:=optional;version="[1.7,2)",
javax.servlet;version="[3.1,4)"
</bundle.osgi.import.pkg>
<webapp-dir>${project.artifactId}-${project.version}</webapp-dir>
<webapp-outdir>${basedir}/target/${webapp-dir}</webapp-outdir>
<schema-outdir>${basedir}/src/main/webapp/lib</schema-outdir>
<appjs-outfile>${webapp-outdir}/app/app.js</appjs-outfile>
<bundle.osgi.remove.headers>Karaf-Commands,Private-Package,Include-Resource</bundle.osgi.remove.headers>
</properties>
<dependencies>
<dependency>
<groupId>io.hawt</groupId>
<artifactId>hawtio-plugin-mbean</artifactId>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- dependency>
<groupId>com.google.errorprone</groupId>
<artifactId>error_prone_core</artifactId>
</dependency -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
</dependency>
</dependencies>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
</plugin>
</plugins>
</pluginManagement>
<!-- we want to ensure src/main/resources/WEB-INF/web.xml is being filtered
so that it picks up all of our javascript files -->
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
<includes>
<include>**/*.xml</include>
</includes>
</resource>
</resources>
<plugins>
<!-- We use maven-antrun-plugin to build up a list of
javascript files for our plugin mbean, this means
it needs to run before the maven-resources-plugin
copies and filters the web.xml, since for this
example we use contextParam settings to configure
our plugin mbean -->
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>${maven-antrun-plugin.version}</version>
<executions>
<execution>
<!-- we run this early in the build process before
maven-resources-plugin is run. We're exporting the
plugin-scripts property from here, so we need to
use maven-antrun-plugin 1.6 or up -->
<id>generate-sources</id>
<phase>generate-sources</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<echo>Building plugin javascript file list</echo>
<!-- javascript-files will contain all of the javascript in
our project -->
<fileset id="javascript-files-main" dir="${basedir}/src/main/webapp">
<include name="**/entaxyAtlasmapPlugin.js"/>
</fileset>
<fileset id="javascript-files-others" dir="${basedir}/src/main/webapp">
<include name="**/*.js"/>
<exclude name="**/entaxyAtlasmapPlugin.js"/>
</fileset>
<!-- we need to strip out the top level path which is
our source directory and be sure to change the directory
separators to forward slashes -->
<pathconvert pathsep="," dirsep="/" property="plugin-scripts-main"
refid="javascript-files-main">
<map from="${basedir}/src/main/webapp/" to=""/>
</pathconvert>
<pathconvert pathsep="," dirsep="/" property="plugin-scripts-others"
refid="javascript-files-others">
<map from="${basedir}/src/main/webapp/" to=""/>
</pathconvert>
<property name="plugin-scripts"
value="${plugin-scripts-main},${plugin-scripts-others}"/>
<echo>Files: ${plugin-scripts}</echo>
<!--<replace file="${webapp-outdir}/plugin/js/brandingPlugin.js">
<replacefilter token="@artemis.version@" value="${project.version}" />
</replace>-->
</target>
<!-- this exports plugin-scripts to the maven build, without
this line ${plugin-scripts} in the web.xml file won't be
replaced -->
<exportAntProperties>true</exportAntProperties>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>${maven-resources-plugin.version}</version>
<executions>
<execution>
<!-- defining this maven plugin in the same phase as the
maven-antrun-plugin but *after* we've configured the
maven-antrun-plugin ensures we filter resources *after*
we've discovered the plugin .js files. -->
<id>copy-resources</id>
<phase>generate-sources</phase>
<goals>
<goal>resources</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- maven-bundle-plugin config, needed to make this war
deployable in karaf, defines the context that this bundle
should handle requests on -->
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<executions>
<execution>
<id>bundle-manifest</id>
<phase>process-classes</phase>
<goals>
<goal>manifest</goal>
</goals>
</execution>
</executions>
<configuration>
<manifestLocation>target/entaxy-atlasmap-plugin-1.10.0/META-INF</manifestLocation>
<supportedProjectTypes>
<supportedProjectType>jar</supportedProjectType>
<supportedProjectType>bundle</supportedProjectType>
<supportedProjectType>war</supportedProjectType>
</supportedProjectTypes>
<instructions>
<Webapp-Context>${plugin-context}</Webapp-Context>
<Web-ContextPath>${plugin-context}</Web-ContextPath>
<Embed-Directory>WEB-INF/lib</Embed-Directory>
<Embed-Dependency>*;scope=compile|runtime</Embed-Dependency>
<Embed-Transitive>true</Embed-Transitive>
<!-- Export-Package>${osgi.export}</Export-Package -->
<!-- Import-Package>
javax.management;resolution:=optional,
org.slf4j;resolution:=optional;version="[1.7,2)",
javax.servlet;version="[3.1,4)"
</Import-Package -->
<!-- DynamicImport-Package>${osgi.dynamic}</DynamicImport-Package -->
<!-- Private-Package></Private-Package -->
<Bundle-ClassPath>.,WEB-INF/classes</Bundle-ClassPath>
<Bundle-Name>${project.name}</Bundle-Name>
<Bundle-SymbolicName>${project.groupId}.${project.artifactId}</Bundle-SymbolicName>
<Implementation-Title>Entaxy</Implementation-Title>
<Implementation-Version>${project.version}</Implementation-Version>
</instructions>
</configuration>
</plugin>
<!-- We define the maven-war-plugin here and make sure it uses
the manifest file generated by the maven-bundle-plugin. We
also ensure it picks up our filtered web.xml and not the one
in src/main/resources -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<outputFileNameMapping>@{artifactId}@-@{baseVersion}@@{dashClassifier?}@.@{extension}@
</outputFileNameMapping>
<packagingExcludes>**/classes/OSGI-INF/**</packagingExcludes>
<failOnMissingWebXml>false</failOnMissingWebXml>
<archive>
<manifestFile>${webapp-outdir}/META-INF/MANIFEST.MF</manifestFile>
</archive>
<webResources>
<resource>
<filtering>true</filtering>
<directory>src/main/resources</directory>
<includes>
<include>**/*.*</include>
</includes>
<excludes>
<exclude>log4j.properties</exclude>
</excludes>
</resource>
<resource>
<filtering>true</filtering>
<directory>src/main/webapp</directory>
<includes>
<include>**/*.*</include>
</includes>
<excludes>
<exclude>log4j.properties</exclude>
</excludes>
</resource>
</webResources>
</configuration>
</plugin>
</plugins>
</build>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.hawt</groupId>
<artifactId>hawtio-plugin-mbean</artifactId>
<version>${hawtio.version}</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
</dependency>
</dependencies>
</dependencyManagement>
<profiles>
<profile>
<id>attach-cfg</id>
<activation>
<file>
<exists>src/main/resources/etc/org.apache.karaf.features.repos.cfg</exists>
</file>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<executions>
<execution>
<id>attach-cfg-hawtio</id>
<phase>package</phase>
<goals>
<goal>attach-artifact</goal>
</goals>
<configuration>
<runOnlyAtExecutionRoot>false</runOnlyAtExecutionRoot>
<artifacts>
<artifact>
<file>target/classes/etc/org.apache.karaf.features.repos.cfg</file>
<type>cfg</type>
<classifier>org.apache.karaf.features.repos</classifier>
</artifact>
</artifacts>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>entaxy-hawtio-license</id>
<activation>
<property>
<name>processLicense</name>
<value>true</value>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>license-maven-plugin</artifactId>
<executions>
<execution>
<id>update-file-header-entaxy-hawtio</id>
<goals>
<goal>update-file-header</goal>
</goals>
<phase>process-sources</phase>
<configuration>
<organizationName>${license.organizationName}</organizationName>
<inceptionYear>${license.inceptionYear}</inceptionYear>
<projectName>${license.projectName}</projectName>
<copyrightOwners>${license.copyrightOwners}</copyrightOwners>
<licenseName>${license.licenseName}</licenseName>
<!-- plugin documentation recommends "true"
but we use "false" to look like Apache sources -->
<addJavaLicenseAfterPackage>false</addJavaLicenseAfterPackage>
<emptyLineAfterHeader>false</emptyLineAfterHeader>
<!-- excludes>
<exclude>**/*.json</exclude>
</excludes-->
<extraExtensions>
<!-- treat *.install files as *.properties -->
<install>properties</install>
</extraExtensions>
<ignoreNoFileToScan>true</ignoreNoFileToScan>
<keepBackup>true</keepBackup>
<processStartTag>${license.processStartTag}</processStartTag>
<processEndTag>${license.processEndTag}</processEndTag>
<sectionDelimiter>${license.sectionDelimiter}</sectionDelimiter>
</configuration>
</execution>
<execution>
<id>update-file-header</id>
<goals>
<goal>update-file-header</goal>
</goals>
<phase>process-sources</phase>
<configuration>
<excludes combine.self="override">
<!--
we exclude org.apache.karaf.features.repos.cfg
for it will be used as a fragment
-->
<exclude>**/org.apache.karaf.features.repos.cfg</exclude>
<exclude>**/*.cfg</exclude>
<exclude>**/*.json1</exclude>
<!-- *.ftl files will be processed by the next plugin -->
<exclude>**/*.ftl</exclude>
</excludes>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<!--
@DISABLED @TO_REMOVE
-->
<profile>
<id>install-hawtio-script</id>
<activation>
<activeByDefault>false</activeByDefault>
<file>
<exists>src/main/scripts/entaxy-hawtio.install_1</exists>
</file>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>license-maven-plugin</artifactId>
<executions>
<execution>
<id>update-file-header-hawtio</id>
<goals>
<goal>update-file-header</goal>
</goals>
<phase>process-sources</phase>
<configuration>
<organizationName>${license.organizationName}</organizationName>
<inceptionYear>${license.inceptionYear}</inceptionYear>
<projectName>${license.projectName}</projectName>
<copyrightOwners>${license.copyrightOwners}</copyrightOwners>
<licenseName>${license.licenseName}</licenseName>
<!-- plugin documentation recommends "true"
but we use "false" to look like Apache sources -->
<addJavaLicenseAfterPackage>false</addJavaLicenseAfterPackage>
<emptyLineAfterHeader>false</emptyLineAfterHeader>
<!-- excludes>
<exclude>**/*.json</exclude>
</excludes-->
<extraExtensions>
<!-- treat *.install files as *.properties -->
<install>properties</install>
</extraExtensions>
<ignoreNoFileToScan>true</ignoreNoFileToScan>
<keepBackup>true</keepBackup>
<processStartTag>${license.processStartTag}</processStartTag>
<processEndTag>${license.processEndTag}</processEndTag>
<sectionDelimiter>${license.sectionDelimiter}</sectionDelimiter>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<executions>
<execution>
<id>copy-resources-hawtio</id>
<phase>validate</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${basedir}/target/scripts</outputDirectory>
<resources>
<resource>
<directory>src/main/scripts</directory>
<filtering>true</filtering>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<executions>
<execution>
<id>attach-cfg-hawtio</id>
<phase>package</phase>
<goals>
<goal>attach-artifact</goal>
</goals>
<configuration>
<runOnlyAtExecutionRoot>false</runOnlyAtExecutionRoot>
<artifacts>
<artifact>
<file>target/classes/etc/org.apache.karaf.features.repos.cfg</file>
<type>cfg</type>
<classifier>org.apache.karaf.features.repos</classifier>
</artifact>
</artifacts>
</configuration>
</execution>
<execution>
<id>attach-script-hawtio</id>
<phase>verify</phase>
<goals>
<goal>attach-artifact</goal>
</goals>
<configuration>
<runOnlyAtExecutionRoot>false</runOnlyAtExecutionRoot>
<artifacts>
<artifact>
<file>target/scripts/entaxy-hawtio.install</file>
<type>install</type>
<classifier>entaxy-hawtio</classifier>
</artifact>
</artifacts>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>