Skip to content

Commit 1b0412e

Browse files
committed
EQX-211: Fixed AppFuse detection issue in modular archetypes.
1 parent 865f4f7 commit 1b0412e

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

plugins/appfuse-maven-plugin/src/main/java/org/appfuse/mojo/exporter/AppFuseGeneratorMojo.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,10 @@ protected Exporter configureExporter(Exporter exp) throws MojoExecutionException
281281
}
282282
}
283283

284+
boolean isAppFuse = (getProject().getParent().getArtifactId().contains("appfuse-web") ||
285+
getProject().getParent().getParent().getGroupId().contains("appfuse"));
286+
exporter.getProperties().setProperty("isAppFuse", String.valueOf(isAppFuse));
287+
284288
exporter.getProperties().setProperty("hasSecurity", String.valueOf(hasSecurity));
285289

286290
// determine if using Main or Home for Tapestry

plugins/appfuse-maven-plugin/src/main/java/org/appfuse/tool/AppFuseExporter.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ private void generateCore() {
112112

113113
private void generateWeb() {
114114
String packaging = getProperties().getProperty("packaging");
115+
boolean isAppFuse = Boolean.valueOf(getProperties().getProperty("isAppFuse"));
115116
boolean webProject = packaging != null && packaging.equalsIgnoreCase("war");
116117

117118
if (!webProject) return;
@@ -169,7 +170,7 @@ private void generateWeb() {
169170
configureExporter("appfuse/web/struts/action-beans.ftl", "src/main/webapp/WEB-INF/{class-name}-struts-bean.xml").start();
170171

171172
GenericExporter exporter = configureExporter("appfuse/web/struts/struts.ftl", "src/main/resources/{class-name}-struts.xml");
172-
exporter.getProperties().put("pagesPath", jwebUnitTemplate.exists() ? "" : "/WEB-INF/pages");
173+
exporter.getProperties().put("pagesPath", isAppFuse ? "/WEB-INF/pages" : "");
173174
exporter.start();
174175

175176
// validation

plugins/appfuse-maven-plugin/src/main/java/org/appfuse/tool/ArtifactInstaller.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,16 +74,14 @@ public void execute() {
7474
copyGeneratedObjects(this.sourceDirectory, this.destinationDirectory, "**/webapp/**/*.java");
7575

7676
String webFramework = project.getProperties().getProperty("web.framework");
77-
String pagesPath = (isAppFuse()) ? "/src/main/webapp/WEB-INF/pages/" : "/src/main/webapp/";
77+
String pagesPath = isAppFuse() ? "/src/main/webapp/WEB-INF/pages/" : "/src/main/webapp/";
7878

7979
if ("jsf".equalsIgnoreCase(webFramework)) {
8080
log("Installing JSF views and configuring...");
8181
installJSFNavigationAndBeans();
8282
installJSFViews();
8383
} else if ("struts".equalsIgnoreCase(webFramework)) {
8484
log("Installing Struts views and configuring...");
85-
// A bean definition for an Action is not used anymore (APF-798)
86-
// installStrutsBeanDefinition();
8785
installStrutsActionDefinitions();
8886
copyGeneratedObjects(sourceDirectory + "/src/main/resources",
8987
destinationDirectory + "/src/main/resources", "**/model/*.xml");
@@ -325,7 +323,8 @@ private void installWicketViews() {
325323
}
326324

327325
private boolean isAppFuse() {
328-
return (project.getParent().getArtifactId().contains("appfuse-web"));
326+
return (project.getParent().getArtifactId().contains("appfuse-web") ||
327+
project.getParent().getParent().getGroupId().contains("appfuse"));
329328
}
330329

331330
// =================== End of Views ===================

0 commit comments

Comments
 (0)