Discussion:
Problem getting Tycho to use a local .target file
(too old to reply)
Rizzo, Eric
2012-11-15 18:43:19 UTC
Permalink
I'm just getting started with Tycho, attempting to migrate a large RCP product from PDE Build. We have a target platform, defined in a .target file that uses "Software Sites" (p2 repos), and this target works in the developer workspaces. However, I have not been able to get Tycho to recognize and use it to build our plugins, features, and product.
I'm following Lars Vogel's tutorial as well as some Tycho wiki pages and other resources, but none have a complete example of using a .target file to direct Tycho to your target platform. I used the following command to generate pom files in all my plugin, feature, and product projects:


mvn org.eclipse.tycho:tycho-pomgenerator-plugin:generate-poms -DgroupId=my.group.id

It did so, along with a parent pom that includes them all – except for the project that contains the .target. That one I wrote by hand and added as a <module> in the parent pom. Here's the .target project pom (derived from http://eclipsedriven.blogspot.com/2011/07/configuring-eclipse-tycho-maven-plugin.html):

<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>bundles</artifactId>
<groupId>my.group.id</groupId>
<version>2.1.0-SNAPSHOT</version>
</parent>

<groupId>my.group.id</groupId>
<artifactId>my.group.id.targetPlatform</artifactId>
<version>2.1.0-SNAPSHOT</version>
<packaging>pom</packaging>

<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.3</version>
<executions>
<execution>
<id>attach-artifacts</id>
<phase>package</phase>
<goals>
<goal>attach-artifact</goal>
</goals>
<configuration>
<artifacts>
<artifact>
<file>designer.target</file>
<type>target</type>
<classifier>designer</classifier>
</artifact>
</artifacts>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

Here is the top-level pom that uses the generated poms and the .target one above that I hand-wrote:

<?xml version="1.0" encoding="UTF-8"?>
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>my.group.id</groupId>
<artifactId>parent</artifactId>
<version>2.1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<modules>
<module>bundles</module>
</modules>

<properties>
<tycho-version>0.16.0</tycho-version>
</properties>

<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
<version>${tycho-version}</version>
<configuration>
<resolver>p2</resolver>
<ignoreTychoRepositories>true</ignoreTychoRepositories>
<target>
<artifact>
<groupId>my.group.id</groupId>
<artifactId>my.group.id.targetPlatform</artifactId>
<version>2.1.0-SNAPSHOT</version>
<classifier>designer</classifier>
</artifact>
</target>
<environments>
<environment>
<os>${build.os}</os>
<ws>${build.ws}</ws>
<arch>${build.arch}</arch>
</environment>
</environments>
</configuration>
</plugin>

<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-maven-plugin</artifactId>
<version>${tycho-version}</version>
<extensions>true</extensions>
</plugin>

<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-p2-director-plugin</artifactId>
<version>${tycho-version}</version>
<executions>
<execution>
<id>materialize-products</id>
<goals>
<goal>materialize-products</goal>
</goals>
</execution>
<execution>
<id>archive-products</id>
<goals>
<goal>archive-products</goal>
</goals>
</execution>
</executions>
</plugin>

</plugins>
</build>

</project>


"mvn clean install" starts to build, but quickly complains that it can't resolve basic dependencies from the .target, such as org.eclipse.runtime.core.

[INFO] Computing target platform for MavenProject: my.group.id:com.emc.myplugin.ui:1.0.0-SNAPSHOT @ F:\staging\app\bundles\com.emc.myplugin.ui\pom.xml
[INFO] Resolving dependencies of MavenProject: my.group.id:com.emc.myplugin.ui:1.0.0-SNAPSHOT @ F:\staging\app\bundles\com.emc.myplugin.ui\pom.xml
[INFO] Cannot complete the request. Generating details.
[INFO] Cannot complete the request. Generating details.
[INFO] {osgi.ws=win32, osgi.os=win32, osgi.arch=x86, org.eclipse.update.install.features=true}
[ERROR] Cannot resolve project dependencies:
[ERROR] Software being installed: com.emc.myplugin.ui 1.0.0.qualifier
[ERROR] Missing requirement: com.emc.myplugin.ui 1.0.0.qualifier requires 'bundle org.eclipse.core.runtime 0.0.0' but it could not be found

