提交 dabb3519 编写于 作者: K kohsuke

merged the last RC branch

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@16922 71c3de6d-444a-0410-be80-ed276b4c234a
上级 fd5988d3
......@@ -27,7 +27,7 @@ THE SOFTWARE.
<parent>
<groupId>org.jvnet.hudson.main</groupId>
<artifactId>pom</artifactId>
<version>1.296-SNAPSHOT</version>
<version>1.298-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
......
......@@ -162,12 +162,13 @@ public class ClassicPluginStrategy implements PluginStrategy {
String hudsonVersion = manifest.getMainAttributes().getValue("Hudson-Version");
String shortName = manifest.getMainAttributes().getValue("Short-Name");
if (!"maven-plugin".equals(shortName) &&
(hudsonVersion == null || hudsonVersion.compareTo("1.296") <= 0)) {
// some earlier versions of maven-hpi-plugin apparently puts "null" as a literal here. Watch out for those.
(hudsonVersion == null || hudsonVersion.equals("null") || hudsonVersion.compareTo("1.296") <= 0)) {
optionalDependencies.add(new PluginWrapper.Dependency("maven-plugin:" + Hudson.VERSION));
}
ClassLoader dependencyLoader = new DependencyClassLoader(getClass()
.getClassLoader(), dependencies);
.getClassLoader(), Util.join(dependencies,optionalDependencies));
ClassLoader classLoader = new URLClassLoader(paths.toArray(new URL[paths.size()]),
dependencyLoader);
......
......@@ -180,7 +180,7 @@ public final class PluginManager extends AbstractModelObject {
URL url = context.getResource(path);
long lastModified = url.openConnection().getLastModified();
File file = new File(rootDir, fileName);
if (file.exists() && file.lastModified() != lastModified) {
if (!file.exists() || file.lastModified() != lastModified) {
FileUtils.copyURLToFile(url, file);
file.setLastModified(url.openConnection().getLastModified());
// lastModified is set for two reasons:
......
......@@ -779,6 +779,19 @@ public class Util {
return buf.toString();
}
/**
* Combines all the given collections into a single list.
*/
public static <T> List<T> join(Collection<? extends T>... items) {
int size = 0;
for (Collection<? extends T> item : items)
size += item.size();
List<T> r = new ArrayList<T>(size);
for (Collection<? extends T> item : items)
r.addAll(item);
return r;
}
/**
* Creates Ant {@link FileSet} with the base dir and include pattern.
*
......
......@@ -26,10 +26,10 @@ THE SOFTWARE.
<div class="warning">
<form method="post" action="${rootURL}/${it.url}/act" name="${it.id}">
<div style="float:right">
<f:submit name="yes" value="${%Create a view now}"/>
<f:submit name="yes" value="$(%Create a view now}"/>
<f:submit name="no" value="${%Dismiss}"/>
</div>
${%blurb}
</form>
</div>
</j:jelly>
\ No newline at end of file
</j:jelly>
hudson (1.297) unstable; urgency=low
* See http://hudson.dev.java.net/changelog.html for more details.
-- Kohsuke Kawaguchi <kk@kohsuke.org> Mon, 06 Apr 2009 17:47:31 -0700
hudson (1.296) unstable; urgency=low
* See http://hudson.dev.java.net/changelog.html for more details.
-- Kohsuke Kawaguchi <kk@kohsuke.org> Fri, 03 Apr 2009 19:33:32 -0700
hudson (1.295) unstable; urgency=low
* See http://hudson.dev.java.net/changelog.html for more details.
......
......@@ -27,7 +27,7 @@ THE SOFTWARE.
<parent>
<groupId>org.jvnet.hudson.main</groupId>
<artifactId>pom</artifactId>
<version>1.296-SNAPSHOT</version>
<version>1.298-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
......
......@@ -27,7 +27,7 @@ THE SOFTWARE.
<parent>
<groupId>org.jvnet.hudson.main</groupId>
<artifactId>pom</artifactId>
<version>1.296-SNAPSHOT</version>
<version>1.298-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
......
......@@ -27,7 +27,7 @@ THE SOFTWARE.
<parent>
<groupId>org.jvnet.hudson.main</groupId>
<artifactId>pom</artifactId>
<version>1.296-SNAPSHOT</version>
<version>1.298-SNAPSHOT</version>
</parent>
<artifactId>maven-plugin</artifactId>
......
......@@ -33,7 +33,7 @@ THE SOFTWARE.
<groupId>org.jvnet.hudson.main</groupId>
<artifactId>pom</artifactId>
<version>1.296-SNAPSHOT</version>
<version>1.298-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Hudson main module</name>
......
......@@ -27,7 +27,7 @@ THE SOFTWARE.
<parent>
<groupId>org.jvnet.hudson.main</groupId>
<artifactId>pom</artifactId>
<version>1.296-SNAPSHOT</version>
<version>1.298-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
......
......@@ -27,7 +27,7 @@ THE SOFTWARE.
<parent>
<artifactId>pom</artifactId>
<groupId>org.jvnet.hudson.main</groupId>
<version>1.296-SNAPSHOT</version>
<version>1.298-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.jvnet.hudson.main</groupId>
......
......@@ -57,4 +57,25 @@ public class PluginManagerTest extends HudsonTestCase {
public void testWithRecipe() throws Exception {
assertNotNull(hudson.getPlugin("tasks"));
}
/**
* Makes sure that plugins can see Maven2 plugin that's refactored out in 1.296.
*/
@WithPlugin("tasks.hpi")
public void testOptionalMavenDependency() throws Exception {
PluginWrapper.Dependency m2=null;
PluginWrapper tasks = hudson.getPluginManager().getPlugin("tasks");
for( PluginWrapper.Dependency d : tasks.getOptionalDependencies() ) {
if(d.shortName.equals("maven-plugin")) {
assertNull(m2);
m2 = d;
}
}
assertNotNull(m2);
// this actually doesn't really test what we need, though, because
// I thought test harness is loading the maven classes by itself.
// TODO: write a separate test that tests the optional dependency loading
tasks.classLoader.loadClass(hudson.maven.agent.AbortException.class.getName());
}
}
......@@ -73,6 +73,19 @@ public class MavenProjectTest extends HudsonTestCase {
assertTrue(page.getWebResponse().getContentAsString().contains(hudson.getDescriptorByType(RedeployPublisher.DescriptorImpl.class).getDisplayName()));
}
/**
* Makes sure that {@link ArtifactArchiver} doesn't show up in the m2 job type config screen.
* This is to make sure that the exclusion in {@link MavenModuleSet.DescriptorImpl#isApplicable(Descriptor)}
* is working.
*/
public void testExclusion() throws Exception {
MavenModuleSet p = createMavenProject();
HtmlPage page = new WebClient().getPage(p, "configure");
assertFalse(page.getWebResponse().getContentAsString().contains(hudson.getDescriptorByType(ArtifactArchiver.DescriptorImpl.class).getDisplayName()));
// but this should exist. This verifies that the approach of the test is sane (and for example, to make sure getContentAsString()!="")
assertTrue(page.getWebResponse().getContentAsString().contains(hudson.getDescriptorByType(RedeployPublisher.DescriptorImpl.class).getDisplayName()));
}
/**
* Attempt to reproduce #2154, but this appears to work.
*/
......
......@@ -27,7 +27,7 @@ THE SOFTWARE.
<parent>
<groupId>org.jvnet.hudson.main</groupId>
<artifactId>pom</artifactId>
<version>1.296-SNAPSHOT</version>
<version>1.298-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
......@@ -109,8 +109,7 @@ THE SOFTWARE.
<resolveArtifact artifactId="winstone" tofile="${basedir}/target/generated-resources/winstone.jar" />
<!-- maven plugin is bundled -->
<resolveArtifact artifactId="maven-plugin"
tofile="${basedir}/target/generated-resources/WEB-INF/plugins/maven-plugin.hpi" />
<resolveArtifact artifactId="maven-plugin" tofile="${basedir}/target/generated-resources/WEB-INF/plugins/maven-plugin.hpi" />
</tasks>
</configuration>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册