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 193256 - C++ project opened as a Maven Project
Summary: C++ project opened as a Maven Project
Status: RESOLVED WONTFIX
Alias: None
Product: projects
Classification: Unclassified
Component: Maven (show other bugs)
Version: 7.0
Hardware: PC Windows XP
: P1 normal (vote)
Assignee: Jesse Glick
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-10 19:07 UTC by javydreamercsw
Modified: 2011-01-04 14:17 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Picture (3.75 MB, image/x-bmp)
2010-12-10 19:08 UTC, javydreamercsw
Details
Logs (358.87 KB, application/octet-stream)
2010-12-10 19:10 UTC, javydreamercsw
Details
nbproject folder (25.16 KB, application/x-zip-compressed)
2010-12-17 14:37 UTC, javydreamercsw
Details

Note You need to log in before you can comment on or make changes to this bug.
Description javydreamercsw 2010-12-10 19:07:54 UTC
[ BUILD # : 201012100001 ]
[ JDK VERSION : 1.6.22 ]

For some reason on today's build my C++ project opened as a Maven project.

See attachment.
Comment 1 javydreamercsw 2010-12-10 19:08:59 UTC
Created attachment 103947 [details]
Picture
Comment 2 javydreamercsw 2010-12-10 19:10:01 UTC
Created attachment 103948 [details]
Logs

Couldn't see anything related to the issue but just in case.
Comment 3 javydreamercsw 2010-12-10 19:12:59 UTC
Well I think I know why, I have a pom.xml in the root of the project for using sonar in the project. That file has been there for a while. Still think it shouldn't happen (and it didn't on yesterday's build)
Comment 4 Leonid Lenyashin 2010-12-10 21:58:33 UTC
Looks as Maven issue. Reassigning to J2EE for evaluation.
Comment 5 David Konecny 2010-12-12 18:49:15 UTC
(In reply to comment #4)
> Looks as Maven issue. Reassigning to J2EE for evaluation.
Why J2EE? Why no just Maven?
Comment 6 Leonid Lenyashin 2010-12-13 13:01:49 UTC
(In reply to comment #5)
> (In reply to comment #4)
> > Looks as Maven issue. Reassigning to J2EE for evaluation.
> Why J2EE? Why no just Maven?

I just found Maven subcat there. Sorry if it was a wrong one.
Comment 7 Jesse Glick 2010-12-14 21:13:19 UTC
(In reply to comment #3)
> I have a pom.xml in the root of the project

Then it will be considered a Maven project, unless some other project type claims it first. http://deadlock.netbeans.org/hudson/job/nbms-and-javadoc/lastSuccessfulBuild/artifact/nbbuild/build/generated/services.txt lists the Maven factory at position 666 where it has always been. If and only if the CND support uses a factory registered at a lower position, and your project has well-formed metadata for that factory, it will be recognized as such.
Comment 8 Thomas Preisler 2010-12-14 22:01:13 UTC
Shouldn't Maven project use a stronger check? Just checking for the presence of one file (pom.xml) seems very weak.
Comment 9 Thomas Preisler 2010-12-14 22:12:38 UTC
There are other projects than CND that has a higher 'position'. They will break too. Seems like Maven project needs a stronger check.
Comment 10 Alexander Simon 2010-12-15 09:42:51 UTC
Bug does not reproducible.
Pleas provide steps to reproduce bug if bug still exists.
My use case was:
- create maven application
- create C/C++ application
- close maven application
- close IDE
- copy all staff under maven application in C/C++ application folder
- start IDE
I see C/C++ application.
- close IDE
- remove nbproject folder under C/C++ application
- start IDE
I see maven application.
So possible your bug can be caused by:
- C/C++ application has a broken nbproject
- C/C++ plugin does not activated
Comment 11 Vladimir Voskresensky 2010-12-15 10:42:22 UTC
Hi Javier,

can you send us your nbproject subfolder?

Do you use ergonomics?
Can you reproduce it with disabled ergonomics?
(comment out ergonomics line in nb_inst/etc/netbeans.clusters file)

Thanks,
Vladimir.
Comment 12 javydreamercsw 2010-12-17 14:34:33 UTC
In my case just placing a pom.xml file in the root of the C++ project causes that to be seen as a Maven project. The IDE is smart enoguht to detect if a folder is already part of a C++ project. Why not use that to determine if the folder is a Maven project?
Comment 13 javydreamercsw 2010-12-17 14:35:13 UTC
Removing ergonomics doesn't change anything.
Comment 14 javydreamercsw 2010-12-17 14:37:21 UTC
Created attachment 104210 [details]
nbproject folder

As requested
Comment 15 Alexander Simon 2010-12-17 18:30:48 UTC
reassign to evaluation
Comment 16 Jaroslav Tulach 2010-12-20 21:41:58 UTC
Comment #14 says "ergonomics don't have any influence on the issue". Why is the bug assigned to ergonomics then? Either I am confused or Alexander deserves the issue back.
Comment 17 Alexander Simon 2010-12-21 08:27:03 UTC
javydreamercsw,

Could you make following experiment:
- copy nbproject in some new folder
- copy pom.xml in the created folder
- open project from this folder
- close IDE
- attach the folder and IDE message log (if issue is reproduced).
- if issue is not reproduced, please send IDE log for you original use case.

Thanks,
Alexander
Comment 18 javydreamercsw 2010-12-21 21:05:01 UTC
I think there's a confusion. If you see comment # 12 (http://netbeans.org/bugzilla/show_bug.cgi?id=193256#c12) I refer to the IDE being smart enough to know that that folder is included in a C++ project. The C++ project is not on the same folder as the sources. Folder 1(Netbeans Project) shows a a C++ project. Folder 2 (sources) shows as a Maven project due to the pom.xml file. If you make the mistake, like I did, and try to open folder 2 the Maven project a lot of stuff was created (I assume related to Maven)

As feedback to your experiment, if you place the netbeans folder in the same place the pom.xml file is, it is displayed as a C++ project. I think that the real issue is pointed out in comments 8 and 9. That's what really raised this issue to P1.
Comment 19 Alexander Simon 2010-12-22 07:30:21 UTC
Maven project should have more reasons to treat folder as Maven project.
From C/C++ point of view folder that contains:
- any file Makefile, *.mk, configure, *.pro, CMakeLists.txt, build.xml, ...
- C/C++/Header files in any subfolders
*cannot* be treated as Maven project.
So it seems Maven module mixes "opening" and "importing" actions.
Comment 20 Jesse Glick 2011-01-04 14:17:33 UTC
Sorry, but a folder with a pom.xml is a Maven project and the IDE will open it as such. If you want your project metadata to take priority over Maven metadata, place your project factory in a lower position. Users can also use external source roots if necessary.

(In reply to comment #19)
> it seems Maven module mixes "opening" and "importing" actions.

There is no import step for Maven. This is a key feature.