Ardesco/driver-binary-downloader-maven-plugin

Getting NPE when trying to download binaries

serpro69 opened this issue · 1 comments

RepositoryMap.xml;

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<root>
    <windows>
        <driver id="googlechrome">
            <version id="2.33">
                <bitrate thirtytwobit="true" sixtyfourbit="true">
                    <filelocation>https://chromedriver.storage.googleapis.com/2.33/chromedriver_win32.zip</filelocation>
                    <hash>b52ca785707eade99c56309ce9d66c1177b5d4a9</hash>
                    <hashtype>sha1</hashtype>
                </bitrate>
            </version>
        </driver>
        <driver id="marionette">
            <version id="0.19.1">
                <bitrate sixtyfourbit="true">
                    <filelocation>https://github.com/mozilla/geckodriver/releases/download/v0.19.1/geckodriver-v0.19.1-win64.zip</filelocation>
                    <hash>1d6a7ade773f98b3b5a15ace3b6a06b1ad97a8f1</hash>
                    <hashtype>sha1</hashtype>
                </bitrate>
                <bitrate thirtytwobit="true">
                    <filelocation>https://github.com/mozilla/geckodriver/releases/download/v0.19.1/geckodriver-v0.19.1-win32.zip</filelocation>
                    <hash>74258f5c73a8fce66fbc3ecd622dae890f1e475a</hash>
                    <hashtype>sha1</hashtype>
                </bitrate>
            </version>
        </driver>
    </windows>
    <linux>
    </linux>
    <osx>
    </osx>
</root>

Plugin config:

                    <plugin>
                        <groupId>com.lazerycode.selenium</groupId>
                        <artifactId>driver-binary-downloader-maven-plugin</artifactId>
                        <version>${driver-binary-downloader-maven-plugin.ver}</version>
                        <configuration>
                            <rootStandaloneServerDirectory>
                                ${project.basedir}/src/test/resources/selenium_standalone_binaries
                            </rootStandaloneServerDirectory>
                            <downloadedZipFileDirectory>${project.basedir}/src/test/resources/selenium_standalone_zips
                            </downloadedZipFileDirectory>
                            <customRepositoryMap>${project.basedir}/src/test/resources/RepositoryMap.xml
                            </customRepositoryMap>
                            <overwriteFilesThatExist>${overwrite.binaries}</overwriteFilesThatExist>
                            <onlyGetDriversForHostOperatingSystem>true</onlyGetDriversForHostOperatingSystem>
                            <fileDownloadRetryAttempts>${retry.attempts}</fileDownloadRetryAttempts>
                            <fileDownloadReadTimeout>${read.timeout}</fileDownloadReadTimeout>
                            <operatingSystems>
                                <windows>true</windows>
                                <linux>false</linux>
                                <mac>false</mac>
                            </operatingSystems>
                        </configuration>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>selenium</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

Exception trace:

[INFO] --------------------------------------------------------
[INFO]  DOWNLOADING SELENIUM STAND-ALONE EXECUTABLE BINARIES...
[INFO] --------------------------------------------------------
[INFO]
[DEBUG] The resource 'C:\Users\...\sit-automation-selenium/src/test/resources/RepositoryMap.xml' was not found with resourceLoader
 org.codehaus.plexus.resource.loader.ThreadContextClasspathResourceLoader.
[DEBUG] The resource 'C:\Users\...\sit-automation-selenium/src/test/resources/RepositoryMap.xml' was not found with resourceLoader
 org.codehaus.plexus.resource.loader.JarResourceLoader.
[DEBUG] URLResourceLoader: No valid URL 'C:\Users\...\sit-automation-selenium/src/test/resources/RepositoryMap.xml'
[DEBUG] The resource 'C:\Users\...\sit-automation-selenium/src/test/resources/RepositoryMap.xml' was not found with resourceLoader
 org.codehaus.plexus.resource.loader.URLResourceLoader.
[DEBUG] The resource 'C:\Users\...\sit-automation-selenium/src/test/resources/RepositoryMap.xml' was found as C:\Users\...\sit-automation-selenium\src\test\resources\RepositoryMap.xml.
[INFO] Repository map 'file:/C:/Users/.../src/test/resources/RepositoryMap.xml' is valid
[INFO]
[INFO] Only get drivers for current Operating System: true
[INFO] Getting drivers for current operating system only.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 11.455 s
[INFO] Finished at: 2017-11-27T14:51:33+01:00
[INFO] Final Memory: 44M/426M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.lazerycode.selenium:driver-binary-downloader-maven-plugin:1.0.15:selenium (default) on project sit-automation-selenium: Execution default of goal co
m.lazerycode.selenium:driver-binary-downloader-maven-plugin:1.0.15:selenium failed: null -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.lazerycode.selenium:driver-binary-downloader-maven-plugin:1.0.15:selenium (default) on project sit-a
utomation-selenium: Execution default of goal com.lazerycode.selenium:driver-binary-downloader-maven-plugin:1.0.15:selenium failed: null
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:213)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:154)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:146)
        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:51)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:309)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:194)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:107)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:993)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:345)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:191)
        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.PluginExecutionException: Execution default of goal com.lazerycode.selenium:driver-binary-downloader-maven-plugin:1.0.15:selenium failed: null
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:145)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
        ... 20 more
Caused by: java.lang.NumberFormatException: null
        at java.lang.Integer.parseInt(Integer.java:542)
        at java.lang.Integer.valueOf(Integer.java:766)
        at com.lazerycode.selenium.download.DetectProxyConfig.<init>(DetectProxyConfig.java:33)
        at com.lazerycode.selenium.download.FileDownloader.<init>(FileDownloader.java:36)
        at com.lazerycode.selenium.download.DownloadHandler.<init>(DownloadHandler.java:39)
        at com.lazerycode.selenium.SeleniumServerMojo.execute(SeleniumServerMojo.java:249)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
        ... 21 more

Sorry, this is not an issue - had to explicitly set 'useSystemProxy' to 'false' and it worked.