Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-5280

MAVEN_OPTS not used when letting Hudson deploy to maven repo

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • maven-plugin
    • None
    • 64-bit Windows Server 2003 SP2 on 2-way, 8MB Intel virtual machine

      When building we have Hudson run the maven goals "clean install", then we use the Hudson project option "Deploy artifacts to Maven repository" to deploy project artifacts to our Maven repo. When trying to deploy a 80MB ear, we get an OutOfMemoryError.

      Initially, I tried increasing the heap by using the project configuration setting: Build -> Advanced -> MAVEN_OPTS, but this seemed to have no effect. Then I tried the global MAVEN_OPTS under Manage Hudson -> Configure System -> Maven Project Configuration. Again, no help.

      Then I tried adding -XX:+HeapDumpOnOutOfMemoryError in both places, but was not getting a heap dump when the OOM error occurred. I began to suspect that neither of those MAVEN_OPTS were being used when I let Hudson run "mvn deploy" for me.

      So I abandoned that option, took out the -Xmx options, kept -XX:+HeapDump..., and added <distributionManagement> to my POM, and had Hudson run the "clean deploy" maven goals. This time, when I got the OOM error, I got a heap dump. I added the -Xmx back in to the project-level MAVEN_OPTS and the deployment succeeded.

      So it would seem there is no way to set MAVEN_OPTS when letting Hudson deploy artifacts for you via the "Deploy artifacts to Maven repository" option. Can we get this added (or at least have it use the global MAVEN_OPTS)?

          [JENKINS-5280] MAVEN_OPTS not used when letting Hudson deploy to maven repo

          Andrew Bayer added a comment -

          The "Deploy artifacts" publisher doesn't actually use a command-line Maven call - it uses an embedded Maven within the Hudson process itself. I'd suggest increasing the memory allocated to Hudson.

          Andrew Bayer added a comment - The "Deploy artifacts" publisher doesn't actually use a command-line Maven call - it uses an embedded Maven within the Hudson process itself. I'd suggest increasing the memory allocated to Hudson.

          tdrury added a comment -

          Thanks for the tip. I haven't tried it yet, but I have no reason to doubt you are correct that raising the heap for Hudson will allow my large artifacts to be deployed to a maven repo via Hudson.

          However, I think this is pretty inefficient. Why should every project I build be given a huge heap when only a couple project need it. I think it would be nice if the embedded maven had its own MAVEN_OPTS parameter which can be set per-project.

          tdrury added a comment - Thanks for the tip. I haven't tried it yet, but I have no reason to doubt you are correct that raising the heap for Hudson will allow my large artifacts to be deployed to a maven repo via Hudson. However, I think this is pretty inefficient. Why should every project I build be given a huge heap when only a couple project need it. I think it would be nice if the embedded maven had its own MAVEN_OPTS parameter which can be set per-project.

          timfulmer added a comment -

          I can confirm upping the memory allocated to the main Hudson process does work around this issue. However it took lots of frustrated noodling with the complex and powerful Maven configurations, then much additional searching on the internet before finally running into this Jira issue and figuring out how to get this working when the neat little checkbox in the job configuration screen implies this will be easy and painless to get in place. Voting +1 on this issue.

          timfulmer added a comment - I can confirm upping the memory allocated to the main Hudson process does work around this issue. However it took lots of frustrated noodling with the complex and powerful Maven configurations, then much additional searching on the internet before finally running into this Jira issue and figuring out how to get this working when the neat little checkbox in the job configuration screen implies this will be easy and painless to get in place. Voting +1 on this issue.

            Unassigned Unassigned
            tdrury tdrury
            Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated: