Ardesco / driver-binary-downloader-maven-plugin

A Maven plugin that will download the WebDriver stand alone server executables for use in your mavenised Selenium project.
Apache License 2.0
92 stars 52 forks source link

Plugin causes test-compile to be executed twice #50

Closed mpkorstanje closed 7 years ago

mpkorstanje commented 7 years ago

When using selenium-standalone-server-plugin 1.0.11 bound to the initialization phase it appears that the plugin causes the build to execute test-compile twice. This is causing me some trouble as some resources from cucumber-jvm-parallel-plugin should only be generated once and appears to be related to issue #30.

First we see the build run up to initialize at which point we see:

[INFO] >>> driver-binary-downloader-maven-plugin:1.0.11:selenium (default) > test-compile @ das-cucumber >>>

Then we see the resource, compile, testResources, testCompile followed by:

[INFO] <<< driver-binary-downloader-maven-plugin:1.0.11:selenium (default) < test-compile @ das-cucumber <<<

At this point the download actually starts and is followed by

[INFO] SELENIUM STAND-ALONE EXECUTABLE DOWNLOADS COMPLETE

Then we see the resource, compile, testResources, testCompile come by again.

For what it is worth, binding the binary downloader to any other phases causes the same problem, but at different moments.

mpkorstanje@Pnyx:~/das-cucumber$ mvn clean verify
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building das-cucumber 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ das-cucumber ---
[INFO] Deleting /home/mpkorstanje/das-cucumber/target
[INFO] 
[INFO] >>> driver-binary-downloader-maven-plugin:1.0.11:selenium (default) > test-compile @ das-cucumber >>>
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ das-cucumber ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /home/mpkorstanje/das-cucumber/src/main/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.5.1:compile (default-compile) @ das-cucumber ---
[INFO] No sources to compile
[INFO] 
[INFO] --- cucumber-jvm-parallel-plugin:2.1.0:generateRunners (generate-runners) @ das-cucumber ---
[INFO] Adding /home/mpkorstanje/das-cucumber/target/generated-test-sources/cucumber to test-compile source root
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ das-cucumber ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 10 resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.5.1:testCompile (default-testCompile) @ das-cucumber ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 24 source files to /home/mpkorstanje/das-cucumber/target/test-classes
[INFO] 
[INFO] <<< driver-binary-downloader-maven-plugin:1.0.11:selenium (default) < test-compile @ das-cucumber <<<
[INFO] 
[INFO] --- driver-binary-downloader-maven-plugin:1.0.11:selenium (default) @ das-cucumber ---
[INFO]  
[INFO] --------------------------------------------------------
[INFO]  DOWNLOADING SELENIUM STAND-ALONE EXECUTABLE BINARIES...
[INFO] --------------------------------------------------------
[INFO]  
[INFO]  file:/home/mpkorstanje/das-cucumber/RepositoryMap.xml is valid
[INFO]  
[INFO] Only get drivers for current Operating System: true
[INFO] Getting drivers for current operating system only.
[INFO] Archives will be downloaded to '/home/mpkorstanje/das-cucumber/selenium_standalone_zips'
[INFO] Standalone executable files will be extracted to '/home/mpkorstanje/das-cucumber/selenium_standalone'
[INFO]  
[INFO] Preparing to download Selenium Standalone Executable Binaries...
[INFO] Binary 'chromedriver' Exists: true
[INFO] Using existing 'chromedriver'binary.
[INFO] Binary 'operadriver' Exists: true
[INFO] Using existing 'operadriver'binary.
[INFO] Binary 'phantomjs' Exists: true
[INFO] Using existing 'phantomjs'binary.
[INFO] Binary 'geckodriver' Exists: true
[INFO] Using existing 'geckodriver'binary.
[INFO] Setting maven property - ${webdriver.chrome.driver} = /home/mpkorstanje/das-cucumber/selenium_standalone/linux/googlechrome/64bit/chromedriver
[INFO] Setting maven property - ${webdriver.opera.driver} = /home/mpkorstanje/das-cucumber/selenium_standalone/linux/operachromium/64bit/operadriver
[INFO] Setting maven property - ${phantomjs.binary.path} = /home/mpkorstanje/das-cucumber/selenium_standalone/linux/phantomjs/64bit/phantomjs
[INFO] Setting maven property - ${webdriver.gecko.driver} = /home/mpkorstanje/das-cucumber/selenium_standalone/linux/marionette/64bit/geckodriver
[INFO]  
[INFO] --------------------------------------------------------
[INFO] SELENIUM STAND-ALONE EXECUTABLE DOWNLOADS COMPLETE
[INFO] --------------------------------------------------------
[INFO]  
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ das-cucumber ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /home/mpkorstanje/das-cucumber/src/main/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.5.1:compile (default-compile) @ das-cucumber ---
[INFO] No sources to compile
[INFO] 
[INFO] --- cucumber-jvm-parallel-plugin:2.1.0:generateRunners (generate-runners) @ das-cucumber ---
[INFO] Adding /home/mpkorstanje/das-cucumber/target/generated-test-sources/cucumber to test-compile source root
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ das-cucumber ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 10 resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.5.1:testCompile (default-testCompile) @ das-cucumber ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 29 source files to /home/mpkorstanje/das-cucumber/target/test-classes
[INFO] 
[INFO] --- maven-surefire-plugin:2.17:test (default-test) @ das-cucumber ---
[INFO] 
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ das-cucumber ---
[WARNING] JAR will be empty - no content was marked for inclusion!
[INFO] Building jar: /home/mpkorstanje/das-cucumber/target/das-cucumber-1.0-SNAPSHOT.jar
[INFO] 
[INFO] --- maven-failsafe-plugin:2.19.1:integration-test (default) @ das-cucumber ---

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
mpkorstanje commented 7 years ago

Giving the source a quick look it appears that SeleniumServerMojo contains an annotation that causes the build to fork. It does not appear to be needed.

 @Execute(phase = LifecyclePhase.TEST_COMPILE)
Ardesco commented 7 years ago

You are right, that should not be there.

mpkorstanje commented 7 years ago

Thanks for the quick fix. Cheers!

Ardesco commented 7 years ago

@rultor release, tag is 1.0.12

rultor commented 7 years ago

@rultor release, tag is 1.0.12

@ardesco OK, I will release it now. Please check the progress here

rultor commented 7 years ago

@rultor release, tag is 1.0.12

@ardesco Done! FYI, the full log is here (took me 4min)

Ardesco commented 7 years ago

@mpkorstanje it normally takes a couple of hours for it to propogate through to the maven download servers unless we are really lucky and it's a quiet time :)

You should be able to download it soon.

mpkorstanje commented 7 years ago

Excellent. I could do with a nap anyways. Cheers again!