This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 268853 - "Compile On Save" is not working for EAR projects.
Summary: "Compile On Save" is not working for EAR projects.
Status: NEW
Alias: None
Product: javaee
Classification: Unclassified
Component: EAR (show other bugs)
Version: 8.2
Hardware: PC Linux
: P3 normal (vote)
Assignee: David Konecny
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-11-05 10:28 UTC by negora
Modified: 2016-11-07 08:10 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description negora 2016-11-05 10:28:05 UTC
The feature "Compile On Save" is not working for EAR projects (Enterprise Application projects). Be it with Ant or Maven as build tool.

To avoid the possible effects of having upgraded my NetBeans installation over time, I've temporarily moved my configuration directory, from $HOME/.netbeans/8.2/ to $HOME/.netbeans/8.2.bak/ , and I've started a new one.

I've created an Enterprise Application project, using the option "Java EE -> Enterprise Application". Then I've created a Java class in the EJB sub-project, and one more in the Web sub-project. I've saved both files. Since they haven't been compiled automatically (I believe this is the right behaviour if you haven't built the project at least once), I've clicked on the EAR project and then I've clicked on "Build". The ".class" files have been generated correctly. Later, I've added a public method to each class and I've saved them. But the ".class" files have remained the same. Same date, same size, same checksum.

The locations where I've checked the resulting classes have been these ones:

  EnterpriseApplication1/EnterpriseApplication1-ejb/build/classes/
  EnterpriseApplication1/EnterpriseApplication1-war/build/web/WEB-INF/classes/

All this is with regard to the project that uses Ant as the build tool. Later I've created a similar project, but this time using the option "Maven -> Enterprise Application". The results have been exactly the same. The locations were I've checked are:

  mavenproject1/mavenproject1-ejb/target/classes/
  mavenproject1/mavenproject1-web/target/classes/
  mavenproject1/mavenproject1-web/target/mavenproject1-web-1.0-SNAPSHOT/WEB-INF/classes/

To make sure that the "Compile On Save" really works, I've created a Java Application project (with both Ant and Maven) and I has worked fine. Later, I've created a Web Application project (again, with Ant and Maven, separately), and it has worked fine too. So this seems to be specific of EAR projects.

Thank you.
Comment 1 negora 2016-11-07 08:10:57 UTC
In the case of Maven, I've discovered that "Compile On Save" starts to fail when you do, in the parent module, a cleaning followed by an installation. I mean, when you click on "Clean and Build". If you do this action directly on the EJB or Web module, "Compile On Save" starts to work fine again in each project. It's really curious.

I'm used to set the parent module of Maven as the main project, and to trigger every action from it, so that it's propagated to every sub-module. But, by now, I'm going not to set any main project, and just let NetBeans do the requested actions in the project that I'm currently editing. This way, I'll prevent this problem temporarily.

In the case of Ant, however, I've not found a satisfactory solution. By the way, I said in my previous message that "Compile On Save" worked fine in Web projects that used Ant, but I'm being unable to make it work again. Maybe I didn't check it properly that time. Right now I've created two independent projects, one of type EJB and another one of type Web, and auto-compilation doesn't work in either of them.

I'm going to continue testing...