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.
I have opened an 'old' Web Maven project create at 7.3 at 7.3.1 and now the project properties shows it is a JavaEE 7 project and if I change it to JavaEE 6 it shows a warning that this change could break the project. IMHO, it is wrong to make this kind of assumption and we need to mark the project as JavaEE X when the project is created. I am pretty sure it is better to assume all project opened at 7.3.1 are JavaEE 6 compliant than 7 by default and so make possible to the user change it to JavaEE 7 when necessary, with the appropriate warning. I think the property netbeans.hint.j2eeVersion should be create when the project is create. It will minimize any problem since the user need to already choose the JavaEE version at the wizard.
Existing Maven projects should keep their Java EE level. Please, evaluate whether it is possible to fix it in 7.3.1.
AFAIK before the new Java EE 7 support, we were recognizing project using web.xml version and if the web.xml were not presented it was always Java EE 6 project. Since Java EE 7 it's not possible to use the same mechanism because both Java EE 6 and Java EE 7 don't need to have web.xml by default (which is one of the reasons why it's possible to set Java EE version from the project properties - that possibility was disabled before 7.3.1). And it is actually reason why we are creating netbeans.hint.j2eeVersion when creating new projects. Based on the above, there is no way I can recognize the project were created as Java EE 6 not Java EE 7. On the other hand the true is that all Java EE 7 projects should have netbeans.hint.j2eeVersion set, so maybe we can set Java EE 6 as the default value instead of the Java EE 7..
BTW, Java EE 5 project from 7.3 is recognized as Java EE 7 in 7.3.1 too. It seems the project level recognition doesn't work at all.
> we are creating netbeans.hint.j2eeVersion when creating new projects So when did we start doing this? Did we do this in 7.3, or is this new behavior in 7.3.1? > BTW, Java EE 5 project from 7.3 is recognized as Java EE 7 in 7.3.1 too. So this project contains web.xml? In that case that would be a serious problem, IMO.
> BTW, Java EE 5 project from 7.3 is recognized as Java EE 7 in 7.3.1 too. You're right Jirko. Two things seems to be wrong. First there is no check for web.xml in 7.3.1 and second even with check there is Java EE 7 as the default platform. I'm going to do following: 1) Check if the netbeans.hint.j2eeVersion is created and if so use the platform defined there 2) Check for web.xml and if it exists try to guess Java EE platform 3) Else simply set version to Java EE 6 > So when did we start doing this? Did we do this in 7.3, or is this new behavior > in 7.3.1? AFAIK it's new behavior.
Fixed in: web-main #866681eef255
BTW: It won't be possible to simply graft/transplant the change-set into the release73 branch because the code differs between trunk and 7.3.1. Although it shouldn't be complicated to update the patch also for 7.3.1
Thanks a lot Martin. Who would be able to review the patch - David, would you, please?
Verified in NetBeans IDE Dev (Build web-main-10615-on-20130527).
Martine, may I ask you for the review?
Reviewed changeset seems to be fine and safe.
Thanks for the super-fast-review! :) ..I send email to reviewers and I'm going to integrate to the release73 later today.
Integrated in: releases #4ec440196f28
I guess that the assumptions done for 7.3.1 are fair enough but I have been thinking about the future (not so long future IMO) and how to improve it. Since now web.xml is optional, we gonna have this kind of issue for future versions of JavaEE. I was wondering if at least for Maven projects this lookup couldn't be improved (probably using dependencies versions), or if it is impossible to infer, maybe we can ask formally to the user the right JavaEE version (probably with a UI, maybe in the Open Project wizard...). I am wondering because since we have transparent support for Maven, people can freely create JavaEE 7 projects outside the IDE and when the user open it inside the IDE we can have issues if we assume JavaEE 6 as default.
Integrated into 'releases', will be available in build *201305272201* or newer. Wait for official and publicly available build. Changeset: http://hg.netbeans.org/releases/rev/4ec440196f28 User: Martin Janicek <mjanicek@netbeans.org> Log: #230188 - Project properties showing old project is a JavaEE 7 project by default
(In reply to comment #14) > I was wondering if at least for Maven projects this lookup couldn't > be improved (probably using dependencies versions) This is an interesting idea and I think it should be possible. It's not complicated to go through the project dependencies and lookup if there is an javaee version specified. But from what I remember this operation can be possibly expensive so I would say we can check if there is a netbeans.hint.j2eeVersion and if not, run a background task looking up for javaee version and set the netbeans.hint.j2eeVersion for the future usages. What do you think? > I am wondering because since we have transparent support for Maven, people can > freely create JavaEE 7 projects outside the IDE and when the user open it > inside the IDE we can have issues if we assume JavaEE 6 as default. Agree, if we can find some elegant solution I'm 100% for it..
Integrated into 'main-golden', will be available in build *201305281155* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/866681eef255 User: Martin Janicek <mjanicek@netbeans.org> Log: #230188 - Project properties showing old project is a JavaEE 7 project by default
(In reply to comment #16) > (In reply to comment #14) > > I was wondering if at least for Maven projects this lookup couldn't > > be improved (probably using dependencies versions) > > This is an interesting idea and I think it should be possible. It's not > complicated to go through the project dependencies and lookup if there is an > javaee version specified. But from what I remember this operation can be > possibly expensive so I would say we can check if there is a > netbeans.hint.j2eeVersion and if not, run a background task looking up for > javaee version and set the netbeans.hint.j2eeVersion for the future usages. > What do you think? I think it is acceptable. Since we don't have a reliable and performatic approach and the IDE need to know the version to be able to help the users, we need a way to balance it and keep this metadata netbeans.hint.j2eeVersion looks good to me. I still think it needs a further thinking but it is imperative fix it for the next release. Should I file a new issue for 7.4 to track this?
(In reply to comment #18) > (In reply to comment #16) > > (In reply to comment #14) > > > I was wondering if at least for Maven projects this lookup couldn't > > > be improved (probably using dependencies versions) > > > > This is an interesting idea and I think it should be possible. It's not > > complicated to go through the project dependencies and lookup if there is an > > javaee version specified. But from what I remember this operation can be > > possibly expensive so I would say we can check if there is a > > netbeans.hint.j2eeVersion and if not, run a background task looking up for > > javaee version and set the netbeans.hint.j2eeVersion for the future usages. > > What do you think? > > I think it is acceptable. Since we don't have a reliable and performatic > approach and the IDE need to know the version to be able to help the users, we > need a way to balance it and keep this metadata netbeans.hint.j2eeVersion looks > good to me. > > I still think it needs a further thinking but it is imperative fix it for the > next release. Should I file a new issue for 7.4 to track this? Yup, that would be awesome. Thanks!
Done at issue #230447.