Skip to content

[JENKINS-18918] Test harness packs copies of Maven into plugin archive #14773

Closed

Description

@jenkins-infra-bot

https://groups.google.com/d/msg/jenkinsci-dev/8n6vqak8khE/MTM1Vs-1g3sJ

The test harness was accidentally including copies of Maven in plugin archives if you ran tests that ran Maven builds, as would be common during mvn release:prepare release:perform.


Originally reported by jglick, imported from: Test harness packs copies of Maven into plugin archive
  • status: Resolved
  • priority: Major
  • component(s): core
  • label(s): 1.509.3-fixed, maven, test
  • resolution: Fixed
  • resolved: 2013-07-24T22:17:30+00:00
  • votes: 0
  • watchers: 3
  • imported: 2025-11-24
Raw content of original issue

https://groups.google.com/d/msg/jenkinsci-dev/8n6vqak8khE/MTM1Vs-1g3sJ

The test harness was accidentally including copies of Maven in plugin archives if you ran tests that ran Maven builds, as would be common during mvn release:prepare release:perform.

Activity

  1. jenkins-infra-bot commented on Jul 24, 2013

    @jenkins-infra-bot
    Author
    scm_issue_link:
    • Original comment link
    • Raw content of original comment:

      Code changed in jenkins User: Jesse Glick Path: changelog.html test/src/main/java/org/jvnet/hudson/test/HudsonTestCase.java test/src/main/java/org/jvnet/hudson/test/JenkinsRule.java http://jenkins-ci.org/commit/jenkins/2152cf478e26e01b90be8c818cfe3bb628b32263 Log: [FIXED JENKINS-18918] From plugins we must use target/ not target/classes/ to unpack Maven. Also cleaning up variable names to be less misleading.

      Note that new File("target") is really a bad idea since we cannot predict the CWD in effect when Maven is run. (From the standard bin/mvn launcher, it seems that it will always be some Maven project at least. This may not be true for Maven run embedded from various tools.) But leaving that as is for now, since it is not clear how else we would find the project location. (new File(env.description().getTestClass().getProtectionDomain().getCodeSource().getLocation().toURI()).getParentFile() might work but it is pretty hacky.)

      Compare: 1195375...2152cf4

    Code changed in jenkins
    User: Jesse Glick
    Path:
    changelog.html
    test/src/main/java/org/jvnet/hudson/test/HudsonTestCase.java
    test/src/main/java/org/jvnet/hudson/test/JenkinsRule.java
    http://jenkins-ci.org/commit/jenkins/2152cf478e26e01b90be8c818cfe3bb628b32263
    Log:
    [FIXED JENKINS-18918] From plugins we must use target/ not target/classes/ to unpack Maven.
    Also cleaning up variable names to be less misleading.

    Note that new File("target") is really a bad idea since we cannot predict the CWD in effect when Maven is run.
    (From the standard bin/mvn launcher, it seems that it will always be some Maven project at least.
    This may not be true for Maven run embedded from various tools.)
    But leaving that as is for now, since it is not clear how else we would find the project location.
    (new File(env.description().getTestClass().getProtectionDomain().getCodeSource().getLocation().toURI()).getParentFile() might work but it is pretty hacky.)

    Compare: 1195375...2152cf4

  2. jenkins-infra-bot commented on Jul 24, 2013

    @jenkins-infra-bot
    Author
    dogfood:
    • Original comment link
    • Raw content of original comment:

      Integrated in jenkins_main_trunk #2749 [FIXED JENKINS-18918] From plugins we must use target/ not target/classes/ to unpack Maven. (Revision 2152cf478e26e01b90be8c818cfe3bb628b32263)

      Result = SUCCESS Jesse Glick : 2152cf478e26e01b90be8c818cfe3bb628b32263 Files :

      • changelog.html
      • test/src/main/java/org/jvnet/hudson/test/JenkinsRule.java
      • test/src/main/java/org/jvnet/hudson/test/HudsonTestCase.java

    Integrated in jenkins_main_trunk #2749
    [FIXED JENKINS-18918] From plugins we must use target/ not target/classes/ to unpack Maven. (Revision 2152cf4)

    Result = SUCCESS
    Jesse Glick : 2152cf478e26e01b90be8c818cfe3bb628b32263
    Files :

    • changelog.html
    • test/src/main/java/org/jvnet/hudson/test/JenkinsRule.java
    • test/src/main/java/org/jvnet/hudson/test/HudsonTestCase.java
  3. jenkins-infra-bot commented on Aug 6, 2013

    @jenkins-infra-bot
    Author
    scm_issue_link:
    • Original comment link
    • Raw content of original comment:

      Code changed in jenkins User: Jesse Glick Path: changelog.html test/src/main/java/org/jvnet/hudson/test/HudsonTestCase.java test/src/main/java/org/jvnet/hudson/test/JenkinsRule.java http://jenkins-ci.org/commit/jenkins/31c302cc7e4a63727f7684eef3cf6ce5bc7aa12d Log: [FIXED JENKINS-18918] From plugins we must use target/ not target/classes/ to unpack Maven. Also cleaning up variable names to be less misleading.

      Note that new File("target") is really a bad idea since we cannot predict the CWD in effect when Maven is run. (From the standard bin/mvn launcher, it seems that it will always be some Maven project at least. This may not be true for Maven run embedded from various tools.) But leaving that as is for now, since it is not clear how else we would find the project location. (new File(env.description().getTestClass().getProtectionDomain().getCodeSource().getLocation().toURI()).getParentFile() might work but it is pretty hacky.) (cherry picked from commit 2152cf478e26e01b90be8c818cfe3bb628b32263)

    Code changed in jenkins
    User: Jesse Glick
    Path:
    changelog.html
    test/src/main/java/org/jvnet/hudson/test/HudsonTestCase.java
    test/src/main/java/org/jvnet/hudson/test/JenkinsRule.java
    http://jenkins-ci.org/commit/jenkins/31c302cc7e4a63727f7684eef3cf6ce5bc7aa12d
    Log:
    [FIXED JENKINS-18918] From plugins we must use target/ not target/classes/ to unpack Maven.
    Also cleaning up variable names to be less misleading.

    Note that new File("target") is really a bad idea since we cannot predict the CWD in effect when Maven is run.
    (From the standard bin/mvn launcher, it seems that it will always be some Maven project at least.
    This may not be true for Maven run embedded from various tools.)
    But leaving that as is for now, since it is not clear how else we would find the project location.
    (new File(env.description().getTestClass().getProtectionDomain().getCodeSource().getLocation().toURI()).getParentFile() might work but it is pretty hacky.)
    (cherry picked from commit 2152cf4)

  4. jenkins-infra-bot commented on Jan 15, 2016

    @jenkins-infra-bot
    Author
    scm_issue_link:
    • Original comment link
    • Raw content of original comment:

      Code changed in jenkins User: Jesse Glick Path: test/src/main/java/org/jvnet/hudson/test/HudsonTestCase.java test/src/main/java/org/jvnet/hudson/test/JenkinsRule.java http://jenkins-ci.org/commit/jenkins-test-harness/41570338fb55aa1a40bd29b133af1380d9313803 Log: [FIXED JENKINS-18918] From plugins we must use target/ not target/classes/ to unpack Maven. Also cleaning up variable names to be less misleading.

      Note that new File("target") is really a bad idea since we cannot predict the CWD in effect when Maven is run. (From the standard bin/mvn launcher, it seems that it will always be some Maven project at least. This may not be true for Maven run embedded from various tools.) But leaving that as is for now, since it is not clear how else we would find the project location. (new File(env.description().getTestClass().getProtectionDomain().getCodeSource().getLocation().toURI()).getParentFile() might work but it is pretty hacky.) Originally-Committed-As: 2152cf478e26e01b90be8c818cfe3bb628b32263

    Code changed in jenkins
    User: Jesse Glick
    Path:
    test/src/main/java/org/jvnet/hudson/test/HudsonTestCase.java
    test/src/main/java/org/jvnet/hudson/test/JenkinsRule.java
    http://jenkins-ci.org/commit/jenkins-test-harness/41570338fb55aa1a40bd29b133af1380d9313803
    Log:
    [FIXED JENKINS-18918] From plugins we must use target/ not target/classes/ to unpack Maven.
    Also cleaning up variable names to be less misleading.

    Note that new File("target") is really a bad idea since we cannot predict the CWD in effect when Maven is run.
    (From the standard bin/mvn launcher, it seems that it will always be some Maven project at least.
    This may not be true for Maven run embedded from various tools.)
    But leaving that as is for now, since it is not clear how else we would find the project location.
    (new File(env.description().getTestClass().getProtectionDomain().getCodeSource().getLocation().toURI()).getParentFile() might work but it is pretty hacky.)
    Originally-Committed-As: 2152cf4

  5. removed
    bugFor changelog: Minor bug. Will be listed after features
    on Nov 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions