StandaloneJackpot

Standalone tool

A command line tool that runs the declarative refactoring rules is developed under this project. The tool produces warnings for custom refactoring rules and standard NetBeans warnings. It can also apply the main fix for the warning, producing either a changed source code or a diff.

In addition to runing the tool from command line, there are ant and maven bindings.

Warning: this is work in progress.

Use in Maven

Currently, the tool and the maven plugin are available only in this snapshot repository: http://lahoda.info/maven/snapshots.

To use the plugin add this to your pom.xml:

  <build>
    <plugins>
      <plugin>
        <groupId>org.netbeans.modules.jackpot30</groupId>
        <artifactId>jackpot30-maven-plugin</artifactId>
        <version>1.0-SNAPSHOT</version>
      </plugin>
    </plugins>
  </build>

To specify a configuration file use:

...
      <plugin>
...
        <configuration>
          <configurationFile>jackpot-settings.xml</configurationFile>
        </configuration>
...

The plugin defines two goals:

  • jackpot30:showgui shows a configuration dialog that allows to conveniently adjust the warnings produced by the tool. The settings are stored to the specified configuration file
  • jackpot30:analyze performs the analysis

Use in Ant

Download the tool distribution from here, unpack it to ${jackpot.home} . Define the jackpot task as: <taskdef name="jackpot" classname="org.netbeans.modules.jackpot30.cmdline.ant.JackpotTask" classpath="${jackpot.home}/jackpot-ant.jar"/> Invoke the tool like this:

        <jackpot jackpotHome="${jackpot.home}" source="<source-level>" configfile="<path-to-configuration-file>">
            <src> <!--source path specification as for the compiler-->
            </src>
            <classpath> <!--claasspath specification as for the compiler-->
            </classpath>
        </jackpot>

Updated

Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.