-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
resolve-test-dependencies fail to update classpath to use some optional transitive dependencies coming from hpi included in overrideWar #391
Closed
olamy
wants to merge
5
commits into
jenkinsci:master
from
olamy:resolve-test-dependencies-optional-transitive-dependencies-from-overrideWar
Closed
Changes from 4 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
ea01d86
resolve-test-dependencies fail to update classpath to use some option…
olamy 259bf57
force inclusion of support-core jar to reproduce not using overrideWa…
olamy df62a8d
not needed
olamy 0a2bccf
some exclusions of bad poms...
olamy 7c5299e
upgrade maven-dependency-tree
olamy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
src/it/setup_test-dependencies-transitive-optional-dep/invoker.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
invoker.goals=install |
53 changes: 53 additions & 0 deletions
53
src/it/setup_test-dependencies-transitive-optional-dep/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>org.jenkins-ci.plugins</groupId> | ||
<artifactId>plugin</artifactId> | ||
<version>4.40</version> | ||
<relativePath/> | ||
</parent> | ||
<groupId>org.jenkins-ci.tools.hpi.its</groupId> | ||
<artifactId>test-dependencies-transitive-optional-dep</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
<packaging>hpi</packaging> | ||
<properties> | ||
<jenkins.version>2.332.1</jenkins.version> | ||
<hpi-plugin.version>@project.version@</hpi-plugin.version> | ||
<skipTests>true</skipTests> | ||
</properties> | ||
<repositories> | ||
<repository> | ||
<id>repo.jenkins-ci.org</id> | ||
<url>https://repo.jenkins-ci.org/public/</url> | ||
</repository> | ||
</repositories> | ||
<pluginRepositories> | ||
<pluginRepository> | ||
<id>repo.jenkins-ci.org</id> | ||
<url>https://repo.jenkins-ci.org/public/</url> | ||
</pluginRepository> | ||
</pluginRepositories> | ||
<dependencyManagement> | ||
<dependencies> | ||
<dependency> | ||
<groupId>io.jenkins.lib</groupId> | ||
<artifactId>support-log-formatter</artifactId> | ||
<version>1.1</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.jenkins-ci</groupId> | ||
<artifactId>symbol-annotation</artifactId> | ||
<version>1.20</version> | ||
</dependency> | ||
</dependencies> | ||
</dependencyManagement> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.jenkins-ci.plugins</groupId> | ||
<artifactId>support-core</artifactId> | ||
<version>2.72</version> | ||
</dependency> | ||
</dependencies> | ||
</project> |
2 changes: 2 additions & 0 deletions
2
src/it/setup_test-dependencies-transitive-optional-dep/src/main/resources/index.jelly
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<?jelly escape-by-default='true'?> | ||
<div/> |
2 changes: 2 additions & 0 deletions
2
src/it/test-dependencies-transitive-optional/invoker.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
invoker.goals=verify | ||
#validate hpi:resolve-test-dependencies |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,157 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>org.jenkins-ci.plugins</groupId> | ||
<artifactId>plugin</artifactId> | ||
<version>4.40</version> | ||
<relativePath/> | ||
</parent> | ||
<groupId>org.jenkins-ci.tools.hpi.its</groupId> | ||
<artifactId>test-dependencies-transitive-optional</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
<packaging>hpi</packaging> | ||
<properties> | ||
<!-- change it back to @jenkins.version.test@ when upgrade made in projec pom --> | ||
<jenkins.version>2.346.1</jenkins.version> | ||
<hpi-plugin.version>@project.version@</hpi-plugin.version> | ||
<useUpperBounds>true</useUpperBounds> | ||
<test>SampleTest</test> | ||
<maven.test.redirectTestOutputToFile>false</maven.test.redirectTestOutputToFile> | ||
<surefire.rerunFailingTestsCount>0</surefire.rerunFailingTestsCount> | ||
<jenkins.war.directory>${project.build.directory}/war</jenkins.war.directory> | ||
<jenkins.war.name>jenkins-${jenkins.version}.war</jenkins.war.name> | ||
<overrideWar>${jenkins.war.directory}/${jenkins.war.name}</overrideWar> | ||
</properties> | ||
<repositories> | ||
<repository> | ||
<id>repo.jenkins-ci.org</id> | ||
<url>https://repo.jenkins-ci.org/public/</url> | ||
</repository> | ||
</repositories> | ||
<pluginRepositories> | ||
<pluginRepository> | ||
<id>repo.jenkins-ci.org</id> | ||
<url>https://repo.jenkins-ci.org/public/</url> | ||
</pluginRepository> | ||
</pluginRepositories> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-dependency-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<id>copy-jenkins-war</id> | ||
<phase>process-resources</phase> | ||
<goals> | ||
<goal>copy</goal> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This does not look anything like a real plugin POM so I am struggling to follow what bug this IT purports to reproduce. |
||
</goals> | ||
<configuration> | ||
<artifactItems> | ||
<artifactItem> | ||
<groupId>org.jenkins-ci.main</groupId> | ||
<artifactId>jenkins-war</artifactId> | ||
<version>${jenkins.version}</version> | ||
<type>war</type> | ||
<overWrite>false</overWrite> | ||
<outputDirectory>${jenkins.war.directory}</outputDirectory> | ||
<destFileName>${jenkins.war.name}</destFileName> | ||
</artifactItem> | ||
<artifactItem> | ||
<groupId>org.jenkins-ci.plugins.workflow</groupId> | ||
<artifactId>workflow-cps</artifactId> | ||
<version>2803.v1a_f77ffcc773</version> | ||
<type>hpi</type> | ||
<outputDirectory>${jenkins.war.directory}/WEB-INF/plugins</outputDirectory> | ||
<destFileName>workflow-cps.hpi</destFileName> | ||
</artifactItem> | ||
<artifactItem> | ||
<groupId>org.jenkins-ci.plugins</groupId> | ||
<artifactId>support-core</artifactId> | ||
<version>1206.v14049fa_b_d860</version> | ||
<type>hpi</type> | ||
<outputDirectory>${jenkins.war.directory}/WEB-INF/plugins</outputDirectory> | ||
<destFileName>support-core.hpi</destFileName> | ||
</artifactItem> | ||
|
||
</artifactItems> | ||
<overWriteReleases>false</overWriteReleases> | ||
<overWriteSnapshots>true</overWriteSnapshots> | ||
</configuration> | ||
</execution> | ||
<execution> | ||
<id>get-workflow-cps</id> | ||
<phase>generate-resources</phase> | ||
<goals> | ||
<goal>get</goal> | ||
</goals> | ||
<configuration> | ||
<groupId>org.jenkins-ci.plugins.workflow</groupId> | ||
<artifactId>workflow-cps</artifactId> | ||
<version>2803.v1a_f77ffcc773</version> | ||
<packaging>hpi</packaging> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.codehaus.mojo</groupId> | ||
<artifactId>exec-maven-plugin</artifactId> | ||
<version>@exec-maven-plugin.version@</version> | ||
<executions> | ||
<execution> | ||
<phase>process-test-resources</phase> | ||
<goals> | ||
<goal>exec</goal> | ||
</goals> | ||
<configuration> | ||
<executable>jar</executable> | ||
<workingDirectory>${jenkins.war.directory}</workingDirectory> | ||
<arguments> | ||
<argument>uvf</argument> | ||
<argument>${jenkins.war.name}</argument> | ||
<argument>WEB-INF/plugins</argument> | ||
</arguments> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
<dependencyManagement> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.jenkins-ci.plugins</groupId> | ||
<artifactId>structs</artifactId> | ||
<version>318.va_f3ccb_729b_71</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.jenkins-ci</groupId> | ||
<artifactId>symbol-annotation</artifactId> | ||
<version>1.20</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>ant</groupId> | ||
<artifactId>ant</artifactId> | ||
<!-- because old version have dependencies on xml-apis:xml-apis:2.6.2 which doesn't exists --> | ||
olamy marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<version>1.7.0</version> | ||
</dependency> | ||
</dependencies> | ||
</dependencyManagement> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.jenkins-ci.plugins.workflow</groupId> | ||
<artifactId>workflow-cps</artifactId> | ||
<version>2.92</version> | ||
<optional>true</optional> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.jenkins-ci.tools.hpi.its</groupId> | ||
<artifactId>test-dependencies-transitive-optional-dep</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
<optional>true</optional> | ||
</dependency> | ||
</dependencies> | ||
</project> |
2 changes: 2 additions & 0 deletions
2
src/it/test-dependencies-transitive-optional/src/main/resources/index.jelly
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<?jelly escape-by-default='true'?> | ||
<div/> |
43 changes: 43 additions & 0 deletions
43
src/it/test-dependencies-transitive-optional/src/test/java/test/SampleTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package test; | ||
|
||
import com.google.common.collect.ImmutableMap; | ||
import hudson.remoting.Which; | ||
import java.io.InputStream; | ||
import java.net.URL; | ||
import java.util.Enumeration; | ||
import java.util.Map; | ||
import java.util.jar.Manifest; | ||
import com.cloudbees.jenkins.support.SupportPlugin; | ||
import org.junit.Test; | ||
import static org.junit.Assert.*; | ||
import org.junit.Rule; | ||
import org.jvnet.hudson.test.JenkinsRule; | ||
|
||
public class SampleTest { | ||
|
||
@Rule | ||
public JenkinsRule r = new JenkinsRule(); | ||
|
||
@Test | ||
public void smokes() throws Exception { | ||
Map<String, String> expectedVersions = ImmutableMap.of("support-core","1206.v14049fa_b_d860"); | ||
|
||
Enumeration<URL> manifests = SampleTest.class.getClassLoader().getResources("META-INF/MANIFEST.MF"); | ||
while (manifests.hasMoreElements()) { | ||
URL url = manifests.nextElement(); | ||
try (InputStream is = url.openStream()) { | ||
Manifest mf = new Manifest(is); | ||
String pluginName = mf.getMainAttributes().getValue("Short-Name"); | ||
String expectedVersion = expectedVersions.get(pluginName); | ||
if (expectedVersion != null) { | ||
assertEquals("wrong version for " + pluginName + " as classpath entry", expectedVersion, mf.getMainAttributes().getValue("Plugin-Version")); | ||
} | ||
} | ||
} | ||
for (Map.Entry<String, String> entry : expectedVersions.entrySet()) { | ||
assertEquals("wrong version for " + entry.getKey() + " as plugin", entry.getValue(), r.jenkins.pluginManager.getPlugin(entry.getKey()).getVersion()); | ||
} | ||
assertEquals("support-core-1206.v14049fa_b_d860.jar", Which.jarFile(SupportPlugin.class).getName()); | ||
} | ||
|
||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this really need to be done this way, or can you just do everything in one dir using a multimodule reactor?