Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tycho-user] Problem getting Tycho to use a local .target file

On 11/16/12 12:20 PM, "David Carver" <d_a_carver@xxxxxxxxx> wrote:

>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.



>
>On 11/16/2012 11:42 AM, Rizzo, Eric wrote:
>> 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
>>
>>
>> On 11/16/12 2:42 AM, "Sievers, Jan" <jan.sievers@xxxxxxx> wrote:
>>
>>> 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-bounces@xxxxxxxxxxx
>>> [mailto:tycho-user-bounces@xxxxxxxxxxx] On Behalf Of Rizzo, Eric
>>> Sent: Donnerstag, 15. November 2012 19:43
>>> To: tycho-user@xxxxxxxxxxx
>>> 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-mave
>>>n-
>>> 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
>>>
>>> _______________________________________________
>>> tycho-user mailing list
>>> tycho-user@xxxxxxxxxxx
>>> https://dev.eclipse.org/mailman/listinfo/tycho-user
>>>
>> _______________________________________________
>> tycho-user mailing list
>> tycho-user@xxxxxxxxxxx
>> https://dev.eclipse.org/mailman/listinfo/tycho-user
>
>_______________________________________________
>tycho-user mailing list
>tycho-user@xxxxxxxxxxx
>https://dev.eclipse.org/mailman/listinfo/tycho-user
>



Back to the top