title: How to package Java Agent as Visual VM plugin
body: <p>I have written a Java Agent along with an SWT GUI for controlling the agent. </p>
  
  <p><a href="https://github.com/mchr3k/org.intrace/wiki" rel="nofollow noreferrer">https://github.com/mchr3k/org.intrace/wiki</a> </p>
  
  <p>I want to package this library into a plugin for VisualVM to allow the agent to be attached to a JVM using VisualVM. </p>
  
  <p>I have written a Netbeans module to do this right here: </p>
  
  <p><a href="http://github.com/mchr3k/org.intrace/tree/master/InTrace-VisualVM-Plugin/" rel="nofollow noreferrer">http://github.com/mchr3k/org.intrace/tree/master/InTrace-VisualVM-Plugin/</a> </p>
  
  <p>This works when I run the project from Netbeans. However, when I use "Create NBM" to package the project the resulting library fails to install in VisualVM. The output from the log is as follows: </p>
  
  <pre>
  INFO [org.netbeans.modules.autoupdate.services.InstallSupportImpl]: Timeout waiting for loading module org.intrace.visualvm/1.0 
  INFO [org.netbeans.modules.autoupdate.ui.wizards.InstallStep]: timeout of loading InTrace Launcher[org.intrace.visualvm/1.0] 
  org.netbeans.api.autoupdate.OperationException: timeout of loading InTrace Launcher[org.intrace.visualvm/1.0] 
     at org.netbeans.modules.autoupdate.services.InstallSupportImpl$3.call(InstallSupportImpl.java:437) 
     at org.netbeans.modules.autoupdate.services.InstallSupportImpl$3.call(InstallSupportImpl.java:302) 
     at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) 
     at java.util.concurrent.FutureTask.run(FutureTask.java:138) 
     at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885) 
     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907) 
  [catch] at java.lang.Thread.run(Thread.java:619) 
  </pre>
  
  <p>I'm also suspicious that my agent and client libraries have not been packaged into the nbm file as it is way too small. </p>
  
  <p>I suspect that the problem is that I need to add something to the project build.xml but I am struggling to work out what. </p>
  
  <p><a href="http://github.com/mchr3k/org.intrace/blob/master/InTrace-VisualVM-Plugin/build.xml" rel="nofollow noreferrer">http://github.com/mchr3k/org.intrace/blob/master/InTrace-VisualVM-Plugin/build.xml</a> </p>
  
  <p>Can anyone suggest what I am missing?</p>