This plugin provides integration of the build system features in Eclipse.
compile
and runtime
are mandatory
commons-attributes
and config-conffolder
are implemented
Here is an example of how to use the eclipse
plugin:
<plugin name="eclipse"> <attribute name="eclipse.workspace.path" value="workspace"/> <!-- External tools prefix --> <attribute name="eclipse.prefix" value="MyProject_"/> <!-- Eclipse targets --> <attribute name="eclipse.tools" value="eclipse.generate"/> <!-- compile targets --> <attribute name="eclipse.tools" value="clean.module,jars"/> <!-- junit targets --> <attribute name="eclipse.tools" value="junit.startdev.all"/> <!-- reports targets --> <attribute name="eclipse.tools" value="javadoc,checkstyle"/> <!-- j2ee-war and j2ee-war-tomcat targets --> <attribute name="eclipse.tools" value="create.war.module.eu,deploy.war.module.eu"/> <!-- binrelease targets --> <attribute name="eclipse.tools" value="binrelease.module"/> </plugin>
If you do not use some plugins, the corresponding targets should be removed
from eclipse.tools
attributes. You can also limit the list to mostly used
targets.
First of all, it is necessary to use the build system Ant version. In Eclipse, open Window-> Preferences, Ant->Runtime->Classpath and set Ant Home to your current Ant directory (1.6.5 or later).
At project configuration, the plugin generates .project
and .classpath
files for each module, the corresponding Eclipse projects must be imported into
Eclipse if they have not been imported yet or refreshed if they are already in
Eclipse.
To ease the importation of multiple projects into Eclipse, the "Multi Project Import/Export" Eclipse plugin can be used. This plugin can be found on the web.
Some targets cannot be included in Eclipse at configuration, to work-around
this limitation, you have to invoke eclipse.generate
to create runtime
shortcuts. In case of a change in shortcuts, the workspace must be refreshed to
include new external tools. This can be done for example by restarting Eclipse
(or the workspace).
Ant targets are inserted in external tools:
clean.module
for instance) that applies to
the current module (selected project in Eclipse).
The global binrelease.default.excludes
attribute should be set to
java/**,.classpath,.project,.externalToolBuilders/**
.
If you are interested in keeping java sources for documentation and debug in
Eclipse, you can set it to .classpath,.project,.externalToolBuilders/**
.
The checkclipse plugin enables Checkstyle warnings in your Eclipse workbench.
plugins
. After
unzipping it you should have a folder de.mvmsoft.checkclipse_x.y.z
in
the plugins
folder.
Window/Preferences
. You should see now a entry Checkclipse
on the
left. Click on it.
checkstyle_el4ant_checks.xml
which can be found in folder etc
of your
EL4Ant project.
checkstyle_el4ant.properties
which can also be found in folder etc
into another directory as the EL4Ant project is. We recommend to create a
folder el4ant
into directory from eclipse and copy this file into. This
copy is necessary, because you have to adapt the property file to your
local folder structure, because otherwise the Checkclipse plugin could
not find the el4ant_java_header_file
. Open the copied properties file in
an editor and change the property el4ant_java_header_file
to your local
folder structure,
i.e. el4ant_java_header_file=D:/Projects/EL4Ant/etc/el4ant_java_header
. Be
aware that you use / and NOT \ for the path. FYI: The file
el4ant_java_header
which is needed here is situated in the same
directory as the checkstyle_el4ant_checks.xml
(folder etc
).
Preferences
by pushing button Ok
. Now the workspace
should be rebuilt and checkstyle checks should be made.
Note: To have warnings displayed in view Problems
you have to adapt the
filter of this view. Just push the filter button (upper right of the view) and
check entry de.mvmsoft.checkclipse.CheckclipseMarker
.
.project
and .classpath
files for
each module that is declared and whose directory exists on disk. This way,
one Eclipse project is created per module.
commons-attributes
plugin), to call the Ant
target commons-attributes.module
. This way, commons attributes are
automatically generated and compiled when Eclipse builds the project.
.classpath
file only refers to existing java/
and
conf/
(see config-conffolder
plugin) on disk when configuring or else
Eclipse build fails.
eclipse.generate
registers Eclipse configurations to run and
debug runnable module execution units. It is then possible to run and
debug applications in Eclipse with the same environment (classpath, system
properties,...) as if it was run from the command line.
myjar-1.3.jar
is declared as dependency, the plugin expects
the sources of the classes to be in the file lib/src/myjar-1.3-src.zip
(and download it from online repositories if configured)
eclipse.generate
generates the Eclipse run/debug configurations for all
the runnable module execution units.
eclipse.generate.module
generates the Eclipse run/debug configurations
for all the runnable execution units of a specific module.
eclipse.generate.module.eu
generates the Eclipse run/debug
configurations for a specific runnable module execution unit.
eclipse.workspace.path
is the path to the Eclipse workspace directory.
If this attribute is not defined, the Eclipse plugin won't be able to
automatically register Eclipse external tools and to define
runnable/debuggable applications in Eclipse. Mandatory, no default value.
eclipse.prefix
is the prefix used to register runtime targets and
external tools. Default is EL4Ant
.
eclipse.tools
is a comma-separated list of Ant targets to publish in
Eclipse as external tools. They must be available in your generated
build.xml
eclipse.project.type
is the type of the Eclipse project to create for
this module; this attribute is optional and accepts the following values:
java
is used for a Java project (default value)
pde
is used for a plugin development project for the eclipse rich
client platform
eclipse.tools
attributes or
change the eclipse.prefix
value, you have to clean old entries manually
from Run->External Tools->External Tools... and Run->Run... with
the delete button.
junit.startdev.all
to generate reports but the
JUnit progress bar is not shown in Eclipse.
After a new project configuration with commons attributes enabled, Eclipse build fails with this kind of message:
Errors during build. Errors running builder "Integrated External Tool Builder" on project aModule. Resource is out of sync with the file system: /aModule/.externalToolBuilders/el4ant_Commons Attributes Builder.launch.The fastest way to work-around this issue is to refresh all projects (select all projects, right-click, Refresh) and then build again.
CheckStyle
, if the removal of the Sun Checks
fails,
you have to refresh all Eclipse projects first.
project.xml
and other files from the project base
directory in Eclipse. Currently, the menu File->Open External
File... must be used.