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 228740 - maven project does not build classes
Summary: maven project does not build classes
Status: RESOLVED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: Persistence (show other bugs)
Version: 7.3
Hardware: PC Linux
: P1 normal (vote)
Assignee: Sergey Petrov
URL:
Keywords:
: 228609 228697 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-04-19 03:27 UTC by David Konecny
Modified: 2013-04-30 06:26 UTC (History)
5 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
zipped project (161.55 KB, application/x-sdlc)
2013-04-19 03:27 UTC, David Konecny
Details
build log (91.16 KB, text/plain)
2013-04-19 03:28 UTC, David Konecny
Details
Maven log from command line. (3.34 KB, text/plain)
2013-04-19 09:26 UTC, Jiri Skrivanek
Details

Note You need to log in before you can comment on or make changes to this bug.
Description David Konecny 2013-04-19 03:27:29 UTC
Created attachment 133581 [details]
zipped project

If you reading subject and thinking that that's pretty weird and basically impossible that I absolutely agree with you. It does not make any sense but Maven project after a while stops compiling Java files into Java classes. Regardless of Compile on Save option, regardless of everything. Just does not make sense!!!

I'm running today's build from ee7 branch. I created Web Application and add servlet to it and JPA entity class and for a while everything is OK. But after a while after I do Clean & Build there is no error and output says "2 files compiled" but /target/classes is empty.

Attached is the project after "Clean & Build" and maven debug output.

Any idea what's wrong? Am I drinking too much coffee or not enough? Thanks.
Comment 1 David Konecny 2013-04-19 03:28:23 UTC
Created attachment 133582 [details]
build log
Comment 2 Petr Jiricka 2013-04-19 06:58:37 UTC
Jirko, do you know if this is reproducible also in the release73 branch?
Comment 3 Martin Janicek 2013-04-19 08:31:49 UTC
Have no clue what could be wrong, I need to investigate it further. As much as I know there were some changes arround CoS done by Milos and also I have made some changes as a fix for the issue 228396.. but nothing should affect Java EE 7 branch I guess. Milosi do you think your changes could be related?
Comment 4 Milos Kleint 2013-04-19 08:33:37 UTC
well, have you guys tried shutting down the IDE and doing the clean build using cmd line?
Comment 5 Milos Kleint 2013-04-19 08:38:59 UTC
(In reply to comment #4)
> well, have you guys tried shutting down the IDE and doing the clean build using
> cmd line?

if it exposes the same haviour, you might want to consider upgrading to maven-compiler plugin to 3.1 or downgrading..
Comment 6 Jiri Skrivanek 2013-04-19 09:26:00 UTC
Created attachment 133588 [details]
Maven log from command line.

It produces no classes even when run from command line and it is also reproducible in build 201304182201 from release73 branch.
Comment 7 Petr Jiricka 2013-04-22 12:59:06 UTC
> upgrading to maven-compiler plugin to 3.1

That sounds worth trying. 3.0 (which we are currently using) was released on Nov 16, 2012. Version 3.1 was released on Apr 3, 2013. Similarly, maven-dependency-plugin could be updated from 2.6 to 2.7.
Comment 8 David Konecny 2013-04-23 00:08:26 UTC
It is "org.eclipse.persistence.jpa.modelgen.processor" dependency which is causing this problem. Commenting out that dependency in pom.xml fixes this problem. The dependency contains annotation processor which must be doing something wrong. I'm going to file an issue for the EclipseLink (once my account activation email shows up).
Comment 9 David Konecny 2013-04-23 00:30:30 UTC
Filed as https://bugs.eclipse.org/bugs/show_bug.cgi?id=406264 .
Comment 10 David Konecny 2013-04-23 01:31:39 UTC
*** Bug 228697 has been marked as a duplicate of this bug. ***
Comment 11 Jiri Skrivanek 2013-04-23 09:52:43 UTC
I am not aware of purpose of eclipselink, javax.persistence and modelgen.processor dependencies but are they needed? For Java EE 6 maven project they are not in pom.xml and REST from DB works. Also if you remove that dependencies in Java EE 7 project it also works.
Comment 12 Jiri Skrivanek 2013-04-23 09:54:50 UTC
*** Bug 228609 has been marked as a duplicate of this bug. ***
Comment 13 Sergey Petrov 2013-04-23 10:21:51 UTC
this dependency is used because we have ap turned on by default for projects with jpa entities. but if you dont need any static menamodel, you are free to remove this dependency.
also as workaround seems to be easy, should it be p1 even if it's valid issue?
hope we'll get feedback from eclipselink team to see if it's something we need to correct on nb side.
Comment 14 David Konecny 2013-04-23 20:09:37 UTC
* javax.persistence - this dependency may not be needed because JPA APIs should be already in javaee-web-api dependency

* modelgen.processor - as Sergey said this is annotation processor which generates JPA metamodel static classes which are necessary in order to use for example JPA 2.0 Criteria APIs. Have a look at http://www.ibm.com/developerworks/java/library/j-typesafejpa/ for more details.

* eclipselink - I assume this is modelgen.processor's dependency and is therefore needed

EE6 Maven project should not be that different from EE7 one and should contains metamodel generator too in its default setup.
Comment 15 Jiri Skrivanek 2013-04-24 07:11:14 UTC
Thank you for explanation. From my point of view of a dummy user it is inevitable that everything created by NetBeans' wizard works out of box. If there is no solution from eclipselink team I would remove these dependencies. An advanced user is able to add them later if he need them.
Comment 16 David Konecny 2013-04-24 21:04:32 UTC
I hope that this is a temporary issue as EclipseLink dependency is still not a final released one. Let's see what they do with the issue I filed.
Comment 17 Petr Jiricka 2013-04-29 07:05:54 UTC
Sergey, do we have a nightly build of EclipseLink 2.5 that we can test this with? Would you do EL update in NetBeans so we can confirm the fix?

In any case, we should still update maven-compiler-plugin to version 3.1, I heard 3.0 has serious issues, and now I found e.g. this critical bug that's present in 3.0 and fixed in 3.1: http://jira.codehaus.org/browse/MCOMPILER-187
Comment 18 Martin Janicek 2013-04-29 11:20:26 UTC
I have updated archetypes to use version 3.1 of the maven-compiler-plugin (web-main #4e82730fa894 --> javaee7 branch).

As much as I understand the discussion nothing more could be done on the Maven side. Reassigning to Sergey for further evaluation (feel free to pass the issue back if something else needs to be done within Maven)
Comment 19 Sergey Petrov 2013-04-29 11:55:36 UTC
should be resolved on eclipselink side since 25/04.
Comment 20 Sergey Petrov 2013-04-29 11:57:10 UTC
There is no need to update el in netbeans as maven use snapshot dependency and it should point to latest build already.
Comment 21 Sergey Petrov 2013-04-29 11:58:21 UTC
It's nice if David will verify as I may miss something.

David, can you?
Comment 22 Jiri Skrivanek 2013-04-29 14:53:56 UTC
Test case from bug 228609 works for me. I filed a new bug 229168 for unwanted REST nodes.
Comment 23 Sergey Petrov 2013-04-30 06:26:40 UTC
tried to build attached project with maven 3.0.3 with mvn clean install command and got *.class files generated as expected.