mirror of
https://github.com/apache/struts.git
synced 2026-08-05 22:56:59 +00:00
quick start runs from idea once again
git-svn-id: https://svn.apache.org/repos/asf/incubator/webwork2@396426 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -116,6 +116,76 @@
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>ant</groupId>
|
||||
<artifactId>ant</artifactId>
|
||||
<version>1.6.5</version>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>tomcat</groupId>
|
||||
<artifactId>jasper-compiler</artifactId>
|
||||
<version>5.5.12</version>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>tomcat</groupId>
|
||||
<artifactId>jasper-runtime</artifactId>
|
||||
<version>5.5.12</version>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>tomcat</groupId>
|
||||
<artifactId>jasper-compiler-jdt</artifactId>
|
||||
<version>5.5.12</version>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>commons-el</groupId>
|
||||
<artifactId>commons-el</artifactId>
|
||||
<version>1.0</version>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>commons-io</groupId>
|
||||
<artifactId>commons-io</artifactId>
|
||||
<version>1.0</version>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>commons-lang</groupId>
|
||||
<artifactId>commons-lang</artifactId>
|
||||
<version>2.1</version>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>jspapi</groupId>
|
||||
<artifactId>jsp-api</artifactId>
|
||||
<version>2.0</version>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>commons-collections</groupId>
|
||||
<artifactId>commons-collections</artifactId>
|
||||
<version>2.1.1</version>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>xstream</groupId>
|
||||
<artifactId>xstream</artifactId>
|
||||
<version>1.1.2</version>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
|
||||
<!-- Jasper -->
|
||||
<dependency>
|
||||
<groupId>jasperreports</groupId>
|
||||
|
||||
@@ -35,9 +35,9 @@ import java.util.Map;
|
||||
* Configuration for the QuickStart program.
|
||||
*/
|
||||
public class Configuration implements Serializable {
|
||||
|
||||
|
||||
private static final long serialVersionUID = 9159115401614443449L;
|
||||
|
||||
|
||||
String ideaConfig;
|
||||
String extendsConfig;
|
||||
String resolver;
|
||||
@@ -132,32 +132,36 @@ public class Configuration implements Serializable {
|
||||
|
||||
public void resolveDirs(String wd) {
|
||||
if (ideaConfig != null) {
|
||||
String full = resolveDir(this.ideaConfig, wd);
|
||||
String[] parts = ideaConfig.split(",");
|
||||
for (int i = 0; i < parts.length; i++) {
|
||||
String full = resolveDir(parts[i], wd);
|
||||
|
||||
try {
|
||||
DocumentBuilder db = DocumentBuilderFactory.newInstance().newDocumentBuilder();
|
||||
Document doc = db.parse(full);
|
||||
NodeList components = doc.getElementsByTagName("root");
|
||||
List jars = new ArrayList();
|
||||
for (int i = 0; i < components.getLength(); i++) {
|
||||
Element e = (Element) components.item(i);
|
||||
String value = e.getAttribute("url");
|
||||
if (value != null && value.startsWith("jar://") && value.endsWith(".jar!/")) {
|
||||
value = value.substring(6, value.length() - 2);
|
||||
if (value.startsWith("$MODULE_DIR$")) {
|
||||
value = value.substring(13);
|
||||
try {
|
||||
DocumentBuilder db = DocumentBuilderFactory.newInstance().newDocumentBuilder();
|
||||
Document doc = db.parse(full);
|
||||
NodeList components = doc.getElementsByTagName("root");
|
||||
List jars = new ArrayList();
|
||||
for (int j = 0; j < components.getLength(); j++) {
|
||||
Element e = (Element) components.item(j);
|
||||
String value = e.getAttribute("url");
|
||||
if (value != null && value.startsWith("jar://") && value.endsWith(".jar!/")) {
|
||||
value = value.substring(6, value.length() - 2);
|
||||
if (value.startsWith("$MODULE_DIR$")) {
|
||||
value = value.substring(13);
|
||||
}
|
||||
jars.add(value);
|
||||
}
|
||||
jars.add(value);
|
||||
}
|
||||
|
||||
if (this.libs != null) {
|
||||
this.libs.addAll(jars);
|
||||
} else {
|
||||
this.libs = jars;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
if (this.libs != null) {
|
||||
this.libs.addAll(jars);
|
||||
} else {
|
||||
this.libs = jars;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
resolve(this.libs, wd);
|
||||
|
||||
+4
-4
@@ -85,12 +85,12 @@ public class MultiWebApplicationContext extends WebApplicationContext {
|
||||
|
||||
// still haven't found what we're looking for?
|
||||
// Alright, let's just hack this to work in IDEA
|
||||
if (uriInContext.equals("/struts")) {
|
||||
if (uriInContext.equals("/struts-action")) {
|
||||
// we do this check to support both "quickstart:showcase" and "quickstart" (using quickstart.xml)
|
||||
if (new File("../../src/java/META-INF/taglib.tld").exists()) {
|
||||
return FileResource.newResource("../../src/java/META-INF/taglib.tld");
|
||||
if (new File("../../action/src/main/resources/META-INF/taglib.tld").exists()) {
|
||||
return FileResource.newResource("../../action/src/main/resources/META-INF/taglib.tld");
|
||||
} else {
|
||||
return FileResource.newResource("src/java/META-INF/taglib.tld");
|
||||
return FileResource.newResource("src/main/resources/META-INF/taglib.tld");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -297,6 +297,66 @@
|
||||
<version>3.1.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>ant</groupId>
|
||||
<artifactId>ant</artifactId>
|
||||
<version>1.6.5</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>tomcat</groupId>
|
||||
<artifactId>jasper-runtime</artifactId>
|
||||
<version>5.5.12</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>tomcat</groupId>
|
||||
<artifactId>jasper-compiler</artifactId>
|
||||
<version>5.5.12</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>tomcat</groupId>
|
||||
<artifactId>jasper-compiler-jdt</artifactId>
|
||||
<version>5.5.12</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>commons-el</groupId>
|
||||
<artifactId>commons-el</artifactId>
|
||||
<version>1.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>commons-io</groupId>
|
||||
<artifactId>commons-io</artifactId>
|
||||
<version>1.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>commons-lang</groupId>
|
||||
<artifactId>commons-lang</artifactId>
|
||||
<version>2.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>jspapi</groupId>
|
||||
<artifactId>jsp-api</artifactId>
|
||||
<version>2.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>commons-collections</groupId>
|
||||
<artifactId>commons-collections</artifactId>
|
||||
<version>2.1.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>xstream</groupId>
|
||||
<artifactId>xstream</artifactId>
|
||||
<version>1.1.2</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Tiles -->
|
||||
<dependency>
|
||||
<groupId>org.apache.struts.tiles</groupId>
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
users who don't have a single directory in their project that
|
||||
contains all the libraries they need.
|
||||
-->
|
||||
<!--<ideaConfig>ShowCase.iml</ideaConfig>-->
|
||||
<ideaConfig>../../action/action.iml,../../thirdparty/jasperreports/action-jasperreports.iml,webapp-showcase.iml</ideaConfig>
|
||||
|
||||
<!-- The context in which to deploy the web application -->
|
||||
<context>/showcase</context>
|
||||
@@ -37,14 +37,16 @@
|
||||
using the classDirs and libs elements
|
||||
-->
|
||||
<sources>
|
||||
<dir>src/java</dir>
|
||||
<dir>src/main/java</dir>
|
||||
</sources>
|
||||
|
||||
<!--
|
||||
The classDirs directories can be a jar or a directory of classes
|
||||
-->
|
||||
<classDirs>
|
||||
<dir>src/webapp/WEB-INF/classes</dir>
|
||||
<dir>src/main/webapp/WEB-INF/classes</dir>
|
||||
<dir>../../thirdparty/jasperreports/target/classes</dir>
|
||||
<dir>../../action/target/classes</dir>
|
||||
</classDirs>
|
||||
|
||||
<!--
|
||||
@@ -56,7 +58,7 @@
|
||||
<webDirs>
|
||||
<webDir>
|
||||
<path>/</path>
|
||||
<dir>src/webapp</dir>
|
||||
<dir>src/main/webapp</dir>
|
||||
</webDir>
|
||||
</webDirs>
|
||||
</configuration>
|
||||
Reference in New Issue
Block a user