Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » Building feature with tycho and bundle importing javafx packages
Building feature with tycho and bundle importing javafx packages [message #1398121] Thu, 10 July 2014 16:54 Go to next message
Łukasz Drąg is currently offline Łukasz DrągFriend
Messages: 10
Registered: July 2009
Junior Member
I am just trying to use tycho to create a feature containing a bundle that uses JavaFX. The bundle makes use of JavaFX api through Import-Package.
Some extracts from my pom:

	<groupId>x.y.ext</groupId>
	<artifactId>x.y.ext.feature</artifactId>
	<packaging>eclipse-feature</packaging>
	<version>0.0.1-SNAPSHOT</version>

        <properties>
		<tycho.version>0.20.0</tycho.version>
		<tycho-extras.version>${tycho.version}</tycho-extras.version>
	</properties>

	<build>
		<plugins>
			<plugin>
				<groupId>org.eclipse.tycho</groupId>
				<artifactId>tycho-packaging-plugin</artifactId>
				<version>${tycho.version}</version>
			</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>target-platform-configuration</artifactId>
				<version>${tycho.version}</version>
				<configuration>
					<pomDependencies>consider</pomDependencies>
					<executionEnvironment>JavaSE-1.8</executionEnvironment>
				</configuration>
  			</plugin>
		</plugins>
	</build>

	 <dependencies>
		<dependency>
			<groupId>com.fxparts</groupId>
			<artifactId>fxpart</artifactId>
			<version>1.0.0.ea2</version>
		</dependency>
	</dependencies> 


Unfortunately the build always fails as JavaFX packages cannot be resolved. Parts of the the maven build log run with "-Dtycho.debug.resolver=true -X" show the exact problem:

...
[INFO] Computing target platform for MavenProject: x.y.ext:x.y.ext.feature:0.0.1-SNAPSHOT @ C:\prj\tmp\x.y.ext.feature\pom.xml
[DEBUG] P2resolver.addMavenArtifact com.fxparts:fxpart:jar:1.0.0.ea2:compile
[DEBUG] P2Resolver: artifact com.fxparts:fxpart:1.0.0.ea2 at location C:\Users\ldrag\.m2\repository\com\fxparts\fxpart\1.0.0.ea2\fxpart-1.0.0.ea2.jar resolves installable unit fxpart/1.0.0.ea2
[DEBUG] Using execution environment 'JavaSE-1.8' configured in target-platform-configuration <executionEnvironment>
[DEBUG] Registered artifact repository org.eclipse.tycho.repository.registry.facade.RepositoryBlackboardKey(uri=file:/resolution-context-artifacts@C:%5Cprj%5Ctmp%5Cx.y.ext.feature)
[DEBUG] Added 0 locally built units to the target platform
[INFO] Resolving dependencies of MavenProject: x.y.ext:x.y.ext.feature:0.0.1-SNAPSHOT @ C:\prj\tmp\x.y.ext.feature\pom.xml
[DEBUG] Properties: {osgi.os=win32, org.eclipse.update.install.features=true, osgi.arch=x86_64, osgi.ws=win32}
[DEBUG] Available IUs:
  x.y.ext.feature.feature.group 0.0.1.qualifier
  fxpart 1.0.0.ea2
  config.a.jre.javase 1.8.0
  a.jre.javase 1.8.0

[DEBUG] JRE IUs:
  config.a.jre.javase 1.8.0
  a.jre.javase 1.8.0

[DEBUG] Root IUs:
<?xml version='1.0' encoding='UTF-8'?>
<units size='1'>
  <unit id='x.y.ext.feature.feature.group' version='0.0.1.qualifier' singleton='false'>
    <properties size='5'>
      <property name='org.eclipse.equinox.p2.type.group' value='true'/>
      <property name='org.eclipse.tycho.p2.includedIUs' value='fxpart'/>
      <property name='maven-groupId' value='x.y.ext'/>
      <property name='maven-artifactId' value='x.y.ext.feature'/>
      <property name='maven-version' value='0.0.1-SNAPSHOT'/>
    </properties>
    <provides size='2'>
      <provided namespace='org.eclipse.update.feature' name='x.y.ext.feature' version='0.0.1.qualifier'/>
      <provided namespace='org.eclipse.equinox.p2.iu' name='x.y.ext.feature.feature.group' version='0.0.1.qualifier'/>
    </provides>
    <requires size='1'>
      <required namespace='org.eclipse.equinox.p2.iu' name='fxpart' range='[1.0.0.ea2,1.0.0.ea2]'/>
    </requires>
    <touchpoint id='null' version='0.0.0'/>
  </unit>
</units>

[DEBUG] Slice:
  x.y.ext.feature.feature.group 0.0.1.qualifier
  a.jre.javase 1.8.0
  config.a.jre.javase 1.8.0
  fxpart 1.0.0.ea2

[INFO] Cannot complete the request.  Generating details.
[INFO] Cannot complete the request.  Generating details.
[INFO] {osgi.os=win32, osgi.ws=win32, org.eclipse.update.install.features=true, osgi.arch=x86_64}
[ERROR] Cannot resolve project dependencies:
[ERROR]   Software being installed: x.y.ext.feature.feature.group 0.0.1.qualifier
[ERROR]   Missing requirement: fxpart 1.0.0.ea2 requires 'package com.sun.javafx 0.0.0' but it could not be found
[ERROR]   Cannot satisfy dependency: x.y.ext.feature.feature.group 0.0.1.qualifier depends on: fxpart [1.0.0.ea2]
[ERROR] 
[ERROR] Internal error: java.lang.RuntimeException: No solution found because the problem is unsatisfiable.: [Unable to satisfy dependency from fxpart 1.0.0.ea2 to package com.sun.javafx 0.0.0.; 
....


I've googled out Tom's post about reconfiguring the tycho-compiler to make it use newer (Java 8 enabled) JDT but as far as I understand this is not my case as I do not want to compile anything but just to package a bundle into a feature.
Am I missing JavaFX in the target platform? If so does anybody know a trick how to put it there?

regards,
Łukasz
Re: Building feature with tycho and bundle importing javafx packages [message #1398223 is a reply to message #1398121] Thu, 10 July 2014 20:21 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
JavaFX packages are not part of ANY EE so what we have in our p2 repo is
a fake bundle you should package with your feature who exports those
bundles.

Simply include:
* org.eclipse.fx.javafx
* org.eclipse.fx.osgi

And everything will resolve just fine ;-)

Tom

On 10.07.14 18:54, Łukasz Drąg wrote:
> I am just trying to use tycho to create a feature containing a bundle
> that uses JavaFX. The bundle makes use of JavaFX api through
> Import-Package.
> Some extracts from my pom:
>
> <groupId>x.y.ext</groupId>
> <artifactId>x.y.ext.feature</artifactId>
> <packaging>eclipse-feature</packaging>
> <version>0.0.1-SNAPSHOT</version>
>
> <properties>
> <tycho.version>0.20.0</tycho.version>
> <tycho-extras.version>${tycho.version}</tycho-extras.version>
> </properties>
>
> <build>
> <plugins>
> <plugin>
> <groupId>org.eclipse.tycho</groupId>
> <artifactId>tycho-packaging-plugin</artifactId>
> <version>${tycho.version}</version>
> </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>target-platform-configuration</artifactId>
> <version>${tycho.version}</version>
> <configuration>
> <pomDependencies>consider</pomDependencies>
> <executionEnvironment>JavaSE-1.8</executionEnvironment>
> </configuration>
> </plugin>
> </plugins>
> </build>
>
> <dependencies>
> <dependency>
> <groupId>com.fxparts</groupId>
> <artifactId>fxpart</artifactId>
> <version>1.0.0.ea2</version>
> </dependency>
> </dependencies>
> Unfortunately the build always fails as JavaFX packages cannot be
> resolved. Parts of the the maven build log run with
> "-Dtycho.debug.resolver=true -X" show the exact problem:
>
>
> ..
> Computing target platform for MavenProject:
> x.y.ext:x.y.ext.feature:0.0.1-SNAPSHOT @ C:\prj\tmp\x.y.ext.feature\pom.xml
> P2resolver.addMavenArtifact
> com.fxparts:fxpart:jar:1.0.0.ea2:compile
> P2Resolver: artifact com.fxparts:fxpart:1.0.0.ea2 at location
> C:\Users\ldrag\.m2\repository\com\fxparts\fxpart\1.0.0.ea2\fxpart-1.0.0.ea2.jar
> resolves installable unit fxpart/1.0.0.ea2
> Using execution environment 'JavaSE-1.8' configured in
> target-platform-configuration <executionEnvironment>
> Registered artifact repository
> org.eclipse.tycho.repository.registry.facade.RepositoryBlackboardKey(uri=file:/resolution-context-artifacts@C:%5Cprj%5Ctmp%5Cx.y.ext.feature)
>
> Added 0 locally built units to the target platform
> Resolving dependencies of MavenProject:
> x.y.ext:x.y.ext.feature:0.0.1-SNAPSHOT @ C:\prj\tmp\x.y.ext.feature\pom.xml
> Properties: {osgi.os=win32,
> org.eclipse.update.install.features=true, osgi.arch=x86_64, osgi.ws=win32}
> Available IUs:
> x.y.ext.feature.feature.group 0.0.1.qualifier
> fxpart 1.0.0.ea2
> config.a.jre.javase 1.8.0
> a.jre.javase 1.8.0
>
> JRE IUs:
> config.a.jre.javase 1.8.0
> a.jre.javase 1.8.0
>
> Root IUs:
> <?xml version='1.0' encoding='UTF-8'?>
> <units size='1'>
> <unit id='x.y.ext.feature.feature.group' version='0.0.1.qualifier'
> singleton='false'>
> <properties size='5'>
> <property name='org.eclipse.equinox.p2.type.group' value='true'/>
> <property name='org.eclipse.tycho.p2.includedIUs' value='fxpart'/>
> <property name='maven-groupId' value='x.y.ext'/>
> <property name='maven-artifactId' value='x.y.ext.feature'/>
> <property name='maven-version' value='0.0.1-SNAPSHOT'/>
> </properties>
> <provides size='2'>
> <provided namespace='org.eclipse.update.feature'
> name='x.y.ext.feature' version='0.0.1.qualifier'/>
> <provided namespace='org.eclipse.equinox.p2.iu'
> name='x.y.ext.feature.feature.group' version='0.0.1.qualifier'/>
> </provides>
> <requires size='1'>
> <required namespace='org.eclipse.equinox.p2.iu' name='fxpart'
> range=''/>
> </requires>
> <touchpoint id='null' version='0.0.0'/>
> </unit>
> </units>
>
> Slice:
> x.y.ext.feature.feature.group 0.0.1.qualifier
> a.jre.javase 1.8.0
> config.a.jre.javase 1.8.0
> fxpart 1.0.0.ea2
>
> Cannot complete the request. Generating details.
> Cannot complete the request. Generating details.
> {osgi.os=win32, osgi.ws=win32,
> org.eclipse.update.install.features=true, osgi.arch=x86_64}
> Cannot resolve project dependencies:
> Software being installed: x.y.ext.feature.feature.group
> 0.0.1.qualifier
> Missing requirement: fxpart 1.0.0.ea2 requires 'package
> com.sun.javafx 0.0.0' but it could not be found
> Cannot satisfy dependency: x.y.ext.feature.feature.group
> 0.0.1.qualifier depends on: fxpart
> [ERROR] [ERROR] Internal error: java.lang.RuntimeException: No solution
> found because the problem is unsatisfiable.: [Unable to satisfy
> dependency from fxpart 1.0.0.ea2 to package com.sun.javafx 0.0.0.; ...
>
>
> I've googled out Tom's post about reconfiguring the tycho-compiler to
> make it use newer (Java 8 enabled) JDT but as far as I understand this
> is not my case as I do not want to compile anything but just to package
> a bundle into a feature. Am I missing JavaFX in the target platform? If
> so does anybody know a trick how to put it there?
>
> regards,
> Łukasz
Re: Building feature with tycho and bundle importing javafx packages [message #1398593 is a reply to message #1398223] Fri, 11 July 2014 09:38 Go to previous message
Łukasz Drąg is currently offline Łukasz DrągFriend
Messages: 10
Registered: July 2009
Junior Member
Thomas Schindl wrote on Thu, 10 July 2014 16:21

And everything will resolve just fine Wink

Indeed. It works perfect.
Thanks a lot!
Previous Topic:DnD doesn't work when tab-position of MPartStack is bottom
Next Topic:e4 programmatic part show/hide
Goto Forum:
  


Current Time: Thu Apr 25 22:09:21 GMT 2024

Powered by FUDForum. Page generated in 0.03065 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top