Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tycho-user] Forking in combination with BREE (Re: should <showWarnings>false</showWarnings> work?)

i finally figured it out why i had so many problems with BREE
so for anybody that has the same thing i hope google will pick this up

i had 2 quite simple plugin kind of projects, they are more plugins because they are used by "real" eclipse plugins
but 1 of them is a bit bigger uses one or 2 other plugins. So that one has in its pom file a p2 repository so using this:


when i did add <useJDK>BREE</useJDK>

it worked for that one 

but the other project is much simpler that doesn't have any repo to build, it doesn't have any plugin dependencies
This works fine for building with tycho

But at the moment you add  <useJDK>BREE</useJDK> and JAVA_HOME (that maven uses to run) is not java8 but already java12 or something like that.
then i still get that error that JavaSE-12 execution environment is not found, even if everything is correctly configured to use JavaSE-1.8

but with -X i looked carefully what now the difference is.. this happens with the one that goes wrong:

[INFO] Computing target platform for MavenProject: com.servoy:org.eclipse.dltk._javascript_.rhino:2019.12.0.3540_rc @ C:\Users\jcomp\git\servoy_master\servoy-js-engine\org.eclipse.dltk._javascript_.rhino\pom.xml
[DEBUG] Using execution environment 'JavaSE-1.8' configured in Bundle-RequiredExecutionEnvironment (first entry)
[DEBUG] Registered artifact repository org.eclipse.tycho.repository.registry.facade.RepositoryBlackboardKey(uri=file:/resolution-context-artifacts@C%253A%255CUsers%255Cjcomp%255Cgit%255Cservoy_master%255Cservoy-js-engine%255Corg.eclipse.dltk._javascript_.rhino)
[DEBUG] Added 10 locally built units to the target platform
[INFO] Resolving dependencies of MavenProject: com.servoy:org.eclipse.dltk._javascript_.rhino:2019.12.0.3540_rc @ C:\Users\jcomp\git\servoy_master\servoy-js-engine\org.eclipse.dltk._javascript_.rhino\pom.xml
[DEBUG] Using execution environment 'JavaSE-12' configured in current execution environment
[DEBUG] Registered artifact repository org.eclipse.tycho.repository.registry.facade.RepositoryBlackboardKey(uri=file:/resolution-context-artifacts@C%253A%255CUsers%255Cjcomp%255Cgit%255Cservoy_master%255Cservoy-js-engine%255Corg.eclipse.dltk._javascript_.rhino)
[DEBUG] Added 10 locally built units to the target platform
[ERROR] Internal error: java.lang.IllegalArgumentException: Could not find specification for custom execution environment profile 'JavaSE-12' in the target platform -> [Help 1]
org.apache.maven.InternalErrorException: Internal error: java.lang.IllegalArgumentException: Could not find specification for custom execution environment profile 'JavaSE-12' in the target platform
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:120)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (Unknown Source)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (Unknown Source)
    at java.lang.reflect.Method.invoke (Unknown Source)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
Caused by: java.lang.IllegalArgumentException: Could not find specification for custom execution environment profile 'JavaSE-12' in the target platform
    at org.eclipse.tycho.p2.target.ee.CustomEEResolutionHandler.findSpecificationUnit (CustomEEResolutionHandler.java:49)
    at org.eclipse.tycho.p2.target.ee.CustomEEResolutionHandler.readFullSpecification (CustomEEResolutionHandler.java:38)
    at org.eclipse.tycho.p2.target.TargetPlatformFactoryImpl.createTargetPlatform (TargetPlatformFactoryImpl.java:200)
    at org.eclipse.tycho.p2.target.TargetPlatformFactoryImpl.createTargetPlatform (TargetPlatformFactoryImpl.java:128)
    at org.eclipse.tycho.p2.target.TargetPlatformFactoryImpl.createTargetPlatform (TargetPlatformFactoryImpl.java:1)
    at org.eclipse.tycho.p2.manager.ReactorRepositoryManagerImpl.computePreliminaryTargetPlatform (ReactorRepositoryManagerImpl.java:84)
    at org.eclipse.tycho.p2.resolver.P2DependencyResolver.computePreliminaryTargetPlatform (P2DependencyResolver.java:224)
    at org.eclipse.tycho.core.resolver.DefaultTychoResolver.resolveWithCurrentEE (DefaultTychoResolver.java:199)
    at org.eclipse.tycho.core.resolver.DefaultTychoResolver.resolveProject (DefaultTychoResolver.java:124)
    at org.eclipse.tycho.core.maven.TychoMavenLifecycleParticipant.afterProjectsRead (TychoMavenLifecycleParticipant.java:95)