The .target file is pretty huge, so I won't paste it here unless someone asks. The gist of it is that it refers to several p2 repos, specifying IUs as well as specific plugin IDs (the "Content" tab of the Target editor in Eclipse IDE).

I've tried using the –X option to mvn in order to get more debugging help, but it didn't yield anything that I found to be useful. Any advice about why Tycho seems to be ignoring the .target file, or how I can further troubleshoot.

Thanks in advance,
Eric
Sievers, Jan
2012-11-16 07:42:44 UTC
Permalink
here is an example using a target definition file:
http://git.eclipse.org/c/tycho/org.eclipse.tycho-demo.git/tree/itp04-rcp

Jan



From: tycho-user-***@eclipse.org [mailto:tycho-user-***@eclipse.org] On Behalf Of Rizzo, Eric
Sent: Donnerstag, 15. November 2012 19:43
To: tycho-***@eclipse.org
Subject: [tycho-user] Problem getting Tycho to use a local .target file

I'm just getting started with Tycho, attempting to migrate a large RCP product from PDE Build. We have a target platform, defined in a .target file that uses "Software Sites" (p2 repos), and this target works in the developer workspaces. However, I have not been able to get Tycho to recognize and use it to build our plugins, features, and product.
I'm following Lars Vogel's tutorial as well as some Tycho wiki pages and other resources, but none have a complete example of using a .target file to direct Tycho to your target platform. I used the following command to generate pom files in all my plugin, feature, and product projects:

mvn org.eclipse.tycho:tycho-pomgenerator-plugin:generate-poms -DgroupId=my.group.id

It did so, along with a parent pom that includes them all - except for the project that contains the .target. That one I wrote by hand and added as a <module> in the parent pom. Here's the .target project pom (derived from http://eclipsedriven.blogspot.com/2011/07/configuring-eclipse-tycho-maven-plugin.html):

<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <artifactId>bundles</artifactId>
    <groupId>my.group.id</groupId>
    <version>2.1.0-SNAPSHOT</version>
  </parent>

  <groupId>my.group.id</groupId>
  <artifactId>my.group.id.targetPlatform</artifactId>
  <version>2.1.0-SNAPSHOT</version>
  <packaging>pom</packaging>

<build>
  <plugins>
    <plugin>
      <groupId>org.codehaus.mojo</groupId>
      <artifactId>build-helper-maven-plugin</artifactId>
      <version>1.3</version>
      <executions>
        <execution>
          <id>attach-artifacts</id>
          <phase>package</phase>
          <goals>
            <goal>attach-artifact</goal>
          </goals>
          <configuration>
            <artifacts>
              <artifact>
                <file>designer.target</file>
                <type>target</type>
                <classifier>designer</classifier>
              </artifact>
            </artifacts>
          </configuration>
        </execution>
      </executions>
    </plugin>
  </plugins>
</build>
</project>

Here is the top-level pom that uses the generated poms and the .target one above that I hand-wrote:

<?xml version="1.0" encoding="UTF-8"?>
<project>
  <modelVersion>4.0.0</modelVersion>
  <groupId>my.group.id</groupId>
  <artifactId>parent</artifactId>
  <version>2.1.0-SNAPSHOT</version>
  <packaging>pom</packaging>
  <modules>
    <module>bundles</module>
  </modules>

  <properties>
    <tycho-version>0.16.0</tycho-version>
  </properties>

  <build>
    <plugins>
 <plugin>
   <groupId>org.eclipse.tycho</groupId>
   <artifactId>target-platform-configuration</artifactId>
   <version>${tycho-version}</version>
   <configuration>
     <resolver>p2</resolver>
     <ignoreTychoRepositories>true</ignoreTychoRepositories>
     <target>
<artifact>
 <groupId>my.group.id</groupId>
 <artifactId>my.group.id.targetPlatform</artifactId>
 <version>2.1.0-SNAPSHOT</version>
 <classifier>designer</classifier>
</artifact>
     </target>
<environments>
   <environment>
