You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cactus-dev@jakarta.apache.org by jr...@apache.org on 2003/01/31 11:34:41 UTC
cvs commit: jakarta-cactus/petals/eclipse/src/java/org/apache/cactus/eclipse/launcher WarBuilder.java
jruaux 2003/01/31 02:34:41
Modified: petals/eclipse/src/java/org/apache/cactus/eclipse/launcher
WarBuilder.java
Log:
Moved path strings as private variables
Added web.xml user overriding
Revision Changes Path
1.2 +34 -7 jakarta-cactus/petals/eclipse/src/java/org/apache/cactus/eclipse/launcher/WarBuilder.java
Index: WarBuilder.java
===================================================================
RCS file: /home/cvs/jakarta-cactus/petals/eclipse/src/java/org/apache/cactus/eclipse/launcher/WarBuilder.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- WarBuilder.java 30 Jan 2003 15:37:08 -0000 1.1
+++ WarBuilder.java 31 Jan 2003 10:34:40 -0000 1.2
@@ -99,7 +99,26 @@
* the location of the Ant build file for creating wars
*/
private File buildFileLocation;
-
+ /**
+ * Cactus plug-in relative path to the war build file
+ */
+ private String buildFilePath = "./ant/build-war.xml";
+ /**
+ * Cactus plug-in relative path to the web.xml file
+ */
+ private String webXMLPath = "./ant/confs/web.xml";
+ /**
+ * User's project relative path to the web directory
+ */
+ private String userWebFilesPath = "web";
+ /**
+ * User's project relative path to the web.xml file
+ */
+ private String userWebXMLPath = userWebFilesPath + "/WEB-INF/web.xml";
+ /**
+ * User's project relative path to the lib directory
+ */
+ private String userJarFilesPath = userWebFilesPath + "/WEB-INF/lib";
/**
* Constructor.
* @param theBuildFileLocation the build file for war creation
@@ -132,16 +151,24 @@
{
CactusPlugin thePlugin = CactusPlugin.getDefault();
buildFileLocation =
- new File(thePlugin.find(new Path("./ant/build-war.xml")).getPath());
+ new File(thePlugin.find(new Path(buildFilePath)).getPath());
IPath projectPath = theJavaProject.getProject().getLocation();
IPath classFilesPath =
projectPath.removeLastSegments(1).append(
theJavaProject.getOutputLocation());
userClassFilesDir = classFilesPath.toFile();
- userWebXML = projectPath.append("web.xml").toFile();
- userJarFilesDir = projectPath.append("lib").toFile();
+ userWebXML = projectPath.append(userWebXMLPath).toFile();
+
+ if (!userWebXML.exists())
+ {
+ userWebXML =
+ new File(
+ thePlugin.find(new Path(webXMLPath)).getPath());
+ }
+
+ userJarFilesDir = projectPath.append(userJarFilesPath).toFile();
// copy any web folder situated in the user's project
- userWebFilesDir = projectPath.append("web").toFile();
+ userWebFilesDir = projectPath.append(userWebFilesPath).toFile();
}
/**
@@ -168,7 +195,7 @@
String jarFilesPath = userJarFilesDir.getAbsolutePath();
arguments.add("-Djars.dir=" + jarFilesPath);
-
+
String webXMLPath = userWebXML.getAbsolutePath();
arguments.add("-Dwebxml.path=" + webXMLPath);
---------------------------------------------------------------------
To unsubscribe, e-mail: cactus-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: cactus-dev-help@jakarta.apache.org