robotframework-SikuliLibrary icon indicating copy to clipboard operation
robotframework-SikuliLibrary copied to clipboard

[Mac] Unable to build with Maven

Open cplus02 opened this issue 6 years ago • 16 comments

Environment

OS: macOS Mojave Python: Python 3.7.2 / virtualenv JDK: JDK8 update201 SikuliLibrary: Latest source code from GitHub, built with maven on macOS Mojave, run setup.py to install

Description

Unable to build with Maven, log:

[ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] /Users/hideman/Downloads/robotframework-SikuliLibrary-master/src/java/com/github/rainmanwy/robotframework/sikulilib/keywords/ApplicationKeywords.java:[27,25] incompatible types: boolean cannot be converted to org.sikuli.script.App
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  4.138 s
[INFO] Finished at: 2019-01-26T02:12:36+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project robotframework-SikuliLibrary: Compilation failure
[ERROR] /Users/hideman/Downloads/robotframework-SikuliLibrary-master/src/java/com/github/rainmanwy/robotframework/sikulilib/keywords/ApplicationKeywords.java:[27,25] incompatible types: boolean cannot be converted to org.sikuli.script.App
[ERROR] 
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[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/MojoFailureException

cplus02 avatar Jan 25 '19 18:01 cplus02

Hi all, This is also true for Windows, same error message.

cplus02 avatar Jan 29 '19 10:01 cplus02

Hi, i confirm this issue on windows7.

elyess78 avatar Jan 29 '19 15:01 elyess78

Could anyone attach the exception stack(with -X option to execute maven). I check this on my Linux, looks ok.

rainmanwy avatar Feb 02 '19 08:02 rainmanwy

I am having the same issue on macOS 10.14.2 with java version "1.8.0_201". Here is the output of mvn -X install mvn-output.txt

[DEBUG] incrementalBuildHelper#beforeRebuildExecution [INFO] Compiling 7 source files to /Users/peter/robotframework-SikuliLibrary/target/classes [DEBUG] incrementalBuildHelper#afterRebuildExecution [INFO] ------------------------------------------------------------- [ERROR] COMPILATION ERROR : [INFO] ------------------------------------------------------------- [ERROR] /Users/peter/robotframework-SikuliLibrary/src/java/com/github/rainmanwy/robotframework/sikulilib/keywords/ApplicationKeywords.java:[27,25] incompatible types: boolean cannot be converted to org.sikuli.script.App [INFO] 1 error [INFO] ------------------------------------------------------------- [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 7.899 s [INFO] Finished at: 2019-02-20T10:02:19-05:00 [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project robotframework-SikuliLibrary: Compilation failure [ERROR] /Users/peter/robotframework-SikuliLibrary/src/java/com/github/rainmanwy/robotframework/sikulilib/keywords/ApplicationKeywords.java:[27,25] incompatible types: boolean cannot be converted to org.sikuli.script.App [ERROR] [ERROR] -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project robotframework-SikuliLibrary: Compilation failure /Users/peter/robotframework-SikuliLibrary/src/java/com/github/rainmanwy/robotframework/sikulilib/keywords/ApplicationKeywords.java:[27,25] incompatible types: boolean cannot be converted to org.sikuli.script.App

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:956)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:498)
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: org.apache.maven.plugin.compiler.CompilationFailureException: Compilation failure /Users/peter/robotframework-SikuliLibrary/src/java/com/github/rainmanwy/robotframework/sikulilib/keywords/ApplicationKeywords.java:[27,25] incompatible types: boolean cannot be converted to org.sikuli.script.App

at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute (AbstractCompilerMojo.java:858)
at org.apache.maven.plugin.compiler.CompilerMojo.execute (CompilerMojo.java:129)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
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:956)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:498)
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)