<os>${build.os}</os>
<ws>${build.ws}</ws>
<arch>${build.arch}</arch>
   </environment>
</environments>
   </configuration>
 </plugin>

      <plugin>
        <groupId>org.eclipse.tycho</groupId>
        <artifactId>tycho-maven-plugin</artifactId>
        <version>${tycho-version}</version>
        <extensions>true</extensions>
      </plugin>

      <plugin>
        <groupId>org.eclipse.tycho</groupId>
        <artifactId>tycho-p2-director-plugin</artifactId>
        <version>${tycho-version}</version>
        <executions>
          <execution>
            <id>materialize-products</id>
            <goals>
              <goal>materialize-products</goal>
            </goals>
          </execution>
          <execution>
            <id>archive-products</id>
            <goals>
              <goal>archive-products</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      
    </plugins>
  </build>

</project>


"mvn clean install" starts to build, but quickly complains that it can't resolve basic dependencies from the .target, such as org.eclipse.runtime.core.

[INFO] Computing target platform for MavenProject: my.group.id:com.emc.myplugin.ui:1.0.0-SNAPSHOT @ F:\staging\app\bundles\com.emc.myplugin.ui\pom.xml
[INFO] Resolving dependencies of MavenProject: my.group.id:com.emc.myplugin.ui:1.0.0-SNAPSHOT @ F:\staging\app\bundles\com.emc.myplugin.ui\pom.xml
[INFO] Cannot complete the request.  Generating details.
[INFO] Cannot complete the request.  Generating details.
[INFO] {osgi.ws=win32, osgi.os=win32, osgi.arch=x86, org.eclipse.update.install.features=true}
[ERROR] Cannot resolve project dependencies:
[ERROR]   Software being installed: com.emc.myplugin.ui 1.0.0.qualifier
[ERROR]   Missing requirement: com.emc.myplugin.ui 1.0.0.qualifier requires 'bundle org.eclipse.core.runtime 0.0.0' but it could not be found

The .target file is pretty huge, so I won't paste it here unless someone asks. The gist of it is that it refers to several p2 repos, specifying IUs as well as specific plugin IDs (the "Content" tab of the Target editor in Eclipse IDE).

I've tried using the -X option to mvn in order to get more debugging help, but it didn't yield anything that I found to be useful. Any advice about why Tycho seems to be ignoring the .target file, or how I can further troubleshoot.

Thanks in advance,
Eric
Rizzo, Eric
2012-11-16 16:42:42 UTC
Permalink
Thanks, Jan. I'll examine it.
I just figured out that my problem was due to the generated "parent" pom
not referencing the "master" pom (one level up that I hand-wrote) as its
parent. Thus, the target platform configuration (which is in the
hand-written "master") was not being inherited. I added the appropriate
<parent> node to the generated parent pom and now it's progressing.

But this leads to a dilemma: we have a large number of plugins and
features, so we want to take advantage of the ability of
tycho-pomgenerator-plugin to generate the poms for us (if for nothing
else, so we don't have to manually maintain the list of <modules> in the
parent pom); in other words, my plan is to NOT check in the poms for each
plugin or feature project or the "parent" pom above them. However, the
parent pom does need to either:

a) reference the hand-written "master" pom that I have written (which
would be checked in)
or
b) include the contents that I've put in the "master" pom, which would
eliminate the need for the "master" pom.

Either way, I can't rely solely on the pom that is generated by
tycho-pomgenerator-plugin - it needs some modification (additions, really).

So, what's the best strategy for handling this case, where we want to
leverage pom generation but it needs to refer to another pom as its parent?

