Skip to content

Commit

Permalink
MAVEN-207 Reuse toolsClassLoader rather than creating a new one each …
Browse files Browse the repository at this point in the history
…time
  • Loading branch information
mbowerman authored and brianchandotcom committed Jan 21, 2016
1 parent e551141 commit 3f42175
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
Expand Up @@ -329,7 +329,11 @@ protected List<String> getProjectClassPath() throws Exception {
}

protected ClassLoader getToolsClassLoader() throws Exception {
return toClassLoader(getToolsClassPath());
if (_toolsClassLoader == null) {
_toolsClassLoader = toClassLoader(getToolsClassPath());
}

return _toolsClassLoader;
}

protected ClassLoader getToolsClassLoader(Dependency[] dependencies)
Expand Down Expand Up @@ -726,4 +730,5 @@ protected ClassLoader toClassLoader(List<String> classPath)
private static Pattern _majorVersionPattern = Pattern.compile(
"(\\d+[.]\\d+)");

private static ClassLoader _toolsClassLoader;
}
Expand Up @@ -220,7 +220,7 @@ protected void deployExtWeb(File extWebDocrootDir) throws Exception {
};

executeTool(
"com.liferay.portal.tools.WebXMLBuilder", getProjectClassLoader(),
"com.liferay.portal.tools.WebXMLBuilder", getToolsClassLoader(),
args);

FileUtil.move(mergedWebXml, originalWebXml);
Expand All @@ -229,13 +229,13 @@ protected void deployExtWeb(File extWebDocrootDir) throws Exception {
protected void deployHook() throws Exception {
executeTool(
"com.liferay.portal.tools.deploy.HookDeployer",
getProjectClassLoader(), getRequiredPortalJars());
getToolsClassLoader(), getRequiredPortalJars());
}

protected void deployLayoutTemplate() throws Exception {
executeTool(
"com.liferay.portal.tools.deploy.LayoutTemplateDeployer",
getProjectClassLoader(), getRequiredPortalJars());
getToolsClassLoader(), getRequiredPortalJars());
}

protected void deployPortlet() throws Exception {
Expand All @@ -260,7 +260,7 @@ protected void deployPortlet() throws Exception {

executeTool(
"com.liferay.portal.tools.deploy.PortletDeployer",
getProjectClassLoader(), getRequiredPortalJars());
getToolsClassLoader(), getRequiredPortalJars());
}

protected void deployTheme() throws Exception {
Expand All @@ -273,13 +273,13 @@ protected void deployTheme() throws Exception {

executeTool(
"com.liferay.portal.tools.deploy.ThemeDeployer",
getProjectClassLoader(), getRequiredPortalJars());
getToolsClassLoader(), getRequiredPortalJars());
}

protected void deployWeb() throws Exception {
executeTool(
"com.liferay.portal.tools.deploy.WebDeployer",
getProjectClassLoader(), getRequiredPortalJars());
getToolsClassLoader(), getRequiredPortalJars());
}

protected void doExecute() throws Exception {
Expand Down

0 comments on commit 3f42175

Please sign in to comment.