[ERROR] [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/MojoFailureException

cpk011 avatar Feb 20 '19 15:02 cpk011

Could you confirm which version of sikulixapi jar in your local maven repo.

In my env, i am using "/com/sikulix/sikulixapi/1.1.4-SNAPSHOT/sikulixapi-1.1.4-20181031.163111-45.jar!/org/sikuli/script/App.class", and no error report.

rainmanwy avatar Feb 21 '19 01:02 rainmanwy

Thank you for a quick response. Being a newbie, I did not know how to determine the version exactly.

However this is what I see:

Peters-MBP:~ peter$ find ~/.m2 -name "sikulixapi*" -print /Users/peter/.m2/repository/com/sikulix/sikulixapi /Users/peter/.m2/repository/com/sikulix/sikulixapi/1.1.4-SNAPSHOT/sikulixapi-1.1.4-20190111.142059-96.jar.sha1 /Users/peter/.m2/repository/com/sikulix/sikulixapi/1.1.4-SNAPSHOT/sikulixapi-1.1.4-SNAPSHOT.jar /Users/peter/.m2/repository/com/sikulix/sikulixapi/1.1.4-SNAPSHOT/sikulixapi-1.1.4-20190111.142059-96.jar /Users/peter/.m2/repository/com/sikulix/sikulixapi/1.1.4-SNAPSHOT/sikulixapi-1.1.4-20190111.142059-96.pom.sha1 /Users/peter/.m2/repository/com/sikulix/sikulixapi/1.1.4-SNAPSHOT/sikulixapi-1.1.4-20190111.142059-96.pom /Users/peter/.m2/repository/com/sikulix/sikulixapi/1.1.4-SNAPSHOT/sikulixapi-1.1.4-SNAPSHOT.pom

cpk011 avatar Feb 21 '19 02:02 cpk011

@rainmanwy, is there a way to specify sikulixapi-1.1.4-20181031.163111-45.jar in pom.xml? The current pom.xml has:

   <dependency>
        <groupId>com.sikulix</groupId>
        <artifactId>sikulixapi</artifactId>
        <version>1.1.4-SNAPSHOT</version>
    </dependency>

cpk011 avatar Feb 21 '19 13:02 cpk011

RaiMan from SikuliX:

--- no, it is not possible, to specify a snapshot version from the past. snapshot is snapshot and always the latest version at time of a maven build.

--- the above problem might be my fault: I have changed some things in the App class and features that returned a boolean in the past, might now return an App object. If so: I am really sorry for the inconveniences.

... but this is not the problem: Just looked into both project's code: this project: closeApplication() returns an APP object but uses SikuliX App.close() as returning an App object - SikuliX App.close() returns a boolean though (not changed since months).

RaiMan avatar Feb 21 '19 17:02 RaiMan

I did not know the full consequence of doing this but I changed closeApplication to return boolean and the build went further. This time it failed because I did not have python3 installed. After installing python3, it failed with an Ant BuildException.

[INFO] --- maven-antrun-plugin:1.6:run (dist) @ robotframework-SikuliLibrary --- [WARNING] Parameter tasks is deprecated, use target instead [INFO] Executing tasks

main: [echo] unzip package [unzip] Expanding: /Users/peter/robotframework-SikuliLibrary/target/SikuliLibrary.zip into /Users/peter/robotframework-SikuliLibrary/target/src [echo] generate keywords.py [exec] Traceback (most recent call last): [exec] File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/runpy.py", line 183, in _run_module_as_main [exec] mod_name, mod_spec, code = _get_module_details(mod_name, _Error) [exec] File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/runpy.py", line 109, in _get_module_details [exec] import(pkg_name) [exec] File "/Users/peter/robotframework-SikuliLibrary/target/src/SikuliLibrary/init.py", line 7, in [exec] from .sikuli import SikuliLibrary [exec] File "/Users/peter/robotframework-SikuliLibrary/target/src/SikuliLibrary/sikuli.py", line 24, in [exec] from robot.libraries.Process import Process [exec] ModuleNotFoundError: No module named 'robot' [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 16.284 s [INFO] Finished at: 2019-02-21T16:16:34-05:00 [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.6:run (dist) on project robotframework-SikuliLibrary: An Ant BuildException has occured: exec returned: 1 -> [Help 1]

Here is a long output from mvn -X clean build. mvn-out.txt

cpk011 avatar Feb 21 '19 21:02 cpk011

Even though mvn install failed with an error, there are jar files! So maybe the build was a success?

Peters-MBP:robotframework-SikuliLibrary peter$ find . -name "*.jar" -print | xargs ls -l -rw-r--r-- 1 peter staff 89543757 Feb 21 21:17 ./target/SikuliLibrary.jar -rw-r--r-- 1 peter staff 89543757 Feb 21 21:17 ./target/archive-tmp/SikuliLibrary.jar -rw-r--r-- 1 peter staff 23821 Feb 21 21:17 ./target/robotframework-SikuliLibrary-1.4.jar -rw-r--r-- 1 peter staff 89543757 Feb 21 21:17 ./target/src/SikuliLibrary/lib/SikuliLibrary.jar

Peters-MBP:robotframework-SikuliLibrary peter$ jar -tf ./target/robotframework-SikuliLibrary-1.4.jar META-INF/ META-INF/MANIFEST.MF com/ com/github/ com/github/rainmanwy/ com/github/rainmanwy/robotframework/ com/github/rainmanwy/robotframework/sikulilib/ com/github/rainmanwy/robotframework/sikulilib/utils/ com/github/rainmanwy/robotframework/sikulilib/exceptions/ com/github/rainmanwy/robotframework/sikulilib/keywords/ com/github/rainmanwy/robotframework/sikulilib/SikuliLibrary.class com/github/rainmanwy/robotframework/sikulilib/utils/CaptureFolder.class com/github/rainmanwy/robotframework/sikulilib/exceptions/ScreenOperationException.class com/github/rainmanwy/robotframework/sikulilib/exceptions/TimeoutException.class com/github/rainmanwy/robotframework/sikulilib/keywords/ApplicationKeywords.class com/github/rainmanwy/robotframework/sikulilib/keywords/SettingsKeywords.class com/github/rainmanwy/robotframework/sikulilib/keywords/ScreenKeywords.class META-INF/maven/ META-INF/maven/com.github.rainmanwy.robotframework/ META-INF/maven/com.github.rainmanwy.robotframework/robotframework-SikuliLibrary/ META-INF/maven/com.github.rainmanwy.robotframework/robotframework-SikuliLibrary/pom.xml META-INF/maven/com.github.rainmanwy.robotframework/robotframework-SikuliLibrary/pom.properties

cpk011 avatar Feb 22 '19 02:02 cpk011

@cpk011 , you need install robot framework firstly, as this library depended it. You could use command "pip install robotframework" or "pip3 install robotframework" to install it.

rainmanwy avatar Feb 22 '19 06:02 rainmanwy

Hi @rainmanwy, I had installed Robot Framework first and then tried to install robotframework-SikuliLibrary. I tried again this morning installing most of the tools listed below again and had a similar error.

Here are the steps:

  • Installed Java SE 11.0.2
  • Installed Python 3.7.2
  • Installed/upgraded pip3
  • pip3 install robotframework
  • Downloaded jython-standalone-2.7.1.jar
  • Downloaded Sikulix 1.1.4 files
  • Git clone https://github.com/rainmanwy/robotframework-SikuliLibrary.git; git pull; mvn install and saw the same build error with ApplicationKeywords.java,
  • changed closeApplication() to boolean
  • mvn clean install

Here is the output of mvn clean install output without and with -X.

Thanks.

mvn-install.pdf mvnXinstall.pdf

cpk011 avatar Feb 22 '19 16:02 cpk011

Hi @rainmanwy,

This afternoon, I updated macOS to be 10.14.3 (18D109) on my MacBook Pro. I then tried git pull and mvn install and behold it built without any error.

So the only change I had to make on the library code was making closeApplication() to be boolean.

Thank you.

cpk011 avatar Feb 23 '19 00:02 cpk011

Great! The first error is because there is no robot framework. And the second error should relate with env.

And jython is not needed for this lib.

i am update lib later, currently i could not download depended packages from maven repo

获取 Outlook for Androidhttps://aka.ms/ghei36


From: cpk011 [email protected] Sent: Saturday, February 23, 2019 8:53:58 AM To: rainmanwy/robotframework-SikuliLibrary Cc: Rainmanwy; Mention Subject: Re: [rainmanwy/robotframework-SikuliLibrary] [Mac] Unable to build with Maven (#87)

Hi @rainmanwyhttps://github.com/rainmanwy,

This afternoon, I updated macOS to be 10.14.3 (18D109) on my MacBook Pro. I then tried git pull and mvn install and behold it built without any error.

So the only change I had to make on the library code was making closeApplication() to return boolean.

Thank you.

― You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/rainmanwy/robotframework-SikuliLibrary/issues/87#issuecomment-466597789, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AGrAE6pxCgQarjD2-etSZc7OsE_YN0FAks5vQJElgaJpZM4aTaDY.

rainmanwy avatar Feb 23 '19 04:02 rainmanwy

RaiMan from SikuliX:

This was really my bad in this case, sorry.

Since mid January, the auto-upload of 1.1.4 from TravisCI to OSSRH/Maven did not work any more, which I only realised yesterday and repaired it at once.

Now the nightly builds and the Maven snapshots are in synch again.

A goody on top: Settings.getVersionBuild() and Env.getSikuliVersionBuild() now return a version string including build number and build time (for those who want to check).

RaiMan avatar Feb 23 '19 07:02 RaiMan

thanks @RaiMan , I may add "getVersionBuild" and "getSikuliVersionBuild" and logged to console.

Currently i have problem to access OSSRH(very slow speed). So i have to wait it ok.

rainmanwy avatar Feb 25 '19 07:02 rainmanwy