Thanks,
Eric
Post by Sievers, Jan
http://git.eclipse.org/c/tycho/org.eclipse.tycho-demo.git/tree/itp04-rcp
Jan
Sent: Donnerstag, 15. November 2012 19:43
Subject: [tycho-user] Problem getting Tycho to use a local .target file
I'm just getting started with Tycho, attempting to migrate a large RCP
product from PDE Build. We have a target platform, defined in a .target
file that uses "Software Sites" (p2 repos), and this target works in the
developer workspaces. However, I have not been able to get Tycho to
recognize and use it to build our plugins, features, and product.
I'm following Lars Vogel's tutorial as well as some Tycho wiki pages and
other resources, but none have a complete example of using a .target file
to direct Tycho to your target platform. I used the following command to
mvn org.eclipse.tycho:tycho-pomgenerator-plugin:generate-poms
-DgroupId=my.group.id
It did so, along with a parent pom that includes them all - except for
the project that contains the .target. That one I wrote by hand and added
as a <module> in the parent pom. Here's the .target project pom (derived
from
http://eclipsedriven.blogspot.com/2011/07/configuring-eclipse-tycho-maven-
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>bundles</artifactId>
<groupId>my.group.id</groupId>
<version>2.1.0-SNAPSHOT</version>
</parent>
<groupId>my.group.id</groupId>
<artifactId>my.group.id.targetPlatform</artifactId>
<version>2.1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.3</version>
<executions>
<execution>
<id>attach-artifacts</id>
<phase>package</phase>
<goals>
<goal>attach-artifact</goal>
</goals>
<configuration>
<artifacts>
<artifact>
<file>designer.target</file>
<type>target</type>
<classifier>designer</classifier>
</artifact>
</artifacts>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Here is the top-level pom that uses the generated poms and the .target
<?xml version="1.0" encoding="UTF-8"?>
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>my.group.id</groupId>
<artifactId>parent</artifactId>
<version>2.1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<modules>
<module>bundles</module>
</modules>
<properties>
<tycho-version>0.16.0</tycho-version>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
<version>${tycho-version}</version>
<configuration>
<resolver>p2</resolver>
<ignoreTychoRepositories>true</ignoreTychoRepositories>
<target>
<artifact>
<groupId>my.group.id</groupId>
<artifactId>my.group.id.targetPlatform</artifactId>
<version>2.1.0-SNAPSHOT</version>
<classifier>designer</classifier>
</artifact>
</target>
<environments>
<environment>
<os>${build.os}</os>
<ws>${build.ws}</ws>
<arch>${build.arch}</arch>
</environment>
</environments>
</configuration>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-maven-plugin</artifactId>
<version>${tycho-version}</version>
<extensions>true</extensions>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-p2-director-plugin</artifactId>
<version>${tycho-version}</version>
<executions>
<execution>
<id>materialize-products</id>
<goals>
<goal>materialize-products</goal>
</goals>
</execution>
<execution>
<id>archive-products</id>
<goals>
<goal>archive-products</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
"mvn clean install" starts to build, but quickly complains that it can't
resolve basic dependencies from the .target, such as
org.eclipse.runtime.core.
F:\staging\app\bundles\com.emc.myplugin.ui\pom.xml
F:\staging\app\bundles\com.emc.myplugin.ui\pom.xml
[INFO] Cannot complete the request. Generating details.
[INFO] Cannot complete the request. Generating details.
[INFO] {osgi.ws=win32, osgi.os=win32, osgi.arch=x86,
org.eclipse.update.install.features=true}
[ERROR] Software being installed: com.emc.myplugin.ui 1.0.0.qualifier
[ERROR] Missing requirement: com.emc.myplugin.ui 1.0.0.qualifier
requires 'bundle org.eclipse.core.runtime 0.0.0' but it could not be found
The .target file is pretty huge, so I won't paste it here unless someone
asks. The gist of it is that it refers to several p2 repos, specifying
IUs as well as specific plugin IDs (the "Content" tab of the Target
editor in Eclipse IDE).
I've tried using the -X option to mvn in order to get more debugging
help, but it didn't yield anything that I found to be useful. Any advice
about why Tycho seems to be ignoring the .target file, or how I can
further troubleshoot.
Thanks in advance,
Eric
_______________________________________________
tycho-user mailing list
https://dev.eclipse.org/mailman/listinfo/tycho-user
David Carver
2012-11-16 17:20:08 UTC
Permalink
Why don't you want to check in the poms? There are times that you will
need to add things to the poms, particularly the test plugins. The pom
generator really should only be used once in my opinion.