the one that works:


[INFO] Computing target platform for MavenProject: com.servoy:org.eclipse.dltk._javascript_.rhino:2019.12.0.3540_rc @ C:\Users\jcomp\git\servoy_master\servoy-js-engine\org.eclipse.dltk._javascript_.rhino\pom.xml
[DEBUG] Added p2 repository servoy (http://download.eclipse.org/eclipse/updates/4.13/)
[DEBUG] Using execution environment 'JavaSE-1.8' configured in Bundle-RequiredExecutionEnvironment (first entry)
[DEBUG] Registered artifact repository org.eclipse.tycho.repository.registry.facade.RepositoryBlackboardKey(uri=file:/resolution-context-artifacts@C%253A%255CUsers%255Cjcomp%255Cgit%255Cservoy_master%255Cservoy-js-engine%255Corg.eclipse.dltk._javascript_.rhino)
[INFO] Fetching p2.index from http://download.eclipse.org/eclipse/updates/4.13/
[INFO] Adding repository http://download.eclipse.org/eclipse/updates/4.13
[INFO] Fetching p2.index from http://download.eclipse.org/eclipse/updates/4.13/R-4.13-201909161045/
[INFO] Fetching p2.index from http://download.eclipse.org/eclipse/updates/4.13/R-4.13-201909161045/
[DEBUG] Added 10 locally built units to the target platform
[INFO] Resolving dependencies of MavenProject: com.servoy:org.eclipse.dltk._javascript_.rhino:2019.12.0.3540_rc @ C:\Users\jcomp\git\servoy_master\servoy-js-engine\org.eclipse.dltk._javascript_.rhino\pom.xml
[DEBUG] Added p2 repository servoy (http://download.eclipse.org/eclipse/updates/4.13/)
[DEBUG] Using execution environment 'JavaSE-12' configured in current execution environment
[DEBUG] Registered artifact repository org.eclipse.tycho.repository.registry.facade.RepositoryBlackboardKey(uri=file:/resolution-context-artifacts@C%253A%255CUsers%255Cjcomp%255Cgit%255Cservoy_master%255Cservoy-js-engine%255Corg.eclipse.dltk._javascript_.rhino)
[DEBUG] Added 10 locally built units to the target platform
[WARNING] The following locally built units have been used to resolve project dependencies:
[WARNING]   org.eclipse.dltk._javascript_.rhino/2019.12.0.3540_rc
[INFO] Resolving class path of MavenProject: com.servoy:org.eclipse.dltk._javascript_.rhino:2019.12.0.3540_rc @ C:\Users\jcomp\git\servoy_master\servoy-js-engine\org.eclipse.dltk._javascript_.rhino\pom.xml

and then it starts to compile fine.

So it seems that it needs to have a eclipse update site to get to some Execution environment
But both are saying 

  [DEBUG] Using execution environment 'JavaSE-12' configured in current execution environment 

but i wonder what that is really about.. that seems to be something for that target platform.
It seems the compiler really uses something else. because if i make a type on the toolchain.xml and let it run again
Then the output above is the same..

But the compiler bombs out: (it seems to be nicely configured)


[DEBUG] Configuring mojo org.eclipse.tycho:tycho-compiler-plugin:1.4.0:compile from plugin realm ClassRealm[plugin>org.eclipse.tycho:tycho-compiler-plugin:1.4.0, parent: jdk.internal.loader.ClassLoaders$AppClassLoader@612fdc8c]
[DEBUG] Configuring mojo 'org.eclipse.tycho:tycho-compiler-plugin:1.4.0:compile' with basic configurator -->
[DEBUG]   (f) basedir = C:\Users\jcomp\git\servoy_master\servoy-js-engine\org.eclipse.dltk._javascript_.rhino
[DEBUG]   (f) buildDirectory = C:\Users\jcomp\git\servoy_master\servoy-js-engine\org.eclipse.dltk._javascript_.rhino\target
[DEBUG]   (f) compilerId = jdt
[DEBUG]   (f) copyResources = true
[DEBUG]   (f) debug = true
[DEBUG]   (f) encoding = UTF-8
[DEBUG]   (f) fork = false
[DEBUG]   (f) generatedSourcesDirectory = C:\Users\jcomp\git\servoy_master\servoy-js-engine\org.eclipse.dltk._javascript_.rhino\target\generated-sources\annotations
[DEBUG]   (f) logDirectory = C:\Users\jcomp\git\servoy_master\servoy-js-engine\org.eclipse.dltk._javascript_.rhino\target\compile-logs
[DEBUG]   (f) optimize = false
[DEBUG]   (f) outputFileName = org.eclipse.dltk._javascript_.rhino-2019.12.0.3540_rc
[DEBUG]   (f) project = MavenProject: com.servoy:org.eclipse.dltk._javascript_.rhino:2019.12.0.3540_rc @ C:\Users\jcomp\git\servoy_master\servoy-js-engine\org.eclipse.dltk._javascript_.rhino\pom.xml
[DEBUG]   (f) requireJREPackageImports = false
[DEBUG]   (f) session = org.apache.maven.execution.MavenSession@e6f1dd8c
[DEBUG]   (f) showDeprecation = false
[DEBUG]   (f) showWarnings = false
[DEBUG]   (f) source = 1.8
[DEBUG]   (f) staleMillis = 0
[DEBUG]   (f) strictCompilerTarget = false
[DEBUG]   (f) target = 1.8
[DEBUG]   (f) useJDK = BREE
[DEBUG]   (f) useProjectSettings = true
[DEBUG]   (f) verbose = false
[DEBUG] -- end configuration --
[DEBUG] Manifest BREEs: [OSGi profile 'JavaSE-1.8' { source level: 1.8, target level: 1.8}]
[DEBUG] Effective EE: OSGi profile 'JavaSE-1.8' { source level: 1.8, target level: 1.8}
[DEBUG] Effective source/target: 1.8/1.8
[DEBUG] Using compiler 'jdt'.
[DEBUG] Source directories: [C:\Users\jcomp\git\servoy_master\servoy-js-engine\org.eclipse.dltk._javascript_.rhino\src]
[DEBUG] Classpath: [C:\Users\jcomp\git\servoy_master\servoy-js-engine\org.eclipse.dltk._javascript_.rhino\target\classes]
[DEBUG] Output directory: C:\Users\jcomp\git\servoy_master\servoy-js-engine\org.eclipse.dltk._javascript_.rhino\target\classes
[DEBUG] Toolchain JDK[c:/javatools/jdk18/] doesn't match required property: id


[ERROR] Failed to execute goal org.eclipse.tycho:tycho-compiler-plugin:1.4.0:compile (default-compile) on project org.eclipse.dltk._javascript_.rhino: useJDK = BREE configured, but no toolchain of type 'jdk' with id 'JavaSE-1.8' found. See http://maven.apache.org/guides/mini/guide-using-toolchains.html -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.eclipse.tycho:tycho-compiler-plugin:1.4.0:compile (default-compile) on project org.eclipse.dltk._javascript_.rhino: useJDK = BREE configured, but no toolchain of type 'jdk' with id 'JavaSE-1.8' found. See http://maven.apache.org/guides/mini/guide-using-toolchains.html

and when that is correct and i see this:
INFO] Compiling 327 source files to C:\Users\jcomp\git\servoy_master\servoy-js-engine\org.eclipse.dltk._javascript_.rhino\target\classes
[DEBUG] JDT compiler args: 

and I analyse the args then that is correct it compiles against the jdk1.8 classpath

also I see that -warn:none is added to the compiler args but still it gives me loads of warnings

so it seems that is not a tycho problem but somewhere a configuration or jdk compiler problem?










 





On Tue, 15 Oct 2019 at 10:55, Johan Compagner <jcompagner@xxxxxxxxxx> wrote:
phhh, thx..

that did fix the problem of not finding the toolchain, i don't get it i thought i copied it straight from the manifest.mf

but now i am back that it fails with "compileoutOfProcess not supported"

and without the fork param but with:

 <showWarnings>false</showWarnings>
<compilerArgument>-warn:none</compilerArgument>

it still gives all the warnings..

but at least now it doesn't matter what JAVA_HOME is and where you run Maven with.



On Tue, 15 Oct 2019 at 10:23, Christoph Läubrich <laeubi@xxxxxxxxxxxxxx> wrote:
I don't know much about the compiler stuff, just noticed that the error
complains about:

JavaSE-1.8 not found

and in the xml the id is 'JavaSE-8' may thats a problem?

Am 15.10.19 um 10:17 schrieb Johan Compagner:
> Hi,
>
> i tried a few things more to get my warnings out and playing with useJDK
> I have to seem to be missing some docs.. or the docs really needs to be
> updated of the compiler plugin, for example fork:
>
> https://www.eclipse.org/tycho/sitedocs/tycho-compiler-plugin/compile-mojo.html#fork
>
>
>   there is nothing that says there in the docs that that needs some more
> stuff
> Because if you just enabled that you will get:
>
>   Failed to execute goal
> org.eclipse.tycho:tycho-compiler-plugin:1.4.0:compile (default-compile)
> on project servoy_base: Fatal error compiling: compileoutOfProcess not
> supported -> [Help 1]
>
> Then i though hmm maybe this will work with <useJDK>BREE</useJDK> that
> we then will fork out, if i also add that:
>
> [ERROR] Failed to execute goal
> org.eclipse.tycho:tycho-compiler-plugin:1.4.0:compile (default-compile)
> on project servoy_base: useJDK = BREE configured, but no toolchain of
> type 'jdk' with id 'JavaSE-1.8' found. See
> http://maven.apache.org/guides/mini/guide-using-toolchains.html -> [Help 1]
>
>
> But as far as i know i have it all configured, i have a toolchains.xml
> file in my .m2 dir:
>
> <toolchains>
>    <!-- JDK toolchains -->
>    <toolchain>
>         <type>jdk</type>
>         <provides>
>          <id>JavaSE-8</id>
>         </provides>
>         <configuration>
>          <jdkHome>c:/javatools/jdk18/</jdkHome>
>         </configuration>
>    </toolchain>
> </toolchains>
>
> i have then also enabled the toolchain plugin:
>
> <plugin>
> <groupId>org.apache.maven.plugins</groupId>
> <artifactId>maven-toolchains-plugin</artifactId>
> <version>3.0.0</version>
> <executions>
> <execution>
> <goals>
> <goal>toolchain</goal>
> </goals>
> </execution>
> </executions>
> <configuration>
> <toolchains>
> <jdk>
> <id>JavaSE-8</id>
> </jdk>
> </toolchains>
> </configuration>
> </plugin>
>
> the output of that plugin says that it did find it:
>
> [INFO] --- maven-toolchains-plugin:3.0.0:toolchain (default) @
> servoy_base ---
> [INFO] Required toolchain: jdk [ id='JavaSE-8' ]
> [INFO] Found matching toolchain for type jdk: JDK[c:/javatools/jdk18/]
>
>
> But still i get the error above...
>
> So how is this supposed to work?
> What steps am i missing here?
>
> Johan
>
>
> On Mon, 14 Oct 2019 at 18:22, Johan Compagner <jcompagner@xxxxxxxxxx
> <mailto:jcompagner@xxxxxxxxxx>> wrote:
>
>     Hi,
>
>     i have this:
>
>          <groupId>org.eclipse.tycho</groupId>
>     <artifactId>tycho-compiler-plugin</artifactId>
>     <version>${tycho.version}</version>
>     <configuration>
>     <showWarnings>false</showWarnings>
>     xxxx
>
>     but it will show warnings no matter what
>
>     i also tried to run with:
>
>     mvn clean install -Dmaven.compiler.showWarnings=false
>
>     but still a lot of warnings..
>
>
>     The same thing is that i can't get that <useJDK> to work
>
>     i have added this in my toolchains.xml file:
>
>     <toolchain>
>             <type>jdk</type>
>             <provides>
>             <id>JavaSE-8</id>
>             </provides>
>             <configuration>
>             <jdkHome>c:/javatools/jdk18/</jdkHome>
>             </configuration>
>        </toolchain>
>
>     and then use
>
>     <useJDK>BREE</useJDK>
>
>     in the configuration of the tycho compiler plugin
>
>     and in the manifest i do have:
>
>     Bundle-RequiredExecutionEnvironment: JavaSE-1.8
>
>     But no matter what if i then run maven (java.home property) with java12
>     it will start to complain it can't find or use it:
>
>     Could not find specification for custom execution environment
>     profile 'JavaSE-12'
>
>     also the -X of maven doesn't really tell that much, i had hopped for
>     a bit more output of the compiler plugin..
>
>
>     --
>     Johan Compagner
>     Servoy
>
>
>
> --
> Johan Compagner
> Servoy
>
> _______________________________________________
> tycho-user mailing list
> tycho-user@xxxxxxxxxxx
> To change your delivery options, retrieve your password, or unsubscribe from this list, visit
> https://www.eclipse.org/mailman/listinfo/tycho-user
>
_______________________________________________
tycho-user mailing list
tycho-user@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/tycho-user


--
Johan Compagner
Servoy


--
Johan Compagner
Servoy

Back to the top