The Artima Developer Community
Sponsored Link

Java Buzz Forum
Maven javap Plugin

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
dion

Posts: 5028
Nickname: dion
Registered: Feb, 2003

Dion Almaer is the Editor-in-Chief for TheServerSide.com, and is an enterprise Java evangelist
Maven javap Plugin Posted: Aug 22, 2005 5:24 PM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by dion.
Original Post: Maven javap Plugin
Feed Title: techno.blog(Dion)
Feed URL: http://feeds.feedburner.com/dion
Feed Description: blogging about life the universe and everything tech
Latest Java Buzz Posts
Latest Java Buzz Posts by dion
Latest Posts From techno.blog(Dion)

Advertisement

Javap is one of those utils that gets installed with Java, that some never find. Javap is helpful for poking around in bytecode found in the classpath.

One of the ways I use javap is to just find out if a certain class is in my CLASSPATH (as well as learning about the methods etc).

As soon as you are in a real build environment, you need to make sure that a class is in the CLASSPATH that your build is working on.

Since I spend time in Maven-land, I use a tiny little maven plugin which does the work to find out if a class is in the dependency list for a project:

maven -Dclass=java.lang.String javap

The bulk of the work looks kinda like this:

<goal name="javap:classpath:check" description="Check Classpath">
	<fail message="Must set the 'class' variable. E.g. maven -Dclass=java.lang.String javap." unless="class"/>

	<available property="class.found" classname="${class}" classpathref="maven.dependency.classpath"/>

	<j:choose>
		<j:when test="${class.found}">
			<echo>Class Found: ${class}</echo>
		</j:when>
	
		<j:otherwise>
			<echo>Class NOT Found: ${class}</echo>
		</j:otherwise>
	</j:choose>
</goal>

Download Maven Javap Plugin

Read: Maven javap Plugin

Topic: The Head First Girl's Double Life Previous Topic   Next Topic Topic: [Aug 11, 2005 14:51 PDT] 9 Links

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use