Dave
Post by Rizzo, Eric
Thanks, Jan. I'll examine it.
I just figured out that my problem was due to the generated "parent" pom
not referencing the "master" pom (one level up that I hand-wrote) as its
parent. Thus, the target platform configuration (which is in the
hand-written "master") was not being inherited. I added the appropriate
<parent> node to the generated parent pom and now it's progressing.
But this leads to a dilemma: we have a large number of plugins and
features, so we want to take advantage of the ability of
tycho-pomgenerator-plugin to generate the poms for us (if for nothing
else, so we don't have to manually maintain the list of <modules> in the
parent pom); in other words, my plan is to NOT check in the poms for each
plugin or feature project or the "parent" pom above them. However, the
a) reference the hand-written "master" pom that I have written (which
would be checked in)
or
b) include the contents that I've put in the "master" pom, which would
eliminate the need for the "master" pom.
Either way, I can't rely solely on the pom that is generated by
tycho-pomgenerator-plugin - it needs some modification (additions, really).
So, what's the best strategy for handling this case, where we want to
leverage pom generation but it needs to refer to another pom as its parent?
Thanks,
Eric
Post by Sievers, Jan
http://git.eclipse.org/c/tycho/org.eclipse.tycho-demo.git/tree/itp04-rcp
Jan
Sent: Donnerstag, 15. November 2012 19:43
Subject: [tycho-user] Problem getting Tycho to use a local .target file
I'm just getting started with Tycho, attempting to migrate a large RCP
product from PDE Build. We have a target platform, defined in a .target
file that uses "Software Sites" (p2 repos), and this target works in the
developer workspaces. However, I have not been able to get Tycho to
recognize and use it to build our plugins, features, and product.
I'm following Lars Vogel's tutorial as well as some Tycho wiki pages and
other resources, but none have a complete example of using a .target file
to direct Tycho to your target platform. I used the following command to
mvn org.eclipse.tycho:tycho-pomgenerator-plugin:generate-poms
-DgroupId=my.group.id
It did so, along with a parent pom that includes them all - except for
the project that contains the .target. That one I wrote by hand and added
as a <module> in the parent pom. Here's the .target project pom (derived
from
http://eclipsedriven.blogspot.com/2011/07/configuring-eclipse-tycho-maven-
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>bundles</artifactId>
<groupId>my.group.id</groupId>
<version>2.1.0-SNAPSHOT</version>
</parent>
<groupId>my.group.id</groupId>
<artifactId>my.group.id.targetPlatform</artifactId>
<version>2.1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.3</version>
<executions>
<execution>
<id>attach-artifacts</id>
<phase>package</phase>
<goals>
<goal>attach-artifact</goal>
</goals>
<configuration>
<artifacts>
<artifact>
<file>designer.target</file>
<type>target</type>
<classifier>designer</classifier>
</artifact>
</artifacts>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Here is the top-level pom that uses the generated poms and the .target
<?xml version="1.0" encoding="UTF-8"?>
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>my.group.id</groupId>
<artifactId>parent</artifactId>
<version>2.1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<modules>
<module>bundles</module>
</modules>
<properties>
<tycho-version>0.16.0</tycho-version>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
<version>${tycho-version}</version>
<configuration>
<resolver>p2</resolver>
<ignoreTychoRepositories>true</ignoreTychoRepositories>
<target>
<artifact>
<groupId>my.group.id</groupId>
<artifactId>my.group.id.targetPlatform</artifactId>
<version>2.1.0-SNAPSHOT</version>
<classifier>designer</classifier>
</artifact>
</target>
<environments>
<environment>
<os>${build.os}</os>
<ws>${build.ws}</ws>
<arch>${build.arch}</arch>
</environment>
</environments>
</configuration>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-maven-plugin</artifactId>
<version>${tycho-version}</version>
<extensions>true</extensions>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-p2-director-plugin</artifactId>
<version>${tycho-version}</version>
<executions>
<execution>
<id>materialize-products</id>
<goals>
<goal>materialize-products</goal>
</goals>
</execution>
<execution>
<id>archive-products</id>
<goals>
<goal>archive-products</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
"mvn clean install" starts to build, but quickly complains that it can't
resolve basic dependencies from the .target, such as
org.eclipse.runtime.core.
F:\staging\app\bundles\com.emc.myplugin.ui\pom.xml
F:\staging\app\bundles\com.emc.myplugin.ui\pom.xml
[INFO] Cannot complete the request. Generating details.
[INFO] Cannot complete the request. Generating details.
[INFO] {osgi.ws=win32, osgi.os=win32, osgi.arch=x86,
org.eclipse.update.install.features=true}
[ERROR] Software being installed: com.emc.myplugin.ui 1.0.0.qualifier
[ERROR] Missing requirement: com.emc.myplugin.ui 1.0.0.qualifier
requires 'bundle org.eclipse.core.runtime 0.0.0' but it could not be found
The .target file is pretty huge, so I won't paste it here unless someone
asks. The gist of it is that it refers to several p2 repos, specifying
IUs as well as specific plugin IDs (the "Content" tab of the Target
editor in Eclipse IDE).
I've tried using the -X option to mvn in order to get more debugging
help, but it didn't yield anything that I found to be useful. Any advice
about why Tycho seems to be ignoring the .target file, or how I can
further troubleshoot.
Thanks in advance,
Eric
_______________________________________________
tycho-user mailing list
https://dev.eclipse.org/mailman/listinfo/tycho-user
_______________________________________________
tycho-user mailing list
https://dev.eclipse.org/mailman/listinfo/tycho-user
Sievers, Jan
2012-11-19 09:10:21 UTC
Permalink
Post by Rizzo, Eric
But this leads to a dilemma: we have a large number of plugins and
features, so we want to take advantage of the ability of
tycho-pomgenerator-plugin to generate the poms for us (if for nothing
else, so we don't have to manually maintain the list of <modules> in the
parent pom); in other words, my plan is to NOT check in the poms for each
plugin or feature project or the "parent" pom above them.
I'm afraid tycho-pomgenerator-plugin wasn't designed for this purpose.
The idea was to give you a quickstart/template for migrating an existing project to tycho.
So it's a one-time generation and then you start customizing your pom.xml files.

