Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tycho-user] Building an EAR artifact based on the Manifest-First approach

Hi Sandra,

 

I do not have ready to use solution but some ideas that might help. The following seems to work for WARs:

 

  1. Create a self-contained eclipse-repository artifact with your RCP features

https://wiki.eclipse.org/Tycho/eclipse-repository#Creating_a_self-contained_p2_repository

  1. Within the WAR project’s pom the maven-dependency-plugin unpacks the eclipse repositories zip into a directory and the maven-resources-plugin copies the jars into the WEB-INF/lib directory which will be packed into the war by the maven war plugin:

 

 

<?xml version="1.0" encoding="UTF-8"?>

<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/maven-v4_0_0.xsd">

  <modelVersion>4.0.0</modelVersion>

  <artifactId>mywar</artifactId>

  <groupId>mygroup</groupId>

  <version>1.0.0-SNAPSHOT</version>

  <packaging>war</packaging>

 

 

  <build>

    <plugins>

 

      <plugin>

        <groupId>org.apache.maven.plugins</groupId>

        <artifactId>maven-dependency-plugin</artifactId>

        <version>3.0.0</version>

        <executions>

          <execution>

            <id>unpack</id>

            <phase>process-resources</phase>

            <goals>

              <goal>unpack</goal>

            </goals>

            <configuration>

              <artifactItems>

                <artifactItem>

<!—This are the maven coordinates of the eclipse update site -->

                  <artifactId>artifactIdOfTheEclipseRepository</artifactId>

                  <groupId>groupIdOfTheEclipseRepository</groupId>

                  <version>1.0.0-SNAPSHOT</version>

                  <type>zip</type>

                  <overWrite>true</overWrite>

                  <includes>**/plugins/*.jar</includes>

                  <outputDirectory>${project.build.directory}/dependencies/</outputDirectory>

                </artifactItem>

              </artifactItems>

            </configuration>

          </execution>

        </executions>

      </plugin>

      <plugin>

        <artifactId>maven-resources-plugin</artifactId>

        <version>3.0.2</version>

        <executions>

          <execution>

            <id>copy-resources</id>

            <phase>process-resources</phase>

            <goals>

              <goal>copy-resources</goal>

            </goals>

            <configuration>

              <outputDirectory>${project.build.directory}/${project.name}-${project.version}/WEB-INF/lib</outputDirectory>

              <resources>

                <resource>

                  <directory>${project.build.directory}/dependencies/plugins</directory>

                  <filtering>false</filtering>

                </resource>

              </resources>

            </configuration>

          </execution>

        </executions>

      </plugin>

    </plugins>

  </build>

 

</project>

 

Von: tycho-user-bounces@xxxxxxxxxxx [mailto:tycho-user-bounces@xxxxxxxxxxx] Im Auftrag von sparsick@xxxxxx
Gesendet: Donnerstag, 16. März 2017 14:19
An: tycho-user@xxxxxxxxxxx
Betreff: [tycho-user] Building an EAR artifact based on the Manifest-First approach

 

Hello mailing list,

We use Maven Tycho for building our RCP application, that consits of one product, several features and severel eclipse plugins. We use the Manifest-first approach, so that our POMs don't have any dependencies information. It works like a charm. But now some of the eclipse plugins / bundle should be reused in a server application. The deplyoment artifact should be an EAR file. My first thought was to use the maven-ear-plugin. But it doesn't help me to pack a full deployable EAR artifact, because without the dependency information in the reused bundle's POM, the maven-ear-plugin can't collect the all needed dependencies. My next idea was to change the build of the bundle to the classical POM-first approach combinated with the maven-bundle-plugin for the the MANIFEST.MF generation. This idea wasn't accepted by my colleagues because they don't want to have two approachs for creating the MANIFEST.MF. So my question to you is, does anyone know how to build an full deployable EAR artifact based on the dependency information in the MANIFEST.MF of the bundles?

Thank you and best regards,

Sandra


Back to the top