Forum Discussion

steve_rivers's avatar
steve_rivers
Occasional Contributor
4 years ago

External Java library management, looking for hints, tips and good practices.

Couple of questions for the experts here since my searches don't seem to be finding the answers.

 

1. What is the best way to manage both external Java libraries and Groovy script libraries when upgrading or doing a clean install? Right now I keep the ones I use in a git repo along with a script to copy the jar files over each time I need to update / install. This works but does not feel like a good long term solution.

 

2. How do people make sure the external libraries they are kept up to date when there are features added / security holes patched etc.?  Are there any package management tools for ReadyAPI? 

 

 

 

 

 

 

 

  • Hello steve_rivers 

     

    a: 1...  Your method to manage libraries is as good as any.  I don't think there is a ReadyAPI feature to do that.  I just have a folder with .jar files that I rely on and have a batch file to run that copies them to new installations.

     

    a:  2..  I am not aware of package management tools strictly for ReadyAPI.  With some more digging, you might find one generic enough or able to re-purpose for ReadyAPI...  Maybe Maven configured to meet your needs.

     

    Sorry about no definitive answer.  question 1 is the closest answer I can relate to.

     

    Regards,

    Todd

     

    Sample batch file that I run whenever I update/new install...

    ReadyAPIJarFilesToNewVersion.bat

     

    :: ***
    :: Run this batch by right-clicking its filename and choosing "Run as Administrator" since
    :: it is copying files to a Windows protected directory.
    :: ***
    
    :: This batch file will copy desired JAR files from base source location to a 
    :: directory of newly installed ReadyAPI.  
    
    :: A base source location is defined that contains extra JAR files for use in 
    :: ReadyAPI.  They are mostly static, but some need to be updated occasionally,
    :: such as the Selenium driver for chrome.  Update those base JAR files as 
    :: needed to support the projects you create.
    
    :::: Change the line below to reflect the location you want files copied to...
    ::  not needed if going to latest installed version
    ::set destinateDirectory="C:\Program Files\SmartBear\ReadyAPI-3.10.2\lib\"
    
    :: ############ Latest version ReadyAPI testrunner location
    :: This finds ReadyAPI testrunner location without need to hardcode.
    FOR /F "delims=" %%i IN ('dir "c:\Program Files\SmartBear\ReadyAPI-3*" /b /ad-h /t:c /od') DO SET readyapiversion=%%i
    
    set destinateDirectory="C:\Program Files\SmartBear\%readyapiversion%\lib\"
    set sourceDirectory=C:\Program Files\SmartBear\ReadyAPI-Local-JARS\
    
    copy "%sourceDirectory%byte-buddy-1.8.15.jar" %destinateDirectory%
    copy "%sourceDirectory%client-combined-3.141.59.jar" %destinateDirectory%
    copy "%sourceDirectory%commons-exec-1.3.jar" %destinateDirectory%
    copy "%sourceDirectory%commons-validator-1.7.jar" %destinateDirectory%
    copy "%sourceDirectory%derby.jar" %destinateDirectory%
    copy "%sourceDirectory%java-client-7.4.1.jar" %destinateDirectory%
    copy "%sourceDirectory%okhttp-3.11.0.jar" %destinateDirectory%
    copy "%sourceDirectory%okio-1.14.0.jar" %destinateDirectory%
    copy "%sourceDirectory%jfreechart-1.5.3.jar" %destinateDirectory%
    
    pause

     

     

  • TNeuschwanger's avatar
    TNeuschwanger
    Champion Level 1

    Hello steve_rivers 

     

    a: 1...  Your method to manage libraries is as good as any.  I don't think there is a ReadyAPI feature to do that.  I just have a folder with .jar files that I rely on and have a batch file to run that copies them to new installations.

     

    a:  2..  I am not aware of package management tools strictly for ReadyAPI.  With some more digging, you might find one generic enough or able to re-purpose for ReadyAPI...  Maybe Maven configured to meet your needs.

     

    Sorry about no definitive answer.  question 1 is the closest answer I can relate to.

     

    Regards,

    Todd

     

    Sample batch file that I run whenever I update/new install...

    ReadyAPIJarFilesToNewVersion.bat

     

    :: ***
    :: Run this batch by right-clicking its filename and choosing "Run as Administrator" since
    :: it is copying files to a Windows protected directory.
    :: ***
    
    :: This batch file will copy desired JAR files from base source location to a 
    :: directory of newly installed ReadyAPI.  
    
    :: A base source location is defined that contains extra JAR files for use in 
    :: ReadyAPI.  They are mostly static, but some need to be updated occasionally,
    :: such as the Selenium driver for chrome.  Update those base JAR files as 
    :: needed to support the projects you create.
    
    :::: Change the line below to reflect the location you want files copied to...
    ::  not needed if going to latest installed version
    ::set destinateDirectory="C:\Program Files\SmartBear\ReadyAPI-3.10.2\lib\"
    
    :: ############ Latest version ReadyAPI testrunner location
    :: This finds ReadyAPI testrunner location without need to hardcode.
    FOR /F "delims=" %%i IN ('dir "c:\Program Files\SmartBear\ReadyAPI-3*" /b /ad-h /t:c /od') DO SET readyapiversion=%%i
    
    set destinateDirectory="C:\Program Files\SmartBear\%readyapiversion%\lib\"
    set sourceDirectory=C:\Program Files\SmartBear\ReadyAPI-Local-JARS\
    
    copy "%sourceDirectory%byte-buddy-1.8.15.jar" %destinateDirectory%
    copy "%sourceDirectory%client-combined-3.141.59.jar" %destinateDirectory%
    copy "%sourceDirectory%commons-exec-1.3.jar" %destinateDirectory%
    copy "%sourceDirectory%commons-validator-1.7.jar" %destinateDirectory%
    copy "%sourceDirectory%derby.jar" %destinateDirectory%
    copy "%sourceDirectory%java-client-7.4.1.jar" %destinateDirectory%
    copy "%sourceDirectory%okhttp-3.11.0.jar" %destinateDirectory%
    copy "%sourceDirectory%okio-1.14.0.jar" %destinateDirectory%
    copy "%sourceDirectory%jfreechart-1.5.3.jar" %destinateDirectory%
    
    pause