Your scenario is valid but we don't have tooling for it AFAIK.
I think the reason is that ultimately there is an information gap for generating pom.xml files solely from MANIFEST.MF/other PDE files.
E.g. info about the p2 repos you want to compile against are not available for the pom generator.

Jan
Oberlies, Tobias
2012-11-19 12:33:38 UTC
Permalink
Post by Sievers, Jan
Post by Rizzo, Eric
But this leads to a dilemma: we have a large number of plugins and
features, so we want to take advantage of the ability of
tycho-pomgenerator-plugin to generate the poms for us (if for nothing
else, so we don't have to manually maintain the list of <modules> in the
parent pom); in other words, my plan is to NOT check in the poms for each
plugin or feature project or the "parent" pom above them.
I'm afraid tycho-pomgenerator-plugin wasn't designed for this purpose.
The idea was to give you a quickstart/template for migrating an existing project to tycho.
So it's a one-time generation and then you start customizing your pom.xml files.
Actually, I think that the tycho-pomgenerator-plugin was originally designed for a POM-less build, but this approach was abandoned a while ago.

This means that tycho-pomgenerator-plugin won't give you complete results for the more modern Tycho features like target files. It should be possible to extend the plugin to also cover target files (including the eclipse-target-definition packaging type), and this would make sense, but we would need you to do it. I don't think that the use case is important to any of the committers, so don't expect us to implement it.

If this is an option for you, please follow the Contributor's Guide [1]

Regards
Tobias

[1] http://wiki.eclipse.org/Tycho/Contributor_Guide
Sievers, Jan
2012-11-19 09:20:16 UTC
Permalink
Post by Rizzo, Eric
a) reference the hand-written "master" pom that I have written (which
would be checked in)
So, what's the best strategy for handling this case, where we want to
leverage pom generation but it needs to refer to another pom as its parent?
I could imagine that the pomgenerator plugin is extended to support a custom parent (case a) above.
This would mean the restriction that all your plugin/feature/repository pom.xml's can't be customized but if you are fine with that, I guess that's OK.

