Maven auto-installation doesn't work when shared between executions

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Maven auto-installation doesn't work when shared between executions

Vitalii Ishchenko
I have a windows slave node with 2 executors. And job that is bound to windows slave that allows to perform parallel builds. Jenkins automatically installs maven configured in Global Tools configuration by unpacking tar.gz archive.

The problem is that looks like every run re-fetches maven and tries to overwrite existing one. This approach fails almost every time because maven may be used at that time and Windows doesn't allow to overwrite running executable.

Is there a way to install maven into WORKSPACE instead of shared location or control where archive is unpacked, in this case we can use JOB_NAME and EXECUTOR_NUMBER to scope tool

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CANYoZJ%3De6q4e0CDdZjvOQ%3D-HyLwcRtPX%2B5e9RiHT4OjnMSgeVA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Maven auto-installation doesn't work when shared between executions

Mark Waite-2
If the tool is being installed on every run of the job, then I think there is something else amiss with your installation.  I have several different automated installers (2 maven, 2 ant, cmake, etc.) which deploy to many different platforms successfully (including Windows).

I have a job that uses the elastic axis plugin to run a sample maven job on each of the agents using the specific maven version.  It works reliably, and once that job has run, other jobs do not unpack the maven installer for that maven version again.

Are there any unique or special settings you're using to configure your agents?

Mark Waite

On Thu, Jun 29, 2017 at 8:08 AM Виталий Ищенко <[hidden email]> wrote:
I have a windows slave node with 2 executors. And job that is bound to windows slave that allows to perform parallel builds. Jenkins automatically installs maven configured in Global Tools configuration by unpacking tar.gz archive.

The problem is that looks like every run re-fetches maven and tries to overwrite existing one. This approach fails almost every time because maven may be used at that time and Windows doesn't allow to overwrite running executable.

Is there a way to install maven into WORKSPACE instead of shared location or control where archive is unpacked, in this case we can use JOB_NAME and EXECUTOR_NUMBER to scope tool

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CANYoZJ%3De6q4e0CDdZjvOQ%3D-HyLwcRtPX%2B5e9RiHT4OjnMSgeVA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CAO49JtGpTZ6r0-a63%3DFd1uXi4_W7%3DWenZUdWqmJmqcB7s8U%3DRw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Maven auto-installation doesn't work when shared between executions

Vitalii Ishchenko
Hi Mark

I found possible issue, we are installing maven from internal url and I've created test job that installs from apache
2nd option is different in fact that it creates .installedFrom file that is later used to verify if we are installing different version

https://github.com/jenkinsci/jenkins/blob/d5d6eb037b51a69f86cbf105fd3b78178ad83611/core/src/main/java/hudson/tools/DownloadFromUrlInstaller.java#L45
https://github.com/jenkinsci/jenkins/blob/d5d6eb037b51a69f86cbf105fd3b78178ad83611/core/src/main/java/hudson/tools/DownloadFromUrlInstaller.java#L83

But seems that for our type of installation, different class is used which doesn't have such check https://github.com/jenkinsci/jenkins/blob/master/core/src/main/java/hudson/tools/ZipExtractionInstaller.java

On Thursday, June 29, 2017 at 5:17:09 PM UTC+3, Mark Waite wrote:
If the tool is being installed on every run of the job, then I think there is something else amiss with your installation.  I have several different automated installers (2 maven, 2 ant, cmake, etc.) which deploy to many different platforms successfully (including Windows).

I have a job that uses the elastic axis plugin to run a sample maven job on each of the agents using the specific maven version.  It works reliably, and once that job has run, other jobs do not unpack the maven installer for that maven version again.

Are there any unique or special settings you're using to configure your agents?

Mark Waite

On Thu, Jun 29, 2017 at 8:08 AM Виталий Ищенко <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="BYmv1FM9AgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">bet...@...> wrote:
I have a windows slave node with 2 executors. And job that is bound to windows slave that allows to perform parallel builds. Jenkins automatically installs maven configured in Global Tools configuration by unpacking tar.gz archive.

The problem is that looks like every run re-fetches maven and tries to overwrite existing one. This approach fails almost every time because maven may be used at that time and Windows doesn't allow to overwrite running executable.

Is there a way to install maven into WORKSPACE instead of shared location or control where archive is unpacked, in this case we can use JOB_NAME and EXECUTOR_NUMBER to scope tool

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="BYmv1FM9AgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/jenkinsci-users/CANYoZJ%3De6q4e0CDdZjvOQ%3D-HyLwcRtPX%2B5e9RiHT4OjnMSgeVA%40mail.gmail.com?utm_medium=email&amp;utm_source=footer" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/jenkinsci-users/CANYoZJ%3De6q4e0CDdZjvOQ%3D-HyLwcRtPX%2B5e9RiHT4OjnMSgeVA%40mail.gmail.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/jenkinsci-users/CANYoZJ%3De6q4e0CDdZjvOQ%3D-HyLwcRtPX%2B5e9RiHT4OjnMSgeVA%40mail.gmail.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/jenkinsci-users/CANYoZJ%3De6q4e0CDdZjvOQ%3D-HyLwcRtPX%2B5e9RiHT4OjnMSgeVA%40mail.gmail.com.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/22f3394c-b3fe-4307-9c7c-895831318fc8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...