2.1Working with eclipse
Beside the root of the cmsWorks installation we create a project folder for Eclipse. The project configuration only relies on the two configuration files .classpath and .project. Also there have to be two folders which declare a folder for sources and a folder for the compile target.
A download with an example structure is in the download center of www.cmsworks.app and ready to be imported as project in your Eclipse IDE.
The .project file contains:
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>cmsWorks</name>
<comment>cmsWorks</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>
<linkedResources>
<link>
<name>cmsworks</name>
<type>2</type>
<locationURI>PARENT-1-PROJECT_LOC/cmsworks</locationURI>
</link>
</linkedResources>
</projectDescription>Example of the content of the .project file from the Eclipse project configuration
The entry <name> currently contains "cmsWorks". This is the unique project name for Eclipse. This name should be tailored if more than one cmsWorks project will be maintained by Eclipse.
The only linked folder for the project is the "cmsworks" folder beside the Eclipse project folder.
The .classpath file contains:
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER">
<attributes>
<attribute name="module" value="true"/>
<attribute name="add-exports" value="java.base/com.sun.crypto.provider=ALL-UNNAMED"/>
<attribute name="limit-modules" value="java.rmi,jdk.management.jfr,jdk.jdi,jdk.charsets,java.xml,jdk.xml.dom,java.datatransfer,jdk.jstatd,jdk.httpserver,jdk.jcmd,java.desktop,java.se,java.security.sasl,jdk.zipfs,java.base,jdk.crypto.ec,jdk.javadoc,jdk.management.agent,jdk.jshell,jdk.editpad,jdk.sctp,jdk.jsobject,jdk.unsupported,java.smartcardio,jdk.jlink,java.security.jgss,java.compiler,jdk.nio.mapmode,jdk.dynalink,jdk.unsupported.desktop,jdk.accessibility,jdk.security.jgss,jdk.incubator.vector,jdk.hotspot.agent,java.xml.crypto,java.logging,jdk.jfr,jdk.internal.vm.ci,jdk.crypto.cryptoki,jdk.net,jdk.random,java.naming,jdk.internal.ed,java.prefs,java.net.http,jdk.compiler,jdk.naming.rmi,jdk.internal.opt,jdk.jconsole,jdk.attach,jdk.crypto.mscapi,jdk.internal.le,java.management,jdk.jdwp.agent,jdk.incubator.foreign,jdk.internal.jvmstat,java.instrument,jdk.internal.vm.compiler,jdk.internal.vm.compiler.management,jdk.management,jdk.security.auth,java.scripting,jdk.jdeps,jdk.jartool,java.management.rmi,jdk.jpackage,jdk.naming.dns,jdk.localedata"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="cmsworks/run/lib/itechworks/commons-logging/b003/topas-commons-logging.jar"/>
<classpathentry kind="lib" path="cmsworks/run/lib/ext/concurrent.jar"/>
<classpathentry kind="lib" path="cmsworks/run/lib/jetty/11.0.8/apache-jsp/org.eclipse.jdt.ecj-3.27.0.jar" sourcepath="lib-src/jetty.project-jetty-11.0.8.zip"/>
<classpathentry kind="lib" path="cmsworks/run/lib/jetty/11.0.8/apache-jsp/org.eclipse.jetty.apache-jsp-11.0.8.jar" sourcepath="lib-src/jetty.project-jetty-11.0.8.zip"/>
<classpathentry kind="lib" path="cmsworks/run/lib/jetty/11.0.8/apache-jsp/org.mortbay.jasper.apache-el-10.0.14.jar" sourcepath="lib-src/jetty.project-jetty-11.0.8.zip"/>
<classpathentry kind="lib" path="cmsworks/run/lib/jetty/11.0.8/apache-jsp/org.mortbay.jasper.apache-jsp-10.0.14.jar" sourcepath="lib-src/jetty.project-jetty-11.0.8.zip"/>
<classpathentry kind="lib" path="cmsworks/run/lib/jetty/11.0.8/logging/jetty-slf4j-impl-11.0.8.jar" sourcepath="lib-src/jetty.project-jetty-11.0.8.zip"/>
<classpathentry kind="lib" path="cmsworks/run/lib/jetty/11.0.8/logging/slf4j-api-2.0.0-alpha5.jar" sourcepath="lib-src/jetty.project-jetty-11.0.8.zip"/>
<classpathentry kind="lib" path="cmsworks/run/lib/jetty/11.0.8/jetty-http-11.0.8.jar" sourcepath="lib-src/jetty.project-jetty-11.0.8.zip"/>
<classpathentry kind="lib" path="cmsworks/run/lib/jetty/11.0.8/jetty-io-11.0.8.jar" sourcepath="lib-src/jetty.project-jetty-11.0.8.zip"/>
<classpathentry kind="lib" path="cmsworks/run/lib/jetty/11.0.8/jetty-security-11.0.8.jar" sourcepath="lib-src/jetty.project-jetty-11.0.8.zip"/>
<classpathentry kind="lib" path="cmsworks/run/lib/jetty/11.0.8/jetty-server-11.0.8.jar" sourcepath="lib-src/jetty.project-jetty-11.0.8.zip"/>
<classpathentry kind="lib" path="cmsworks/run/lib/jetty/11.0.8/jetty-servlet-11.0.8.jar" sourcepath="lib-src/jetty.project-jetty-11.0.8.zip"/>
<classpathentry kind="lib" path="cmsworks/run/lib/jetty/11.0.8/jetty-util-11.0.8.jar" sourcepath="lib-src/jetty.project-jetty-11.0.8.zip"/>
<classpathentry kind="lib" path="cmsworks/run/lib/eclipse/jakarta-ee/jakarta.servlet-api-5.0.0.jar" sourcepath="lib-src/jakarta-servlet-api-master.zip"/>
<classpathentry kind="lib" path="cmsworks/run/lib/mysql/5.1.7/mysql-connector-java-5.1.7-bin.jar"/>
<classpathentry kind="lib" path="cmsworks/run/lib/hsqldb/2.7.1/hsqldb.jar"/>
<classpathentry kind="lib" path="cmsworks/run/lib/postgresql/postgresql-42.5.1.jar"/>
<classpathentry kind="lib" path="cmsworks/run/lib/oracle/ojdbc11.jar"/>
<classpathentry kind="lib" path="cmsworks/run/lib/eclipse/jakarta-ee/jakarta.mail-api-2.1.1.jar"/>
<classpathentry kind="lib" path="cmsworks/run/lib/eclipse/jakarta-ee/jakarta.activation-api-2.1.1.jar"/>
<classpathentry kind="lib" path="cmsworks/run/lib/eclipse/angus-mail-2.0.1.jar"/>
<classpathentry kind="lib" path="cmsworks/run/lib/eclipse/angus-activation-2.0.0.jar"/>
<classpathentry kind="lib" path="cmsworks/run/lib/apache/derby/derbynet.jar"/>
<classpathentry kind="lib" path="cmsworks/run/lib/apache/avalon/avalon-framework-4.2.0.jar"/>
<classpathentry kind="lib" path="cmsworks/run/lib/apache/avalon/logkit-1.2.jar"/>
<classpathentry kind="lib" path="cmsworks/run/lib/apache/bcel/bcel.jar"/>
<classpathentry kind="lib" path="cmsworks/run/lib/apache/ftp/ftplet-api-1.2.0.jar"/>
<classpathentry kind="lib" path="cmsworks/run/lib/apache/ftp/ftpserver-core-1.2.0.jar"/>
<classpathentry kind="lib" path="cmsworks/run/lib/apache/ftp/mina-core-2.1.6.jar"/>
<!-- ================================================== -->
<classpathentry kind="lib" path="cmsworks/run/lib/minimal-json-0.9.5.jar"/>
<classpathentry kind="lib" path="cmsworks/run/lib/apache/lucene-3.6.0/lucene-analyzers-3.6.0.jar"/>
<classpathentry kind="lib" path="cmsworks/run/lib/apache/lucene-3.6.0/lucene-core-3.6.0.jar"/>
<classpathentry kind="lib" path="cmsworks/run/lib/apache/lucene-3.6.0/lucene-queries-3.6.0.jar"/>
<classpathentry kind="lib" path="cmsworks/run/lib/apache/lucene-3.6.0/lucene-queryparser-3.6.0.jar"/>
<classpathentry kind="lib" path="cmsworks/ext"/>
<classpathentry kind="output" path="compiled"/>
</classpath>Example of the content of the .classpath file from the Eclipse project configuration
This file declares the source path "src", the compilation target path "compiled" as output entry and all libraries the project needs.
After this, when the project folder is filled in Eclipse open "File" -> "Import..." -> "General" -> "Existing Projects into Workspace".
Choose "Select root directory" and use the Eclipse project folder for the cmsWorks project. Finally "Finish" and the Project is available.
With the running cmsWorks project and a Preview page open just edit the corresponding JSP and refresh the Browser preview page to see the changes.
