Using the jarnotator maven plugin

Adding jarnotator to your maven builds is a straightforward process that takes less than 5 minutes. In this short document you'll see how to add the jarnotator plugin to your maven builds and have it analyze your bytecode after every successful compilation of your code.

Why use the maven plugin

Good reasons for using jarnotator's maven plugin:

  1. ease of integration into existing maven build
  2. automatic use of dependencies during analysis
  3. simple configuration

Adding the plugin to the build cycle

To add the jarnotator maven plugin to an existing maven build requires 2 simple steps:

  1. Point maven at the biggerbytes.be repository
  2. Add the plugin to the build section
Below you find the different elements you need to get your bytecode processed with jarnotator.

Define the repositories

In this section we describe how you can quickly setup a standard maven build to included jarnotator plugin by defining the necessary repository from within the pom.xml. In a corporate setting you may be required to use repository manager. If this is the case please consult with the person in charge to add the necessary proxy configuration to access the biggerbytes.be repository.

IMPORTANT: the biggerytes.be repository is publicly accessible but not browsable. Please refer to the online information regarding the available versions.

The pom.xml needs to define 2 repositories. One for the jarnotator plugin itself and one for the core part of jarnotator. This means one pluginRepository entry and one repository entry. One simply needs to add:

    <repositories>
<!-- Let your build still look at repo1 first -->
<repository>
<id>repo1</id>
<url>http://repo1.maven.org</url>
</repository>
<!-- jarnotator and its plugin are available in this repo -->
<repository>
<id>biggerbytes.be</id>
<url>http://www.biggerbytes.be/maven2</url>
</repository>
</repositories>
<pluginRepositories>
<!-- Let your build still look at repo1 first -->
<pluginRepository>
<id>repo1</id>
<url>http://repo1.maven.org</url>
</pluginRepository>
<!-- jarnotator and its plugin are available in this repo -->
<pluginRepository>
<id>biggerbytes.be</id>
<url>http://www.biggerbytes.be/maven2</url>
</pluginRepository>
</pluginRepositories>

Once the necessary repositories are accessible to maven it will download both the plugin and it dependencies. If maven can not download the plugin or another artifact with the be.biggerbytes groupId please confirm the above settings are correctly set pom.xml. Check for possible security policies blocking access to certain site.

Add the plugin

In this section we illustrate the use of the plugin without the use of <pluginManagement>. Obviously the later is possible as well.

The jarnotator plugin comes with 2 goals: classes and jar. By default the classes goal of the jarnotator plugin is bound to the process-classes phase of the build. It must be activated by defining a execution. The second goal offered by the plugin is meant to process a jar file rather than a classes directory. This goal is not bound to any phase. It can be invoked on the command line like any other goal.

To get start just add the maven-jarnotator-plugin to the build plugin as illustrated below.

    <build>
<plugins>
<plugin>
<groupId>be.biggerbytes.jarnotator</groupId>
<artifactId>maven-jarnotator-plugin</artifactId>
<version>free-1.2</version>
<executions>
<execution>
<goals> <goal>classes</goal> </goals> <configuration> <simpleDebug>true</simpleDebug> <processOlderJava>true</processOlderJava> </configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

All the jarnotator configuration options are available to the maven plugin.

 

Follow Me

Follow us on Twitter

Feed Display

Linux Today
Linux Today News Service
Linux Today
  • Linux File System Fsck Testing -- The Results Are In
    EnterpriseStorageForum: "It has been a while since we started the fsck project to test fsck (file system check) times on Linux file systems. After an extended delay, the Linux File System fsck testing results can now be presented."
  • Firefox 11 Gets SPDY
    Datamation: Google's speed-enhancing SPDY protocol lands in upcoming version of Mozilla's open source browser.
  • Piracy and the value of freedom
    Linux User & Developer: "If I were a victim of actual piracy while sailing the seas, I would probably consider the word's rampant misuse in technology circles as massively insulting."

Phoca - Google AdSense Easy

Google Search

Webwww.biggerbytes.be

RSS socialnet

Add to MyYahoo!
Subscribe in NewsGator Online
Add to Newsburst
Add to Google
Add to My AOL
Add to Pluck
Subscribe in FeedLounge
Add to Windows Live
Add to NetVibes
Subscribe in Rojo
Subscribe in Bloglines
Add to MyMSN
Add to Plusmo for your cellphone
Add to PageFlakes
Add to Technorati
Add to BlinkBits
Copyright © 2012 BiggerBytes.Be. All Rights Reserved.
Joomla! is Free Software released under the GNU/GPL License.