If you are running Eclipse 3 you can find information on how to set the development environment fitting ArgoUML. There are several sets of instructions here depending that you can apply separately depending on how much of the ArgoUML knowledge you would want to include in your Eclipse.
If any of these instructions don't work or could be improved in some way, please help in making them better.
This instruction is if you want to use Eclipse to download the source and it takes you up to where you can start ArgoUML from the source.
Set up the CVS Repository.
Change to the CVS Repository perspective and select Add CVS Repository. Then enter the following information.
Host: cvs.tigris.org
Repository path: /cvs
User:
Your Tigris username.
Password:
Your Tigris password.
Connection type: pserver (default)
Use Default Port. (default)
Check out.
In the CVS Repository Exploring perspective,
unfold the newly created repository
(called something like
:pserver:yourname
@cvs.tigris.org:/cvs)
and within it, HEAD.
Select the argouml project, right-click on it, and do Check Out As. Check out as a project configured using the New Project Wizard. Press the button Finish. Select Java Project, and press Next. Type the new project name: argouml, and press Next. Ignore the build path settings. We will come back to them later. Press Finish, which starts the checking out process. You are probably directed to the Java Perspective with a question if you want or not. At this point it doesn't matter. Just press Yes or No!
The download takes a while, since the download is around 60Meg.
Remark: If you are on a modem or other low bandwidth connection, this is not recommended since you will download all of the web site, the source for the documentation, and all modules, things that you could do without unless you would want to work on them. If you find a way to do this with less bandwidth use, please help improving this description. Theoretically we can come down to around 16Meg which would take around two hours on a 56K modem.
Build using ant.
Browse to argouml/src_new/build.xml
,
select the build.xml
-file,
right-click on it, and do Run Ant...
This pops up the External Tools... pop up
with the Targets tab already selected.
Select compile (default target in the Targets tab),
deselect all other targets
and finally press Run.
![]() | Warning |
---|---|
Remark from MVW: This did not work for me, I first had to set the Java Build path as described below. Please confirm or deny this statement, so that I can adapt this explanation! |
There are some files that are built using rules in the
build.xml
file.
This is the antlr files and the file containing a version.
Refresh the project.
This must be done after having built using ant to find the newly created java files.
Select the top resource of the argouml project in the Navigator (on the left), right click and select Refresh.
Set build path.
In the Java perspective, select the project argouml, i.e. the icon at the top of the Package Explorer. Then, in the menu, select Project => Properties).
Enter Java Build Path
Under Source:
Remove everything.
Add argouml/src_new
(simply add a checkmark in front of the src_new folder icon).
Also add
argouml/tests
,
argouml/modules/junit/src
,
and the src directories of all other modules.
The purpose of this is to have Eclipse recompile these and
find compilation errors
as soon as your changes to any API has affected them.
Currently (July 2004) some of the modules don't compile.
Under Libraries:
Press the Add JARs... button and add
all files in argouml/lib
.
Press the Add JARs... button and add
the file argouml/tools/ant-1.4.1/lib/xerces-1.2.3.jar
.
Press the Add JARs... button and add
the file argouml/tools/junit-3.7/junit.jar
.
Every time any of these jars is updated in the project you will have to
update this in your environment by entering this dialog and
adding the new ones.
Set the Default output folder to
argouml/bin
.
This will not confuse it with any of the ant-built things.
Press OK. You will be asked to accept that all resources previously built can be removed. Press Yes. Eclipse shall rebuild. Verify that there are no errors, just warnings left among the problems. If there are errors in some of the modules you will be able to continue your work in spite of that but it is then perhaps best to remove those modules again from the Source list in the Java Build Path.
Select the class with the main method.
In the Java perspective, select the project argouml, i.e. the icon at the top of the Package Explorer. Then, in the menu, select Run => Run...). This will open the dialog for creating, managing and running Run Configurations.
Select Java Application on the left and press the New button. Name the configuration "Run ArgoUML", and press the Search... button in the Main class box. In the new dialog that appears (Choose Main Type), simply press OK.
This sets the Main class to:
org.argouml.application.Main
.
Press the Run button. This will start ArgoUML. From now on, you can start ArgoUML by a single press on the Run icon in the toolbar.
Verify that you can start ArgoUML from the debugger within Eclipse. You can do this by clicking on the Debug icon in the toolbar.
This instruction is to set up Eclipse to work according to the ArgoUML Coding standards. If this is not done correctly you will most likely find that you will have to do a lot of manual edits every time Eclipse has touched the code. You have your tool working against you instead of for you. On the other hand, these settings affect your Eclipse Workspace rather than the ArgoUML project settings so if you have other projects in the same Eclipse Workspace there might be conflicts. For this reason, it might be a good idea to do the ArgoUML work in an Eclipse Workspace separate from your other projects.
Code conventions.
See in the menu Window => Preferences. Then select Java => Code Style => Code Formatter. Set the Code Formatter to "Java conventions [built-in]".
TAB character width is 8.
See in the menu Window => Preferences. Then select Java => Editor. Then select the tab Appearance. Set the Displayed tab width to 8.
New file templates.
See in the menu Window => Preferences. Then select Java => Code Style => Code Templates. At the right hand side, open the tree for Comments, and set the Code Templates for Overriding methods to
/** * ${see_to_overridden} */
In the same tree for Code Templates, open the Code node and select New Java Files. Set it to
// $$Id$$ // Copyright (c) 2005 The Regents of the University of California. All // Rights Reserved. Permission to use, copy, modify, and distribute this // software and its documentation without fee, and without a written // agreement is hereby granted, provided that the above copyright notice // and this paragraph appear in all copies. This software program and // documentation are copyrighted by The Regents of the University of // California. The software program and documentation are supplied "AS // IS", without any accompanying services from The Regents. The Regents // does not warrant that the operation of the program will be // uninterrupted or error-free. The end-user understands that the program // was developed for research purposes and is advised not to rely // exclusively on the program for any reason. IN NO EVENT SHALL THE // UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, // SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, // ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF // THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF // SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE // PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF // CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT, // UPDATES, ENHANCEMENTS, OR MODIFICATIONS. ${package_declaration} ${typecomment} ${type_declaration}
This instruction is to set up Eclipse to automatically find what, in the ArgoUML project, could be considered problems in the code.
You can apply these individually depending on what level of help you need in your coding. I (Linus Tolke) recommend that you set them all on the Warning level. This makes them visible for you. You can then decide to fix them or not depending on how you feel about the code you are working with.
Compiler compliance level.
See in the menu Window => Preferences. Then select Java => Compiler. At the right hand side, select the tab Compliance and classfiles => Compiler compliance level: 1.3.
In the ArgoUML project we have decided to keep source compliance to JDK 1.3. (See Section 3.3.1, “Choice of JRE: ArgoUML will support any JRE compatible with a Sun specification of any JRE from Sun that has not begun the Sun End of Life (EOL) process. ”). This setting enables Eclipse to tell you where some JDK 1.4 or JDK 1.5 features has creaped in.
Find forgotten and incorrect javadoc comments.
In the menu select Window => Preferences. Then select Java => Compiler. Suggested settings for these tabs (Only things diverting from the Eclipse defaults are listed):
Javadoc => Malformed javadoc comments: Warning, Private, Report errors in tags.
Javadoc => Missing javadoc tags: Warning, Protected, Check overriding and implementing methods.
These problems are also found by Checkstyle so if you are running checkclipse (See Section 9.7.4, “Settings for checkclipse”) put this in Ignore instead.
Code that hides other code.
In the menu select Window => Preferences. Then select Java => Compiler. Suggested settings for these tabs (Only things diverting from the Eclipse defaults are listed):
Style => Possible accidental boolean assignment: Warning.
Advanced => Local variable declaration hides another field or variable: Warning.
Advanced => Field declaration hides another field or variable: Warning.
Find Code that shall be removed.
In the menu select Window => Preferences. Then select Java => Compiler. Suggested settings for these tabs (Only things diverting from the Eclipse defaults are listed):
Unused code => Local variable is never read: Warning.
Unused code => Parameter is never read: Warning.
Unused code => Unused or unread private members: Warning.
Unused code => Unnecessary semicolon: Warning.
Unused code => Unnecessary cast or 'instanceof' operation: Warning.
Unused code => Unnecessary declaration of thrown checked exception: Warning.
Checkclipse is a plugin for Eclipse wich needs to be installed seperately. It enables style checking according the rules set for the ArgoUML project.
In the Java perspective, select the project argouml, i.e. the icon at the top of the Package Explorer. Then, in the menu, select Project => Properties, select Checkclipse (appears only if checkclipse is correctly installed) and then fill the fields like this:
Enable Checkstyle Checked.
Checkstyle Configuration File:
/argouml/tools/checkstyle/checkstyle_argouml.xml
Checkstyle Properties File:
/argouml/tools/checkstyle/checkstyle.properties
File Filter Definition:
/argouml/tools/checkstyle/checkclipse.filefilters
Leave the two other fields empty.
There is perhaps some fancy way of doing this but while we figure that out this "revert to ant"-way can be used to run the tests:
In the menu select Window => Preferences. Select Ant => Runtime at the left hand side. Select the tab Classpath. Select Ant Home Entries.
Press the Add Jars... button and add
optional.jar
from
argouml/tools/ant-1.4.1
.
Press the Add Jars... button and add
all jars from
argouml/tools/ant-
.
1.4.1
/lib
Press the Add Jars... button and add
jdepend.jar
from
argouml/tools/jdepend-
.
2.2
/lib
Press the Add Jars... button and add
junit.jar
from
argouml/tools/junit-
.
3.8.1
Press OK to store the new Ant classpath entries.
These first items need only be done once as a set up.
Run ant with the alltests target.
This is done by selecting in the menu: Run => External Tools => External Tools... This will open the "Create, manage, and run configurations" dialog.
Select the Ant Build at the left and press the New button. Rename to ArgoUML AllTests. Then, in the Targets tab, select the alltests target, deselect all other targets, press the Apply button, and finally press Run.
This run configuration is remembered by Eclipse so after this the drop-down next to the Run tool can be used. In the same way, you can make other run configurations for the other ant targets in the build.xml file.
Once you have found a failing test case and would like to investigate
that further, you can run it as a JUnit test case from within Eclipse,
making full use of the Eclipse debugger.
This is done by browsing to the test case
(in the package explorer you browse to
argouml => tests =>
whatever package
=>
whatever class
),
right-click on it and select Run => Debug JUnit Test.