BestSolution-at / e4-efxclipse-maven-sample

Sample using pure maven for e4 application
5 stars 9 forks source link

Configuration Exception When Running From Command Line #14

Closed MarceloRuiz closed 4 years ago

MarceloRuiz commented 4 years ago

Hi Tom, I filed a different bug here because this problem seems more focused. After making the sample work on Eclipse, I got the following problem when running the example from the command line:

mvn -f launch/pom.xml test -Pnetbeans -e
[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO] 
[INFO] -------------------------< sample.mvn:launch >--------------------------
[INFO] Building launch 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ launch ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /home/marcelo/git/e4-efxclipse-maven-sample/sample.mvn.parent/launch/src/main/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.8.0:compile (default-compile) @ launch ---
[INFO] No sources to compile
[INFO] 
[INFO] --- bnd-maven-plugin:3.3.0:bnd-process (default-bnd-process) @ launch ---
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ launch ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /home/marcelo/git/e4-efxclipse-maven-sample/sample.mvn.parent/launch/src/test/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.8.0:testCompile (default-testCompile) @ launch ---
[INFO] No sources to compile
[INFO] 
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ launch ---
[INFO] No tests to run.
[INFO] 
[INFO] --- maven-osgi-exec-plugin:0.0.2-SNAPSHOT:exec-osgi (default) @ launch ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  1.646 s
[INFO] Finished at: 2020-04-19T08:14:39-04:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal at.bestsolution:maven-osgi-exec-plugin:0.0.2-SNAPSHOT:exec-osgi (default) on project launch: Unable to parse configuration of mojo at.bestsolution:maven-osgi-exec-plugin:0.0.2-SNAPSHOT:exec-osgi: Cannot convert 'START' to Enum: No enum constant at.bestsolution.maven.osgi.exec.MVNBaseOSGiLaunchPlugin.Mode.START -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal at.bestsolution:maven-osgi-exec-plugin:0.0.2-SNAPSHOT:exec-osgi (default) on project launch: Unable to parse configuration of mojo at.bestsolution:maven-osgi-exec-plugin:0.0.2-SNAPSHOT:exec-osgi: Cannot convert 'START' to Enum
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:567)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: org.apache.maven.plugin.PluginConfigurationException: Unable to parse configuration of mojo at.bestsolution:maven-osgi-exec-plugin:0.0.2-SNAPSHOT:exec-osgi: Cannot convert 'START' to Enum
    at org.apache.maven.plugin.internal.DefaultMavenPluginManager.populatePluginFields (DefaultMavenPluginManager.java:665)
    at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getConfiguredMojo (DefaultMavenPluginManager.java:597)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:124)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:567)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: org.codehaus.plexus.component.configurator.ComponentConfigurationException: Cannot convert 'START' to Enum
    at org.codehaus.plexus.component.configurator.converters.basic.EnumConverter.fromConfiguration (EnumConverter.java:51)
    at org.eclipse.sisu.plexus.CompositeBeanHelper.convertProperty (CompositeBeanHelper.java:273)
    at org.eclipse.sisu.plexus.CompositeBeanHelper.setProperty (CompositeBeanHelper.java:210)
    at org.codehaus.plexus.component.configurator.converters.composite.ObjectWithFieldsConverter.processConfiguration (ObjectWithFieldsConverter.java:101)
    at org.codehaus.plexus.component.configurator.BasicComponentConfigurator.configureComponent (BasicComponentConfigurator.java:34)
    at org.apache.maven.plugin.internal.DefaultMavenPluginManager.populatePluginFields (DefaultMavenPluginManager.java:635)
    at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getConfiguredMojo (DefaultMavenPluginManager.java:597)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:124)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:567)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: java.lang.IllegalArgumentException: No enum constant at.bestsolution.maven.osgi.exec.MVNBaseOSGiLaunchPlugin.Mode.START
    at java.lang.Enum.valueOf (Enum.java:266)
    at org.codehaus.plexus.component.configurator.converters.basic.EnumConverter.fromConfiguration (EnumConverter.java:47)
    at org.eclipse.sisu.plexus.CompositeBeanHelper.convertProperty (CompositeBeanHelper.java:273)
    at org.eclipse.sisu.plexus.CompositeBeanHelper.setProperty (CompositeBeanHelper.java:210)
    at org.codehaus.plexus.component.configurator.converters.composite.ObjectWithFieldsConverter.processConfiguration (ObjectWithFieldsConverter.java:101)
    at org.codehaus.plexus.component.configurator.BasicComponentConfigurator.configureComponent (BasicComponentConfigurator.java:34)
    at org.apache.maven.plugin.internal.DefaultMavenPluginManager.populatePluginFields (DefaultMavenPluginManager.java:635)
    at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getConfiguredMojo (DefaultMavenPluginManager.java:597)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:124)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:567)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
[ERROR] 
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginConfigurationException

I tried the 0.0.3-SNAPSHOT version of the plugins, but I get exactly the same error. I also noticed the plugins do not compile with Java11. Should I file a bug? Thanks

