Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -203,10 +203,16 @@ private void writeDirectoryPostResource(Element postResourceEl, String path)
*/
private void writeJarPostResource(StringBuilder sb, String path)
{
if (Boolean.parseBoolean(getPropertyValue(TomcatPropertySet.CONTEXT_MAPJARSTOWEBINFCLASSES))) {
sb.append("className=\"" + JAR_RESOURCE_SET + "\" base=\"");
sb.append(path.replace("&", "&"));
sb.append("\" webAppMount=\"/WEB-INF/classes/");
} else {
sb.append("className=\"" + FILE_RESOURCE_SET + "\" base=\"");
sb.append(path.replace("&", "&"));
sb.append("\" webAppMount=\"/WEB-INF/lib/");
sb.append(getFileHandler().getName(path).replace("&", "&"));
}
}

/**
Expand All @@ -217,10 +223,16 @@ private void writeJarPostResource(StringBuilder sb, String path)
*/
private void writeJarPostResource(Element postResourceEl, String path)
{
if (Boolean.parseBoolean(getPropertyValue(TomcatPropertySet.CONTEXT_MAPJARSTOWEBINFCLASSES))) {
postResourceEl.setAttribute("className", JAR_RESOURCE_SET);
postResourceEl.setAttribute("base", path.replace("&", "&"));
postResourceEl.setAttribute("webAppMount", "/WEB-INF/classes/");
} else {
postResourceEl.setAttribute("className", FILE_RESOURCE_SET);
postResourceEl.setAttribute("base", path.replace("&", "&"));
postResourceEl.setAttribute("webAppMount", "/WEB-INF/lib/"
+ getFileHandler().getName(path).replace("&", "&"));
}
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ public interface TomcatPropertySet
*/
String CONTEXT_ALLOWWEBJARS = "cargo.tomcat.context.addWebinfClassesResources";

/**
* Whether the contexts for deployed webapplications should map JARs to WEB-INF/classes
*/
String CONTEXT_MAPJARSTOWEBINFCLASSES = "cargo.tomcat.context.mapJarToWebinfClasses";

/**
* Whether WAR deployables should be copied or referenced.
*/
Expand Down