@Mojo(name="selenium",
defaultPhase=TEST_COMPILE)
public class SeleniumServerMojo
extends org.apache.maven.plugin.AbstractMojo
Modifier and Type | Field and Description |
---|---|
protected boolean |
checkFileHashes
Enable the file hash check for downloaded files
|
protected String |
customRepositoryMap
Path to the XML RepositoryMap
|
protected File |
downloadedZipFileDirectory
Directory where downloaded standalone executable zip files will be saved
|
protected int |
fileDownloadConnectTimeout
the number of milliseconds until this method will timeout if no connection could be established to remote file location
|
protected int |
fileDownloadReadTimeout
the number of milliseconds until this method will timeout if if no data could be read from remote file location
|
protected int |
fileDownloadRetryAttempts
Number of times to retry the file download of each executable
|
protected Map<String,String> |
getSpecificExecutableVersions
A map of driver standalone versions to download
|
protected boolean |
onlyGetDriversForHostOperatingSystem
Only get drivers that are compatible with the operating system running the plugin
|
protected boolean |
onlyGetLatestVersions
Only get the latest version of each standalone executable in RepositoryMap.xml
|
protected Map<String,String> |
operatingSystems
The Operating systems you would like to download a standalone executable for
|
protected boolean |
overwriteFilesThatExist
Force the plugin to overwrite any files that have already been extracted from a valid zip file
|
protected org.apache.maven.project.MavenProject |
project |
protected File |
rootStandaloneServerDirectory
Root directory where the standalone server file structure will be created and files will be saved
|
protected boolean |
sixtyFourBitBinaries
Force download of 64 bit standalone executable
|
protected boolean |
thirtyTwoBitBinaries
Force download of 32 bit standalone executable
|
protected boolean |
throwExceptionIfSpecifiedVersionIsNotFound
Throw an exception if any of the specified standalone versions do not exist in the repository map
|
protected boolean |
useSystemProxy
If the environmental variables http.proxyHost, and http.proxyPort are set they will be used for http/https calls
|
protected InputStream |
xmlRepositoryMap |
Constructor and Description |
---|
SeleniumServerMojo() |
Modifier and Type | Method and Description |
---|---|
protected void |
checkRepositoryMapIsValid(File repositoryMap)
Validate any custom repository maps that are supplied against the xsd.
|
void |
execute() |
protected void |
setSystemProperties(DriverMap driverRepository)
Set the system property webdriver.*.driver for the latest revision of each binary extracted.
|
@Parameter(defaultValue="${project.basedir}/selenium_standalone") protected File rootStandaloneServerDirectory
<rootStandaloneServerDirectory>${project.basedir}/src/main/resources/standalone_executable_root</rootStandaloneServerDirectory>
@Parameter(defaultValue="${project.basedir}/selenium_standalone_zips") protected File downloadedZipFileDirectory
<downloadedZipFileDirectory>${project.basedir}/src/main/resources/downloaded_zip_files</downloadedZipFileDirectory>
@Parameter protected String customRepositoryMap
<xmlRepositoryMap>${project.basedir}/src/main/resources/RepositoryMap.xml</xmlRepositoryMap>
@Parameter(defaultValue="true") protected boolean onlyGetDriversForHostOperatingSystem
<onlyGetDriversForHostOperatingSystem>true</onlyGetDriversForHostOperatingSystem>
If set to false this will download binary executables for all operating systems
@Parameter protected Map<String,String> operatingSystems
<operatingSystems>
<windows>true</windows>
<linux>true</linux>
<mac>true</mac>
</operatingSystems>
Unknown operating systems will cause an error to be thrown, only use the options shown above.
WARNINGif onlyGetDriversForHostOperatingSystem is true, this will be ignored!
@Parameter(defaultValue="false") protected boolean thirtyTwoBitBinaries
<thirtyTwoBitBinaries>true</thirtyTwoBitBinaries>
@Parameter(defaultValue="false") protected boolean sixtyFourBitBinaries
<sixtyFourBitBinaries>true</sixtyFourBitBinaries>
@Parameter(defaultValue="true") protected boolean onlyGetLatestVersions
<onlyGetLatestVersions>true</onlyGetLatestVersions>
If set to false this will download all versions specified in the RepositoryMap.xml
This will be ignored if specific executable versions have been specified
@Parameter protected Map<String,String> getSpecificExecutableVersions
<getSpecificExecutableVersions>
<googlechrome>19</googlechrome>
<internetexplorer>2.21.0</internetexplorer>
</getSpecificExecutableVersions>
Unrecognised browser names/versions will be ignored by default
@Parameter(defaultValue="false") protected boolean throwExceptionIfSpecifiedVersionIsNotFound
<throwExceptionIfSpecifiedVersionIsNotFound>false</throwExceptionIfSpecifiedVersionIsNotFound>
This will cause a MojoFailureException to be thrown if any specific executable versions that have been specified do not exist in the RepositoryMap.xml
@Parameter(defaultValue="1") protected int fileDownloadRetryAttempts
<fileDownloadRetryAttempts>1</fileDownloadRetryAttempts>
@Parameter(defaultValue="15000") protected int fileDownloadConnectTimeout
<fileDownloadConnectTimeout>15000</fileDownloadConnectTimeout>
@Parameter(defaultValue="15000") protected int fileDownloadReadTimeout
<fileDownloadReadTimeout>15000</fileDownloadReadTimeout>
@Parameter(defaultValue="true") protected boolean useSystemProxy
<useSystemProxy>true</useSystemProxy>
@Parameter(defaultValue="false") protected boolean overwriteFilesThatExist
<overwriteFilesThatExist>false</overwriteFilesThatExist>
crc checks are not performed on files that have been extracted from valid zips, they are assumed to be valid. This will force the plugin to extract everything from valid zips again and overwrite any existing files.
This does not clean out old files, it only writes new files over the top of existing ones.
@Parameter(defaultValue="true") protected boolean checkFileHashes
<checkFileHashes>false</checkFileHashes>
Setting this to false will skip all hash checks on downloaded files, this is not recommended.
If you do not check the file hash there is no guarantee that the downloaded file is the correct file
@Parameter(defaultValue="${project}", required=true, readonly=true) protected org.apache.maven.project.MavenProject project
protected InputStream xmlRepositoryMap
public void execute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException
org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoFailureException
protected void setSystemProperties(DriverMap driverRepository)
driverRepository
- map of drivers that system properties will be set forprotected void checkRepositoryMapIsValid(File repositoryMap) throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionException
- thrown if customRepositoryMap is not validCopyright © 2017. All rights reserved.