title: Netbeans reloads no class when "Apply Code Changes" in a maven project with remote jpda debugging
body: <p>So I have a maven project which produces a jar package containing some ant tasks.</p>
  
  <p>When I run my ant build script somewhere else with jpda open, and debug the tasks, say MyTask with NetBeans, the Apple Code Changes button doesn't work. Here is the output of the netbeans console:</p>
  
  <pre><code>cd /trunks/tasks; JAVA_HOME=/opt/jdk /opt/netbeans-7.0/java/maven/bin/mvn -Djpda.stopclass=com.abc.ant.MyTask compile
  Scanning for projects...
  
  ------------------------------------------------------------------------
  Building tasks 1.0-SNAPSHOT
  ------------------------------------------------------------------------
  
  [resources:resources]
  Using 'UTF-8' encoding to copy filtered resources.
  Copying 1 resource to com/abc/ant
  
  [compiler:compile]
  Compiling 1 source file to /trunks/tasks/build/classes
  ------------------------------------------------------------------------
  BUILD SUCCESS
  ------------------------------------------------------------------------
  Total time: 1.548s
  Finished at: Fri Mar 09 17:45:24 CST 2012
  Final Memory: 11M/149M
  ------------------------------------------------------------------------
  NetBeans: classes to reload: []
  NetBeans: No class to reload
  </code></pre>
  
  <p>So Netbeans does successfully tell Maven what class needs to be compiled. However, NetBeans won't reload the compiled class. Is it because my ant process is using the jar package produced by the Maven project, or because of other reasons?</p>
  
  <p>Note: I have some custom configurations, like where to output the compiled classes, and where to put the jar package. Could that be a reason?</p>
  
  <hr>
  
  <p><strong>Update 2:</strong></p>
  
  <p><strong>OK I found the reason by myself.</strong></p>
  
  <p>It's because I added the following line under <code>&lt;build&gt;</code> in the pom.xml:</p>
  
  <pre><code>&lt;directory&gt;${my.custom.work.dir}/build&lt;/directory&gt;
  </code></pre>
  
  <p>So maven will output the compiled class files to this directory, rather than the default <code>${basedir}/target</code>. However, Netbeans seems to be too stupid to recognize that -- it just tries the default directory.</p>
  
  <p>Now the question could be much easier: <strong>is there any way to make the IDE recognize that by adding configuration in the pom?</strong></p>