README.txt revision 984
0N/AOpenGrok - a wicked fast source browser
0N/A---------------------------------------
0N/A
1298N/AOpenGrok is a fast and usable source code search and cross reference
1298N/Aengine, written in Java. It helps you search, cross-reference and navigate
1298N/Ayour source tree. It can understand various program file formats and
1298N/Aversion control histories like SCCS, RCS, CVS, Subversion and Mercurial.
1298N/A
1298N/AOpenGrok is the tool used for the OpenSolaris Source Browser.
1298N/A
1298N/ARequirements
1298N/A------------
1298N/A * Latest Java http://java.sun.com/ (At least 1.6)
1298N/A * A servlet container like Tomcat (5.x or later)
1298N/A http://tomcat.apache.org/
1298N/A supporting Servlet 2.4 and JSP 2.0
1298N/A * Exuberant Ctags http://ctags.sourceforge.net/
1298N/A * Subversion 1.3.0 or later if SVN support is needed
0N/A http://subversion.tigris.org/
0N/A * Mercurial 0.9.3 or later if Mercurial support is needed
0N/A http://www.selenic.com/mercurial/wiki/
1298N/A * JFlex Ant task (If you want to build OpenGrok)
0N/A http://www.jflex.org/
1298N/A
1298N/A
1298N/AUsage
0N/A-----
1298N/ASRC_ROOT refers to the directory containing your source tree.
1298N/AOpenGrok analyzes the source tree and builds a search index along with
1298N/Across-referenced hypertext versions of the source files. These generated
1298N/Adata files will be stored in DATA_ROOT directory.
1298N/AProject concept - one project is one directory underneath SRC_ROOT and
1073N/Ausually contains a checkout of a project(or it's branch, version, ...)
1298N/Asources, it can have several attributes (in its XML description), note that
0N/Ainterface of projects is being stabilized so it can change. Projects
1298N/Aeffectively replace need for more web applications with opengrok .war and
1298N/Aleave you with one indexer and one web application serving MORE source code
0N/Arepositories - projects. A nice concept is to have directories underneath
0N/ASRC_ROOT with a naming convention, thereby creating a good overview of
115N/Aprojects (e.g. name-version-branch). Then you have a simple update script &
115N/Asimple index refresher script in place, which simplifies management of more
1298N/Arepositories.
1298N/A
1298N/AOpenGrok setup Step.0 - Setting up the Sources.
1298N/A----------------------------------------------
1298N/ASource base must be available locally for OpenGrok to work efficiently. No
1298N/Achanges are required to your source tree. If the code is under source control
1298N/Amanagement (SCM) OpenGrok requires the checked out source tree under SRC_ROOT.
0N/AIt is possible for some SCM systems to use a remote repository (Subversion,
1298N/ACVS), but this is not recommended due to the performance penalty. Special
1298N/Aoption is needed to enable remote repository support(-r on).
1298N/ANote that OpenGrok ignores symbolic links.
1298N/A
1298N/A---------------------------------------------------
1298N/AUsing Opengrok wrapper script(Solaris and Linux) to create indexes.
1298N/A---------------------------------------------------
0N/A
1298N/AStep.1 - Deploy the web application
1298N/A=====================================
1298N/A
1298N/AWe provided you with OpenGrok wrapper script, which should aid in deploying
1298N/Athe web application.
1298N/APlease change to opengrok directory (can vary on your system)
1298N/ANote that now you might need to change to user which owns the target
1298N/Adirectories for data, e.g. on Solaris you'd do # pfexec su - webservd
1298N/A
1298N/A$ cd /usr/opengrok/bin
1298N/A
1298N/Aand run
1298N/A
1298N/A$ ./OpenGrok deploy
1298N/A
1298N/AThis command will do some sanity checks and will deploy the source.war in
1298N/Aits directory to one of detected web application containers.
1298N/APlease follow the error message it provides.
1298N/AIf it fails to discover your container, please refer to optional steps on
1298N/Achanging web application properties, which has manual steps on how to do
1298N/Athis.
0N/A
1298N/ANote that OpenGrok script expects the directory /var/opengrok to be
1298N/Aavailable to user running opengrok with all permissions. In root user case
1298N/Ait will create all the directories needed, otherwise you have to manually
1298N/Acreate the directory and grant all permissions to the user used.
1298N/A
1298N/A
1298N/AStep.2 - Populate DATA_ROOT Directory, let the indexer generate the project
1298N/AXML config file, update configuration.xml to your web app
1298N/A=====================================
1298N/A
1298N/ASecond step is to just run the indexing (can take a lot of time). After this
1298N/Ais done, indexer automatically attempts to upload newly generated
1298N/Aconfiguration to the web application. Most probably you will not be able to
1298N/Ause {Opengrok before this is done.
1298N/A
1298N/APlease change to opengrok directory (can vary on your system)
1298N/A
1298N/A$ cd /usr/opengrok/bin
1298N/A
1298N/Aand run, if your SRC_ROOT is prepared under /var/opengrok/src
1298N/A
1298N/A$ ./OpenGrok index
1298N/A
1298N/Aotherwise (if SRC_ROOT is in different directory) run:
1298N/A
1298N/A$ ./OpenGrok index <absolute_path_to_your_SRC_ROOT>
975N/A
975N/AAbove command should try to upload latest index status reflected into
1298N/Aconfiguration.xml to a running source web application.
1298N/AOnce above command finishes without errors(e.g. SEVERE: Failed to send
1298N/Aconfiguration to localhost:2424
0N/A), you should be able to enjoy your opengrok and search your sources using
0N/Alatest indexes and setup.
1298N/A
975N/ACongratulations, you should now be able to point your browser to
975N/Ahttp://<YOUR_WEBAPP_SERVER>:<WEBAPPSRV_PORT>/source to work with your fresh
1298N/Aopengrok installation! :-)
1298N/A
1298N/A
1298N/AAt this time we'd like to point out some customization to OpenGrok script
1298N/Afor advanced users.
975N/AA common case would be, that you want the data in some other directory than
1298N/A/var/opengrok.
1298N/AThis can be easily achieved by using environment variable
1298N/AOPENGROK_INSTANCE_BASE .
979N/AE.g. if my opengrok data directory is /tank/opengrok and my source root is
1298N/Ain /tank/source and I'd like to get more verbosity I'd run the indexer as:
975N/A
1298N/A$ OPENGROK_VERBOSE=true OPENGROK_INSTANCE_BASE=/tank/opengrok \
1298N/A ./OpenGrok index /tank/source
975N/A
975N/ASince above will also change default location of config file, beforehands(or
975N/Arestart your web container after creating this symlink) I suggest doing
1298N/Abelow for our case of having opengrok instance in /tank/opengrok :
975N/A
975N/A$ ln -s /tank/opengrok/etc/configuration.xml \
975N/A /var/opengrok/etc/configuration.xml
975N/A
975N/AA lot more customizations can be found inside the script, you just need to
975N/Ahave a look at it, eventually create a configuration out of it and use
975N/AOPENGROK_CONFIGURATION environment variable to point to it. Obviously such
975N/Asetups can be used for nightly cron job updates of index or other automated
975N/Apurposes.
975N/A
975N/A
975N/A---------------------------------------------------
975N/AUsing smf service(OpenSolaris) to maintain opengrok indexes.
975N/A---------------------------------------------------
1298N/A
1298N/AIf you installed opengrok from a package, then configure the service like this:
975N/A
1298N/A# svccfg -s opengrok
1298N/A listprop opengrok
1298N/A setprop opengrok/srcdir="/absolute/path/to/your/sourcetree"
1298N/A setprop opengrok/maxmemory="2048"
1298N/A end
1298N/A
1298N/Athen make the service start the indexing, at this point it would be nice if
975N/Athe web application is already running.
975N/A
975N/A# svcadm enable -rs opengrok
1298N/A(which will enable tomcat6 as dependency)
975N/A
975N/AWhen the service starts indexing for first time, it's already enabled and
975N/Adepending on tomcat6, so at this point the web application should be
1298N/Aalready running.
975N/AThe indexing is not done when opengrok service is disabled.
975N/A
975N/ATo rebuild the index later (e.g. after source code changed)just run:
1298N/A# svcadm refresh opengrok
975N/A
975N/ANote: before removing opengrok package please disable the service.
975N/AIf you don't do it, it will not be removed automatically.
975N/AIn such case please remove it manually.
975N/A
975N/A---------------------------------------------------
975N/AUsing command line interface(general pointers) to create indexes.
975N/A---------------------------------------------------
975N/A
975N/AStep.1 - Populate DATA_ROOT Directory
1298N/A=====================================
975N/AOption 1. OpenGrok: There is a sample shell script OpenGrok that is suitable
975N/Afor using in a cron job to run regularly. Modify the variables in the script
975N/Ato point appropriate directories, or as the code suggests factor your local
975N/Aconfiguration into a separate file and simplify future upgrades.
1298N/A
1298N/AOption 2. opengrok.jar: You can also directly use the Java application. If
975N/Athe sources are all located in a directory SRC_ROOT and the data and
1298N/Ahypertext files generated by OpenGrok are to be stored in DATA_ROOT, run
1298N/A
1298N/A $ java -jar opengrok.jar -s SRC_ROOT -d DATA_ROOT
1298N/A
1298N/ASee opengrok.jar manual below for more details.
975N/A
975N/AStep.2 - Configure and Deploy source.war Webapp
975N/A===============================================
975N/ATo configure the webapp source.war, look into the parameters defined in
975N/Aweb.xml of source.war file and change them (see note1) appropriately.
1298N/A
1298N/A * HEADER: is the fragment of HTML that will be used to display title or
975N/A logo of your project
1298N/A * SRC_ROOT: the absolute path name of the root directory of your source tree
975N/A * DATA_ROOT: absolute path of the directory where OpenGrok data
975N/A files are stored
975N/A
975N/A
975N/AOptional Step.3 - Path Descriptions
975N/A-----------------------------------
1298N/AOpenGrok uses path descriptions in various places (For eg. while showing
1298N/Adirectory listings or search results) Example descriptions are in paths.tsv
975N/Afile. You can list descriptions for directories one per line tab separated
975N/Aformat path tab description. Refer to example 4 below.
975N/A
1298N/ANote 1 - Changing webapp parameters: web.xml is the deployment descriptor
1298N/Afor the web application. It is in a Jar file named source.war, you can
1298N/Achange the :
975N/A
1298N/A * Option 1: Unzip the file to TOMCAT/webapps/source/ directory and
975N/A change the source/WEB-INF/web.xml and other static html files like
975N/A index.html to customize to your project.
1298N/A
1298N/A * Option 2: Extract the web.xml file from source.war file
1298N/A
1298N/A $ unzip source.war WEB-INF/web.xml
1298N/A
975N/A edit web.xml and re-package the jar file.
984N/A
984N/A $ zip -u source.war WEB-INF/web.xml
984N/A
1298N/A Then copy the war files to <i>TOMCAT</i>/webapps directory.
1298N/A
984N/A * Option 3: Edit the Context container element for the webapp
1298N/A
1298N/A Copy source.war to TOMCAT/webapps
1298N/A
975N/A When invoking OpenGrok to build the index, use -w <webapp> to set the
984N/A context.
984N/A
984N/A After the index is built, there's a couple different ways to set the
975N/A Context for the servlet container:
1298N/A - Add the Context inside a Host element in TOMCAT/conf/server.xml
1298N/A
0N/A <Context path="/<webapp>" docBase="source.war">
1298N/A <Parameter name="DATA_ROOT" value="/path/to/data/root" override="false" />
1298N/A <Parameter name="SRC_ROOT" value="/path/to/src/root" override="false" />
1298N/A <Parameter name="HEADER" value='...' override="false" />
1298N/A </Context>
1298N/A
299N/A - Create a Context file for the webapp
911N/A
299N/A This file will be named `<webapp>.xml'.
911N/A
0N/A For Tomcat, the file will be located at:
0N/A `TOMCAT/conf/<engine_name>/<hostname>', where <engine_name>
0N/A is the Engine that is processing requests and <hostname> is a Host
0N/A associated with that Engine. By default, this path is
0N/A 'TOMCAT/conf/Catalina/localhost' or 'TOMCAT/conf/Standalone/localhost'.
1298N/A
0N/A This file will contain something like the Context described above.
0N/A
0N/A---------------------------------------------------
1298N/AUsing Java DB for history cache
1298N/A(instead of gzipped xml files)
1298N/A---------------------------------------------------
0N/A
0N/AYou need Java DB 10.5.3 or later
0N/A(OpenSolaris: # pkg install SUNWjavadb or SUNWj6dev ,
0N/ADebian/Ubuntu: # apt-get install sun-java6-javadb).
0N/AThere are two modes, having Java DB embedded, or running a Java DB server.
1298N/AJava DB server is default option, I will not describe how to set up embedded
0N/Aoption.
0N/A
1299N/A1) Start the server:
1299N/A$ mkdir -p $DATA_ROOT/derby
1290N/A
1299N/AOpenSolaris:
1299N/A# svcadm enable javadb
1299N/AOR
0N/A$ java -Dderby.system.home=$DATA_ROOT/derby -jar /opt/SUNWjavadb/lib/derbynet.jar start
1298N/AOR
1298N/A$ java -Dderby.system.home=$DATA_ROOT/derby -jar /usr/jdk/instances/jdk1.6.0/db/lib/derbynet.jar start
1298N/A
0N/ADebian:
0N/A$ java -Dderby.system.home=$DATA_ROOT/derby -jar /usr/lib/jvm/java-6-sun/db/lib/derbynet.jar start
0N/A
0N/A
0N/A2) You need to have the derbyclient.jar in lib directory of opengrok.jar and in source.war WEB-INF/lib
115N/ACopy it over from
0N/AOpenSolaris: /opt/SUNWjavadb/lib/derbyclient.jar OR /usr/jdk/instances/jdk1.6.0/db/lib/derbyclient.jar
116N/ADebian: /usr/lib/jvm/java-6-sun/db/lib/derbyclient.jar
0N/A
0N/A3) Use these options with indexer when indexing/generating the configuration:
979N/A -D -H
979N/A
0N/AAlso the Java DB server has to be running during indexing and for the web application.
0N/A
0N/ANote: To use a bigger database buffer, which may improve performance of both
979N/Aindexing and fetching of history, create a file named derby.properties in
979N/A$DATA_ROOT/derby and add this line to it:
979N/Aderby.storage.pageCacheSize=25000
0N/A
979N/A---------------------------------------------------
0N/AOptional CLI - Command Line Interface Usage
979N/A---------------------------------------------------
0N/A
116N/A You need to pass location of project file + the query to Search class, e.g.
116N/Afor fulltext search for project with above generated configuration.xml you'd
979N/Ado:
116N/A
979N/A$ java -cp ./opengrok.jar org.opensolaris.opengrok.search.Search -R \
979N/A/var/opengrok/etc/configuration.xml -f fulltext_search_string
116N/A
979N/A For quick help run:
979N/A
979N/A$ java -cp ./opengrok.jar org.opensolaris.opengrok.search.Search
116N/A
979N/A---------------------------------------------------
979N/AOptional need to change web application properties or name
979N/A---------------------------------------------------
979N/A
979N/A You might need to modify the web application if you don't store the
116N/Aconfiguration file in the default location
979N/A(/var/opengrok/etc/configuration.xml).
116N/A
979N/ATo configure the webapp source.war, look into the parameters defined in
116N/AWEB-INF/web.xml of source.war (use jar or zip/unzip or your preffered zip
979N/Atool to get into it - e.g. extract the web.xml file from source.war ($ unzip
979N/Asource.war WEB-INF/web.xml) file, edit web.xml and re-package the jar file
979N/A(zip -u source.war WEB-INF/web.xml) ) file and change those web.xml
979N/Aparameters appropriately. These sample parameters need modifying(there are
979N/Amore options, refer to manual or read param comments).
116N/A
979N/A * CONFIGURATION - the absolute path to XML file containing project
975N/A * configuration (e.g. /var/opengrok/etc/configuration.xml )
1298N/A * ConfigAddress - port for remote updates to configuration, optional,
1298N/A * but advised(since there is no authentification) to be set to
1298N/A * localhost:<some_port> (e.g. localhost:2424), if you choose some_port
1298N/A * below 1024 you have to have root privileges
1298N/A
1298N/AIf you need to change name of the web application from source to something
1298N/Aelse you need to use special option -w <new_name> for indexer to create
863N/Aproper xrefs, besides changing the .war file name. Examples below show just
1298N/Adeploying source.war, but you can use it to deploy your new_name.war too.
1298N/A
1298N/ADeploy the modified .war file in glassfish/Sun Java App Server:
1298N/A-----------------------------------
1298N/A
1298N/A * Option 1: Use browser and log into glassfish web administration
1298N/A * interface
1298N/A
1298N/A Common Tasks / Applications / Web Applications , button Deploy and point
1298N/Ait to your source.war webarchive
863N/A
1086N/A * Option 2: Copy the source.war file to
863N/A * GLASSFISH/domains/YOURDOMAIN/autodeploy directory, glassfish will try
863N/A * to deploy it "automagically".
863N/A * Option 3: Use cli from GLASSFISH directory:
1298N/A
1298N/A# ./bin/asadmin deploy /path/to/source.war
1298N/A
1298N/ADeploy the modified .war file in tomcat:
863N/A-----------------------------------
1298N/A
1298N/A * just copy the source.war file to TOMCAT_INSTALL/webapps directory.
1298N/A
1298N/A---------------------------------------------------
1298N/AOptional opengrok indexer setup with agent and systray GUI control application
1298N/A---------------------------------------------------
1298N/A
1298N/Awe provide an example opengrok-agent.properties file, which can be used when
1298N/Astarting special OpenGrok Agent, where you can connect with a systray GUI
1298N/Aapplication.
1298N/A
1298N/ATo start the indexer with configuration run:
863N/A$ java -cp ./opengrok.jar org.opensolaris.opengrok.management.OGAgent \
1298N/A--config opengrok-agent.properties
1298N/A
863N/Athen from the remote machine one can run:
863N/A$ java -cp ./opengrok.jar \
1298N/Aorg.opensolaris.opengrok.management.client.OpenGrokTrayApp
1298N/A
1298N/Aassuming configuration permits remote connections(so not listening on
1298N/Alocalhost, but rather on a physical network interface)
1298N/A
1298N/AThis agent is work in progress, so it might not fully work.
1298N/A
863N/A---------------------------------------------------
863N/AUsing Findbugs
1298N/A---------------------------------------------------
863N/AIf you want to run Findbugs (http://findbugs.sourceforge.net/) on OpenGrok,
1298N/Ayou have to download Findbugs to your machine, and install it where you have
1298N/Achecked out your OpenGrok source code, under the lib/findbugs directory,
863N/Alike this:
863N/A
863N/A cd ~/.ant/lib
863N/A wget http://..../findbugs-x.y.z.tar.gz
1298N/A gtar -xf findbugs-x.y.z.tar.gz
863N/A mv findbugs-x.y.z findbugs
863N/A
1298N/AYou can now run ant with the findbugs target:
1298N/A
975N/A ant findbugs
1298N/A ...
975N/A findbugs:
975N/A [findbugs] Executing findbugs from ant task
975N/A [findbugs] Running FindBugs...
1298N/A [findbugs] Warnings generated: nnn
1298N/A [findbugs] Output saved to findbugs/findbugs.html
975N/A
975N/ANow, open findbugs/findbugs.html in a web-browser, and start fixing bugs!
975N/A
1298N/AIf you want to install findbugs some other place than ~/.ant/lib, you can untar the
975N/A.tar.gz file to a directory, and use the findbugs.home property to tell ant where to find
1298N/Afindbugs, like this (if you have installed fundbugs under the lib directory):
1298N/A
975N/A ant findbugs -Dfindbugs.home=lib/findbug
1298N/A
975N/AThere is also a findbugs-xml ant target that can be used to generate XML files that can
975N/Alater be parsed, e.g. by Hudson.
975N/A
975N/A---------------------------------------------------
1086N/AUsing Emma
975N/A---------------------------------------------------
975N/AIf you want to check test coverage on OpenGrok, download Emma from
975N/Ahttp://emma.sourceforge.net/. Place emma.jar and emma-ant.jar in the
975N/Aopengrok/trunk/lib directory, or ~/.ant/lib.
975N/A
975N/ANow you can instrument your classes, and create a jar file:
975N/A
975N/A ant emma-instrument
975N/A
1086N/AIf you are using NetBeans, select File - "opengrok" Properties
975N/A- libraries - Compile tab. Press the "Add JAR/Folder" and select
975N/Alib/emma.jar and lib/emma_ant.jar
975N/A
975N/AIf you are not using netbeans, you have to edit the file
975N/Anbproject/project.properties, and add "lib/emma.jar" and
975N/A"lib/emma_ant.jar" to the javac.classpath inside it.
975N/A
975N/ANow you can put the classes into jars and generate distributables:
975N/A
975N/A ant dist
1298N/A
975N/AThe classes inside opengrok.jar should now be instrumented.
975N/AIf you use opengrok.jar for your own set of tests, you need
1298N/Aemma.jar in the classpath.If you want to specify where to store
975N/Athe run time analysis, use these properties:
1298N/A
1298N/A emma.coverage.out.file=path/coverage.ec
1298N/A emma.coverage.out.merge=true
1298N/A
1298N/AThe coverage.ec file should be placed in the opengrok/trunk/coverage
975N/Adirectory for easy analyzation.
1298N/A
975N/AIf you want to test the coverage of the unit tests, you can
975N/Arun the tests:
1298N/A
1298N/A ant test (Or Alt+F6 in NetBeans)
975N/A
1298N/ANow you should get some output saying that Emma is placing runtime
1298N/Acoverage data into coverage.ec.
975N/A
1298N/ATo generate reports, run ant again:
1298N/A
1298N/A ant emma-report
979N/A
1298N/ALook at coverage/coverage.txt, coverage/coverage.xml and
979N/Acoverage/coverage.html to see how complete your tests are.
979N/A
979N/ANote: For full coverage report your system has to provide proper junit test
979N/Aenvironment, that would mean:
1298N/A- you have to use ant 1.7 and above
1298N/A- at least junit-4.?.jar has to be in ants classpath (e.g. in ./lib)
1298N/A- your PATH must contain exuberant ctags binary
1298N/A- your PATH variable must contain binaries of appropriate SCM SW, so commands
1298N/Ahg, sccs, cvs, git, bzr, svn (svnadmin too) must be available for full report
979N/A
1298N/A---------------------------------------------------
1298N/AUsing Checkstyle
979N/A---------------------------------------------------
1298N/A
1298N/ATo check that your code follows the standard coding conventions,
979N/Ayou can use checkstyle from http://checkstyle.sourceforge.net/
979N/A
979N/AFirst you must download checkstyle from http://checkstyle.sourceforge.net/ ,
1298N/AYou need Version 5.1 (or newer). Extract the package you have
1298N/Adownloaded, and create a symbolic link to it from ~/.ant/lib/checkstyle,
1298N/Ae.g. like this:
1298N/A
1298N/A cd ~/.ant/lib
1298N/A unzip ~/Desktop/checkstyle-5.1.zip
295N/A ln -s checkstyle-5.1 checkstyle
295N/A
295N/AYou also have to create symbolic links to the jar files:
295N/A
295N/A cd checkstyle
1298N/A ln -s checkstyle-5.1.jar checkstyle.jar
1298N/A ln -s checkstyle-all-5.1.jar checkstyle-all.jar
1298N/A
1298N/ATo run checkstyle on the source code, just run ant checkstyle:
295N/A
295N/A ant checkstyle
295N/A
1298N/AOutput from the command will be stored in the checkstyle directory.
295N/A
295N/AIf you want to install checkstyle some other place than ~/.ant/lib, you can
295N/Auntar the .tar.gz file to a directory, and use the checkstyle.home property
295N/Ato tell ant where to find checkstyle, like this (if you have installed
295N/Acheckstyle under the lib directory):
295N/A
295N/A ant checkstyle -Dcheckstyle.home=lib/checkstyle
1298N/A
295N/A---------------------------------------------------
1298N/AUsing PMD
1298N/A---------------------------------------------------
1298N/A
1298N/ATo check the quality of the OpenGrok code you can also use PMD
341N/Afrom http://pmd.sourceforge.net/.
1298N/A
341N/AHow to install:
1298N/A
1298N/A cd ~/.ant/lib
341N/A unzip ~/Desktop/pmd-bin-4.2.5.zip
1298N/A ln -s pmd-4.2.5/ pmd
1298N/A
1298N/AYou also have to make links to the jar files:
301N/A
301N/A cd ~/.ant/lib/pmd/lib
336N/A ln -s pmd-4.2.5.jar pmd.jar
301N/A ln -s jaxen-1.1.1.jar jaxen.jar
301N/A
301N/ATo run PMD on the rource code, just run ant pmd:
1298N/A
301N/A ant pmd
301N/A
301N/AOutout from the command will be stored in the pmd subdirectory.
301N/A
301N/A % ls pmd
301N/A pmd_report.html pmd_report.xml
301N/A
301N/AIf you want to install PMD some other place than ~/.ant/lib, you can
301N/Aunzip the .zip file to a directory, and use the pmd.home property
1086N/Ato tell ant where to find PMD, like this (if you have installed
301N/APMD under the lib directory):
1298N/A
301N/A ant pmd -Dpmd.home=lib/pmd-4.2.5
301N/A
301N/A---------------------------------------------------
301N/AUsing JDepend
301N/A---------------------------------------------------
301N/ATo see dependencies in the source code, you can use JDepend from
301N/Ahttp://clarkware.com/software/JDepend.html.
301N/A
301N/AHow to install:
301N/A
1086N/A cd ~/.ant/lib
301N/A unzip ~/Desktop/jdepend-2.9.zip
301N/A ln -s jdepend-2.9/ jdepend
301N/A cd jdepend/lib
301N/A ln -s jdepend-2.9.jar jdepend.jar
1298N/A
1298N/AHow to analyze:
1298N/A
301N/A ant jdepend
301N/A
301N/AOutput is stored in the jdepend directory:
301N/A
301N/A $ ls jdepend/
301N/A report.txt report.xml
1298N/A
301N/AAUTHORS
301N/A-------
301N/AChandan B.N, Sun Microsystems. https://blogs.sun.com/chandan
301N/ATrond Norbye, norbye.org
576N/AKnut Pape, eBriefkasten.de
576N/AMartin Englund, Sun Microsystems
576N/AKnut Anders Hatlen, Sun Microsystems
1298N/ALubos Kosco, Sun Microsystems
1298N/A