Regards
Jan
Rizzo, Eric
2012-11-16 17:56:18 UTC
Permalink
Post by David Carver
Why don't you want to check in the poms? There are times that you will
need to add things to the poms, particularly the test plugins. The pom
generator really should only be used once in my opinion.
Dave
The main reason is the generated parent pom lists out each <module>; since
we have over 150 plugins and features, my thought is that maintaining that
list can be tedious and definitely something that the average plugin
developer would know about or understand*. It would be great to have the
build set up so that when a new plugin or feature is added or removed, the
pom is automatically updated.
At this point I'm just evaluating options; checking in all the poms *is*
an option, with the tradeoff I've mentioned. I'd like to know if there is
any straightforward option for NOT checking them in.

Thanks,
Eric

* The team I'm working with is large, globally distributed, and not
uniformly well-versed in the ways of either Eclipse or Maven. So my
overall strategy has been to try to eliminate any need for them to have to
maintain Maven-y things or the more "advanced" Eclipse concepts (like
target platform), whenever possible.
Post by David Carver
Post by Rizzo, Eric
Thanks, Jan. I'll examine it.
I just figured out that my problem was due to the generated "parent" pom
not referencing the "master" pom (one level up that I hand-wrote) as its
parent. Thus, the target platform configuration (which is in the
hand-written "master") was not being inherited. I added the appropriate
<parent> node to the generated parent pom and now it's progressing.
But this leads to a dilemma: we have a large number of plugins and
features, so we want to take advantage of the ability of
tycho-pomgenerator-plugin to generate the poms for us (if for nothing
else, so we don't have to manually maintain the list of <modules> in the
parent pom); in other words, my plan is to NOT check in the poms for
each
plugin or feature project or the "parent" pom above them. However, the
a) reference the hand-written "master" pom that I have written (which
would be checked in)
or
b) include the contents that I've put in the "master" pom, which would
eliminate the need for the "master" pom.
Either way, I can't rely solely on the pom that is generated by
tycho-pomgenerator-plugin - it needs some modification (additions,
really).
So, what's the best strategy for handling this case, where we want to
leverage pom generation but it needs to refer to another pom as its
parent?
Thanks,
Eric
Post by Sievers, Jan
http://git.eclipse.org/c/tycho/org.eclipse.tycho-demo.git/tree/itp04-rcp
Jan
Sent: Donnerstag, 15. November 2012 19:43
Subject: [tycho-user] Problem getting Tycho to use a local .target file
I'm just getting started with Tycho, attempting to migrate a large RCP
product from PDE Build. We have a target platform, defined in a .target
file that uses "Software Sites" (p2 repos), and this target works in
the
developer workspaces. However, I have not been able to get Tycho to
recognize and use it to build our plugins, features, and product.
I'm following Lars Vogel's tutorial as well as some Tycho wiki pages
and
other resources, but none have a complete example of using a .target
file
to direct Tycho to your target platform. I used the following command
to
mvn org.eclipse.tycho:tycho-pomgenerator-plugin:generate-poms
-DgroupId=my.group.id
It did so, along with a parent pom that includes them all - except for
the project that contains the .target. That one I wrote by hand and
added
as a <module> in the parent pom. Here's the .target project pom
(derived
from
http://eclipsedriven.blogspot.com/2011/07/configuring-eclipse-tycho-mave
n-
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>bundles</artifactId>
<groupId>my.group.id</groupId>
<version>2.1.0-SNAPSHOT</version>
</parent>
<groupId>my.group.id</groupId>
<artifactId>my.group.id.targetPlatform</artifactId>
<version>2.1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.3</version>
<executions>
<execution>
<id>attach-artifacts</id>
<phase>package</phase>
<goals>
<goal>attach-artifact</goal>
</goals>
<configuration>
<artifacts>
<artifact>
<file>designer.target</file>
<type>target</type>
<classifier>designer</classifier>
</artifact>
</artifacts>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Here is the top-level pom that uses the generated poms and the .target
<?xml version="1.0" encoding="UTF-8"?>
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>my.group.id</groupId>
<artifactId>parent</artifactId>
<version>2.1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<modules>
<module>bundles</module>
</modules>
<properties>
<tycho-version>0.16.0</tycho-version>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
<version>${tycho-version}</version>
<configuration>
<resolver>p2</resolver>
<ignoreTychoRepositories>true</ignoreTychoRepositories>
<target>
<artifact>
<groupId>my.group.id</groupId>
<artifactId>my.group.id.targetPlatform</artifactId>
<version>2.1.0-SNAPSHOT</version>
<classifier>designer</classifier>
</artifact>
</target>
<environments>
<environment>
<os>${build.os}</os>
<ws>${build.ws}</ws>
<arch>${build.arch}</arch>
</environment>
</environments>
</configuration>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-maven-plugin</artifactId>
<version>${tycho-version}</version>
<extensions>true</extensions>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-p2-director-plugin</artifactId>
<version>${tycho-version}</version>
<executions>
<execution>
<id>materialize-products</id>
<goals>
<goal>materialize-products</goal>
</goals>
</execution>
<execution>
<id>archive-products</id>
<goals>
<goal>archive-products</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
"mvn clean install" starts to build, but quickly complains that it
can't
resolve basic dependencies from the .target, such as
org.eclipse.runtime.core.
F:\staging\app\bundles\com.emc.myplugin.ui\pom.xml
F:\staging\app\bundles\com.emc.myplugin.ui\pom.xml
[INFO] Cannot complete the request. Generating details.
[INFO] Cannot complete the request. Generating details.
[INFO] {osgi.ws=win32, osgi.os=win32, osgi.arch=x86,
org.eclipse.update.install.features=true}
[ERROR] Software being installed: com.emc.myplugin.ui 1.0.0.qualifier
[ERROR] Missing requirement: com.emc.myplugin.ui 1.0.0.qualifier
requires 'bundle org.eclipse.core.runtime 0.0.0' but it could not be
found
The .target file is pretty huge, so I won't paste it here unless
someone
asks. The gist of it is that it refers to several p2 repos, specifying
IUs as well as specific plugin IDs (the "Content" tab of the Target
editor in Eclipse IDE).
I've tried using the -X option to mvn in order to get more debugging
help, but it didn't yield anything that I found to be useful. Any
advice
about why Tycho seems to be ignoring the .target file, or how I can
further troubleshoot.
Thanks in advance,
Eric
_______________________________________________
tycho-user mailing list
https://dev.eclipse.org/mailman/listinfo/tycho-user
_______________________________________________
tycho-user mailing list
https://dev.eclipse.org/mailman/listinfo/tycho-user
_______________________________________________
tycho-user mailing list
https://dev.eclipse.org/mailman/listinfo/tycho-user
Rizzo, Eric
2012-11-19 23:28:32 UTC
Permalink
Post by Sievers, Jan
Post by Rizzo, Eric
a) reference the hand-written "master" pom that I have written (which
would be checked in)
So, what's the best strategy for handling this case, where we want to
leverage pom generation but it needs to refer to another pom as its
parent?
I could imagine that the pomgenerator plugin is extended to support a
custom parent (case a) above.
This would mean the restriction that all your plugin/feature/repository
pom.xml's can't be customized but if you are fine with that, I guess
that's OK.
Regards
Jan
Actually, I think that the tycho-pomgenerator-plugin was originally
designed for a POM-less build, but this approach was abandoned a while
ago.
This means that tycho-pomgenerator-plugin won't give you complete results
for the more modern Tycho features like target files. It should be
possible to extend the plugin to also cover target files (including the
eclipse-target-definition packaging type), and this would make sense, but
we would need you to do it. I don't think that the use case is important
to any of the committers, so don't expect us to implement it.
If this is an option for you, please follow the Contributor's Guide [1]
I'm working with the release/build engineer who has an existing PDE
Build-based build working, and it uses significant custom Ant scripts to
perform additional steps in front of and beyond PDE Build. After
evaluating the choices, it's likely we'll also need additional steps
beyond Tycho, so we'll probably go that route. As much as I'd like to be
"clean" (IOW, extend the pom generator to accommodate our needs), there
isn't time budget for it, unfortunately. It's too bad, because we don't
really need to customize the plugin or feature poms, just the
master/parent. I guess that's a good thing though, because maintaining
100+ individual poms would probably be a nightmare.

Thanks for the insight anyway,
Eric

Continue reading on narkive:
Loading...