<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>org.etsi.mts.tdl</groupId>
    <artifactId>org.etsi.mts.tdl.parent</artifactId>
	  <version>1.0.0-SNAPSHOT</version>
	  <relativePath>../../org.etsi.mts.tdl.parent</relativePath>
  </parent>
  <artifactId>org.etsi.mts.tdl.standalone</artifactId>
  <packaging>eclipse-plugin</packaging>
	<properties>
		<extras.package.copy>package</extras.package.copy>
		<extras.package.addjars>package</extras.package.addjars>
		<extras.package.shade>package</extras.package.shade>
	</properties>
    <dependencies>
        <dependency>
            <groupId>org.eclipse.emf</groupId>
            <artifactId>org.eclipse.emf.ecore</artifactId>
            <version>2.35.0</version>
        </dependency>
    </dependencies>
	<build>
		<plugins>
 <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <!-- Here come other details
        ...
        -->
        <configuration>
          <archive>
            <manifest>
              <addClasspath>true</addClasspath>
              <!-- Extract to variable for reuse
              -->
	          <mainClass>org.etsi.mts.tdl.standalone.Standalone</mainClass>
            </manifest>
          </archive>
        </configuration>
        <!-- Here come other details
        ...
        -->
      </plugin>
    <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>exec-maven-plugin</artifactId>
        <version>1.2.1</version>
        <executions>
          <execution>
            <goals>
              <goal>java</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <mainClass>org.etsi.mts.tdl.standalone.Standalone</mainClass>
          <arguments>
          </arguments>
        </configuration>
      </plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-dependency-plugin</artifactId>
				<version>3.3.0</version>
				<executions>
					<execution>
						<id>copy-dependencies</id>
						<phase>${extras.package.copy}</phase>
						<goals>
							<goal>copy-dependencies</goal>
						</goals>
						<configuration>
							<excludeGroupIds>p2.eclipse-feature</excludeGroupIds>
							<outputDirectory>${project.build.directory}/libs</outputDirectory>
							<overWriteReleases>false</overWriteReleases>
							<overWriteSnapshots>false</overWriteSnapshots>
							<overWriteIfNewer>true</overWriteIfNewer>
							<excludeTransitive>false</excludeTransitive>
							<excludeArtifactIds>
								com.ibm.icu,
								org.apache.ant,
								org.apache.commons.lang,
								org.eclipse.core.expressions,
								org.eclipse.core.filesystem,
								org.eclipse.core.variables,
								org.eclipse.jdt.core,
								org.eclipse.jdt.debug,
								org.eclipse.jdt.launching,
								org.eclipse.text,
								org.eclipse.e4.core.commands,
								org.eclipse.e4.core.contexts,
								org.eclipse.e4.core.di,
								org.eclipse.e4.core.di.annotation,
								org.eclipse.e4.core.di.extensions,
								org.eclipse.e4.core.di.extensions.supplier,
								org.eclipse.e4.core.services,
								org.eclipse.e4.emf.xpath,
								org.eclipse.e4.ui.bindings,
								org.eclipse.e4.ui.css.core,
								org.eclipse.e4.ui.css.swt,
								org.eclipse.e4.ui.css.swt.theme,
								org.eclipse.e4.ui.di,
								org.eclipse.e4.ui.dialogs,
								org.eclipse.e4.ui.ide,
								org.eclipse.e4.ui.model.workbench,
								org.eclipse.e4.ui.services,
								org.eclipse.e4.ui.widgets,
								org.eclipse.e4.ui.workbench,
								org.eclipse.e4.ui.workbench.addons.swt,
								org.eclipse.e4.ui.workbench.renderers.swt,
								org.eclipse.e4.ui.workbench.swt,
								org.eclipse.core.databinding,
								org.eclipse.core.databinding.observable,
								org.eclipse.core.databinding.property,
								org.eclipse.emf.common.ui,
								org.eclipse.emf.mapping.ecore2xml,
								org.eclipse.epsilon.eol.dt,
								org.eclipse.equinox.bidi,
								org.eclipse.equinox.event,
								org.eclipse.equinox.p2.artifact.repository,
								org.eclipse.equinox.p2.core,
								org.eclipse.equinox.p2.engine,
								org.eclipse.equinox.p2.jarprocessor,
								org.eclipse.equinox.p2.metadata,
								org.eclipse.equinox.p2.metadata.repository,
								org.eclipse.equinox.p2.repository,
								org.eclipse.equinox.security,
								org.eclipse.help,
								org.eclipse.jdt.core.compiler.batch,
								org.eclipse.jface.databinding,
								org.eclipse.jface.text,
								org.eclipse.ocl.pivot.uml,
								org.eclipse.ui.console,
								org.eclipse.ui.forms,
								org.eclipse.ui.ide,
								org.eclipse.ui.navigator,
								org.eclipse.ui.views,
								org.eclipse.uml2.codegen.ecore,
								org.eclipse.uml2.common,
								org.eclipse.uml2.types,
								org.eclipse.uml2.uml,
								org.eclipse.uml2.uml.profile.standard,
								org.eclipse.uml2.uml.resources,
								org.eclipse.urischeme,
								org.eclipse.xsd,
								org.osgi.namespace.extender,
								org.osgi.namespace.implementation,
								org.osgi.service.component,
								org.osgi.service.event,

							</excludeArtifactIds>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>com.googlecode.addjars-maven-plugin</groupId>
				<artifactId>addjars-maven-plugin</artifactId>
				<version>1.0.5</version>
				<executions>
					<execution>
						<phase>${extras.package.addjars}</phase>
						<goals>
							<goal>add-jars</goal>
						</goals>
						<configuration>
							<resources>
								<resource>
									<directory>${project.build.directory}/libs</directory>
								</resource>
							</resources>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-shade-plugin</artifactId>
				<version>3.3.0</version>
				<configuration>
					<transformers>
						<transformer
							implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
							<mainClass>org.etsi.mts.tdl.standalone.Standalone</mainClass>
						</transformer>
						<transformer
							implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
							<resource>plugin.properties</resource>
						</transformer>
						<transformer 
							implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer">
						</transformer>
					</transformers>
					<artifactSet>
						<excludes><!-- avoid duplicate inclusion due to addjars plugin -->
							<exclude>*:org.etsi.mts.tdl.tx.ide-org.eclipse.lsp4j*</exclude>
							<exclude>*:org.etsi.mts.tdl.tx.ide-org.eclipse.xtext.xbase.lib*</exclude>
							<exclude>*:org.etsi.mts.tdl.tx.ide-org.eclipse.xtend.lib*</exclude>
							<exclude>*:org.etsi.mts.tdl.tx.ide-com.google.guava*</exclude>
							<exclude>*:org.etsi.mts.tdl.tx.ide-asm*</exclude>
							<exclude>*:org.etsi.mts.tdl.tx.ide-log4j*</exclude>
							<exclude>*:org.etsi.mts.tdl.tx.ide-reload4j*</exclude>
							<exclude>*:org.etsi.mts.tdl.tx.ide-org.objectweb.asm*</exclude>
							<exclude>*:org.etsi.mts.tdl.tx.ide-org.apache.log4j*</exclude>
						</excludes>
					</artifactSet>
					<filters>
						<filter>
							<artifact>*:*</artifact>
							<excludes>
								<exclude>META-INF/INDEX.LIST</exclude>
								<exclude>META-INF/*.SF</exclude>
								<exclude>META-INF/*.DSA</exclude>
								<exclude>META-INF/*.RSA</exclude>
								<exclude>.options</exclude>
								<exclude>.api_description</exclude>
								<exclude>*.profile</exclude>
								<exclude>*.html</exclude>
								<exclude>about.*</exclude>
								<exclude>about_files/*</exclude>
								<exclude>plugin.xml</exclude>
								<exclude>systembundle.properties</exclude>
								<exclude>profile.list</exclude>
								<exclude>**/*._trace</exclude>
								<exclude>**/*.g</exclude>
								<exclude>**/*.mwe2</exclude>
								<exclude>**/*.xtext</exclude>
							</excludes>
						</filter>
					</filters>
					<shadedArtifactAttached>true</shadedArtifactAttached>
					<shadedClassifierName>shadow</shadedClassifierName>
					<minimizeJar>false</minimizeJar>
				</configuration>
				<executions>
					<execution>
						<phase>${extras.package.shade}</phase>
						<goals>
							<goal>shade</goal>
						</goals>
					<!-- 
					<configuration>
                        <minimizeJar>true</minimizeJar>
                    </configuration>
					-->
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>

</project>