提交 26c5dea4 编写于 作者: J Jesse Glick

Load all bundled plugins during hudson-dev:run, not just maven-plugin & javadoc.

Not so visible an effect currently due to a bug fixed in 4ace69e (maven-hpi-plugin 1.87)
by which extensions of all plugins which are test deps of jenkins-test-harness were being loaded inadvertently.
Originally tried to define ${bundledPlugins} using gmaven-plugin as per [1] but this does not work,
so adopted the tack of just using a static glob *.hpi and interpreting that in core.
[1] http://stackoverflow.com/questions/7601835/why-cant-the-maven-deploy-plugin-resolve-my-custom-system-property
上级 a3aa29b2
......@@ -10,9 +10,12 @@ import java.util.Collection;
import java.util.List;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.logging.Level;
import java.util.logging.Logger;
import hudson.PluginManager;
import hudson.util.DirScanner;
import hudson.util.FileVisitor;
import hudson.util.Service;
/**
......@@ -65,20 +68,31 @@ public class InitStrategy {
}
/**
* Lists up additional bundled plugins from the system property.
*
* Lists up additional bundled plugins from the system property {@code hudson.bundled.plugins}.
* Since 1.480 glob syntax is supported.
* For use in the "mvn hudson-dev:run".
* TODO: maven-hpi-plugin should inject its own InitStrategy instead of having this in the core.
*/
protected void getBundledPluginsFromProperty(List<File> r) {
protected void getBundledPluginsFromProperty(final List<File> r) {
String hplProperty = System.getProperty("hudson.bundled.plugins");
if (hplProperty != null) {
for (String hplLocation : hplProperty.split(",")) {
File hpl = new File(hplLocation.trim());
if (hpl.exists())
if (hpl.exists()) {
r.add(hpl);
else
} else if (hpl.getName().contains("*")) {
try {
new DirScanner.Glob(hpl.getName(), null).scan(hpl.getParentFile(), new FileVisitor() {
@Override public void visit(File f, String relativePath) throws IOException {
r.add(f);
}
});
} catch (IOException x) {
LOGGER.log(Level.WARNING, "could not expand " + hplLocation, x);
}
} else {
LOGGER.warning("bundled plugin " + hplLocation + " does not exist");
}
}
}
}
......
......@@ -420,7 +420,7 @@ THE SOFTWARE.
<value><!-- run "mvn install" once will generate the.hpl -->
${basedir}/../maven-plugin/target/test-classes/the.hpl,
${basedir}/../ui-samples-plugin/target/test-classes/the.hpl,
${project.build.directory}/${project.build.finalName}/WEB-INF/plugins/javadoc.hpi
${project.build.directory}/${project.build.finalName}/WEB-INF/plugins/*.hpi
</value>
</systemProperty>
<systemProperty>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册