MarceloRuiz commented 4 years ago

I just took a look to the plugin's source code and the modes were recently converted to lowercase (commit 05bc56b334e1d99cad24521d788daa4a796eee7f).

tomsontom commented 4 years ago

you are right - looks like I have not tested that change good enough

kenwenzel commented 4 years ago

This should be fixed by https://github.com/BestSolution-at/maven-osgi-plugin/pull/32

tomsontom commented 4 years ago

is pushed an update to use 0.0.3-SNAPSHOT (i published them this morning) and this should be fixed with that now. Otherwise please reopen.

Just a short notice @kenwenzel proposed to change the name of the plugins so most likely you'll be broken at some point when using the 0.0.3 snapshots - you might want to track https://github.com/BestSolution-at/maven-osgi-plugin/issues/30

MarceloRuiz commented 4 years ago

Hi Tom, Thanks for letting me know about the upcoming change in plugin names. I am trying to clean up the sample app a little bit to make it easier to upgrade when a new version of efxclipse is released. I was able to run version 3.6.0 with no issues, and I was thinking of using properties to keep versions consistent through the whole application and reduce some of the warnings during build time. I tried to give the properties a name that will make it easy to identify them. I noticed the same version number is used for a group of properties (like 11.0.0 for many openfx versions). Does it make sense to have multiple properties or should they be replaced by a single one? Here is the draft I am using:

<properties>
    <!-- General Project Properties -->
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

    <!-- External Tools Properties -->
    <bnd-bnd-maven-plugin-version>5.0.1</bnd-bnd-maven-plugin-version>
    <m2e-lifecycle-mapping-version>1.0.0</m2e-lifecycle-mapping-version>

    <!-- OSGi Properties -->
    <osgi-org.osgi.service.component.annotations-version>1.3.0</osgi-org.osgi.service.component.annotations-version>
    <osgi.qualifier>${maven.build.timestamp}</osgi.qualifier>

    <!-- BestSolution/Efxclipse Properties -->
    <bestsolution-maven-osgi-exec-plugin-version>0.0.3-SNAPSHOT</bestsolution-maven-osgi-exec-plugin-version>
    <bestsolution-maven-osgi-package-plugin-version>0.0.3-SNAPSHOT</bestsolution-maven-osgi-package-plugin-version>
    <efxclipse.rt-org.eclipse.equinox.executable-version>3.8.100-SNAPSHOT</efxclipse.rt-org.eclipse.equinox.executable-version>
    <org.eclipse.fx.ui.workbench.fx.application-version>1.0.0</org.eclipse.fx.ui.workbench.fx.application-version>

    <!-- OpenJFX Properties -->
    <openjfx-javafx-controls-version>11</openjfx-javafx-controls-version>
    <openjfx-openjfx.base-version>11.0.0</openjfx-openjfx.base-version>
    <openjfx-openjfx.controls-version>11.0.0</openjfx-openjfx.controls-version>
    <openjfx-openjfx.graphics.linux_64-version>11.0.0</openjfx-openjfx.graphics.linux_64-version>
    <openjfx-openjfx.graphics.mac-version>11.0.0</openjfx-openjfx.graphics.mac-version>
    <openjfx-openjfx.graphics.win32_64-version>11.0.0</openjfx-openjfx.graphics.win32_64-version>
    <openjfx-openjfx.standard.feature-version>11.0.0</openjfx-openjfx.standard.feature-version>

    <!-- Maven Properties -->
    <maven.build.timestamp.format>yyyyMMddHHmm</maven.build.timestamp.format>
    <maven.plugins-maven-compiler-plugin-version>3.8.0</maven.plugins-maven-compiler-plugin-version>
    <maven.plugins-maven-compiler-plugin.source>11</maven.plugins-maven-compiler-plugin.source>
    <maven.plugins-maven-compiler-plugin.target>11</maven.plugins-maven-compiler-plugin.target>
    <maven.plugins-maven-jar-plugin.version>3.1.0</maven.plugins-maven-jar-plugin.version>

    <!-- Tycho Properties -->
    <tycho-target-platform-configuration-version>1.2.0</tycho-target-platform-configuration-version>
    <tycho-tycho-maven-plugin-version>1.2.0</tycho-tycho-maven-plugin-version>
    <tycho-tycho-p2-director-plugin-version>1.2.0</tycho-tycho-p2-director-plugin-version>
</properties>

I also created a sh script that automates initializing the maven repository. If you think this is a good idea and once we decide on the names of the properties, I will create a new branch for you to review it. Thanks!

tomsontom commented 4 years ago

Go forward and provide a PR that makes it easier to comment

MarceloRuiz commented 4 years ago

Do you need to invite me as a contributor? I tried to create a new working branch and I get an error saying that git-receive-pack is not permitted.

tomsontom commented 4 years ago

Github workflow is to fork the repo to your own user account and do the work there and provide a PR