+++ /dev/null
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
-<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
-<listEntry value="/tomcat-7.0.x/java/org/apache/catalina/startup/Bootstrap.java"/>
-</listAttribute>
-<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
-<listEntry value="1"/>
-</listAttribute>
-<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.apache.catalina.startup.Bootstrap"/>
-<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="start"/>
-<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="tomcat-7.0.x"/>
-<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dcatalina.home=${project_loc:/tomcat-7.0.x/java/org/apache/catalina/startup/Bootstrap.java}"/>
-</launchConfiguration>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
-<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
-<listEntry value="/tomcat-7.0.x/java/org/apache/catalina/startup/Bootstrap.java"/>
-</listAttribute>
-<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
-<listEntry value="1"/>
-</listAttribute>
-<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.apache.catalina.startup.Bootstrap"/>
-<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="stop"/>
-<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="tomcat-7.0.x"/>
-<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dcatalina.home=${project_loc:/tomcat-7.0.x/java/org/apache/catalina/startup/Bootstrap.java}"/>
-</launchConfiguration>
<exclude name=".settings/**"/>
<exclude name=".classpath"/>
<exclude name=".project"/>
+ <exclude name="*.launch"/>
<exclude name="modules/**"/>
<exclude name="output/**"/>
<exclude name="build.properties"/>
<get src="${sourcefile}" dest="${destfile}" />
</target>
+ <!-- ============================ IDE Support ============================ -->
+
+ <target name="ide-eclipse" depends="deploy, extras-webservices-prepare"
+ description="Prepares the source tree to be built in Eclipse">
+
+ <!-- Copy the sample project files into the root directory -->
+ <copy file="${tomcat.home}/res/ide-support/eclipse/eclipse.project" tofile="${tomcat.home}/.project"/>
+ <copy file="${tomcat.home}/res/ide-support/eclipse/eclipse.classpath" tofile="${tomcat.home}/.classpath"/>
+
+ <echo>Eclipse project files created.
+Read the Building page on the Apache Tomcat documentation site for details on how to configure your Eclipse workplace.</echo>
+ </target>
+
<!-- ======================= Macros, Taskdefs etc ======================== -->
<macrodef name="jarIt" description="utility macro for standard JAR packaging">
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-<classpath>
- <classpathentry kind="src" path="java"/>
- <classpathentry kind="src" path="test"/>
- <classpathentry kind="src" path="webapps/examples/WEB-INF/classes"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/3"/>
- <classpathentry kind="var" path="ANT_HOME/lib/ant.jar"/>
- <classpathentry kind="var" path="TOMCAT_LIBS_BASE/tomcat7-deps/dbcp/tomcat-dbcp.jar" sourcepath="/TOMCAT_LIBS_BASE/tomcat7-deps/dbcp/src/java"/>
- <classpathentry kind="var" path="TOMCAT_LIBS_BASE/jaxrpc-1.1-rc4/geronimo-spec-jaxrpc-1.1-rc4.jar"/>
- <classpathentry kind="var" path="TOMCAT_LIBS_BASE/wsdl4j-1.6.1/wsdl4j-1.6.1.jar"/>
- <classpathentry kind="var" path="TOMCAT_LIBS_BASE/ecj-3.6/ecj-3.6.jar"/>
- <classpathentry kind="output" path=".settings/output"/>
-</classpath>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-<projectDescription>
- <name>tomcat-7.0.x</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<classpath>
+ <classpathentry kind="src" path="java"/>
+ <classpathentry kind="src" path="test"/>
+ <classpathentry kind="src" path="webapps/examples/WEB-INF/classes"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/3"/>
+ <classpathentry kind="var" path="ANT_HOME/lib/ant.jar"/>
+ <classpathentry kind="var" path="TOMCAT_LIBS_BASE/tomcat7-deps/dbcp/tomcat-dbcp.jar" sourcepath="/TOMCAT_LIBS_BASE/tomcat7-deps/dbcp/src/java"/>
+ <classpathentry kind="var" path="TOMCAT_LIBS_BASE/jaxrpc-1.1-rc4/geronimo-spec-jaxrpc-1.1-rc4.jar"/>
+ <classpathentry kind="var" path="TOMCAT_LIBS_BASE/wsdl4j-1.6.1/wsdl4j-1.6.1.jar"/>
+ <classpathentry kind="var" path="TOMCAT_LIBS_BASE/ecj-3.6/ecj-3.6.jar"/>
+ <classpathentry kind="output" path=".settings/output"/>
+</classpath>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<projectDescription>
+ <name>tomcat-7.0.x</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
+<listEntry value="/tomcat-7.0.x/java/org/apache/catalina/startup/Bootstrap.java"/>
+</listAttribute>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
+<listEntry value="1"/>
+</listAttribute>
+<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.apache.catalina.startup.Bootstrap"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="start"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="tomcat-7.0.x"/>
+<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dcatalina.home=${project_loc:/tomcat-7.0.x/java/org/apache/catalina/startup/Bootstrap.java}/output/build"/>
+</launchConfiguration>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
+<listEntry value="/tomcat-7.0.x/java/org/apache/catalina/startup/Bootstrap.java"/>
+</listAttribute>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
+<listEntry value="1"/>
+</listAttribute>
+<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.apache.catalina.startup.Bootstrap"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="stop"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="tomcat-7.0.x"/>
+<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dcatalina.home=${project_loc:/tomcat-7.0.x/java/org/apache/catalina/startup/Bootstrap.java}/output/build"/>
+</launchConfiguration>
</p>
<p>
-<b>NOTE:</b> You <b>must</b> complete all the above steps to fetch
-dependency libraries and build Tomcat before you can setup an Eclipse project and start
-using it.
-</p>
-<p>
<b>NOTE:</b> This will not let you build everything under Eclipse;
the build process requires use of Ant for the many stages that aren't
simple Java compilations.
under the IDE, and so on.
</p>
<p>
-Complete the download of all third party dependencies required to compile the Tomcat
-source in Eclipse:
+Sample Eclipse project files and launch targets are provided in the
+<code>res/ide-support/eclipse</code> directory of the source tree.
+The instructions below will automatically copy these into the required locations.
+</p>
+<p>
+An Ant target is provided as a convenience to download all binary dependencies, and to create
+the Eclipse project and classpath files in the root of the source tree.
<br/>
<code><br/>
cd ${tomcat.source}<br/>
- ant extras<br/>
+ ant ide-eclipse<br/>
</code>
</p>
-<p>
-Sample Eclipse project and classpath files are provided in the root directory of the source tree.
-The sample files are named <code>eclipse.project</code> and <code>eclipse.classpath</code>, and must
-be copied to <code>.project</code> and <code>.classpath</code> respectively before proceeding.
-</p>
<p>
Start Eclipse and create a new Workspace.
</p>
<p>
-You may see errors in your problems tab at this point about missing build path dependencies.
-If this happens you have forgotten to execute the <code>ant extras</code> build to download
-these dependencies.
-</p>
-
-<p>
-<code>Start Tomcat</code> and <code>Stop Tomcat</code> launch configurations are provided in the
-root directory of the source tree and will be available in the <em>Run->Run Configurations</em>
-dialog. Use these to start and stop Tomcat from Eclipse.
+<code>start-tomcat</code> and <code>stop-tomcat</code> launch configurations are provided in
+<code>res/ide-support/eclipse</code> and will be available in the <em>Run->Run Configurations</em>
+dialog. Use these to start and stop Tomcat from Eclipse.
<br/>If you want to configure these yourself (or are using a different IDE)
then use <code>org.apache.catalina.startup.Bootstrap</code> as the main class,
-<code>start</code>/<code>stop</code> as program arguments, and specify <code>-Dcatalina.home=...</code>
+<code>start</code>/<code>stop</code> etc. as program arguments, and specify <code>-Dcatalina.home=...</code>
(with the name of your build directory) as VM arguments.
</p>
+<p>
+Tweaking a few formatting preferences will make it much easier to keep consistent with Tomcat
+coding conventions (and have your contributions accepted):
+</p>
+<p>
+<table border="1">
+ <tr><td>Java -> Code Style -> Formatter -> Edit...</td>
+ <td>Tab policy: Spaces only<br/>Tab and Indentation size: 4</td></tr>
+ <tr><td>General -> Editors -> Text Editors</td>
+ <td>Displayed tab width: 2<br/>Insert spaces for tabs<br/>Show whitespace characters (optional)</td></tr>
+ <tr><td>XML -> XML Files -> Editor</td><td>Indent using spaces<br/>Indentation size: 2</td></tr>
+ <tr><td>Ant -> Editor -> Formatter</td><td>Tab size: 2<br/>Use tab character instead of spaces: unchecked</td></tr>
+</table>
+</p>
+
</section>
<section name="Building with other IDEs">