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 250268 - New project cannot be created if project dir contains package.json or bower.json
Summary: New project cannot be created if project dir contains package.json or bower.json
Status: RESOLVED FIXED
Alias: None
Product: web
Classification: Unclassified
Component: HTML Project (show other bugs)
Version: 8.1
Hardware: All All
: P3 normal (vote)
Assignee: Tomas Mysik
URL:
Keywords:
Depends on: 250232 253521
Blocks: 253339
  Show dependency tree
 
Reported: 2015-02-06 12:37 UTC by Tomas Mysik
Modified: 2016-01-26 20:05 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
proposed fix (3.38 KB, patch)
2015-07-16 06:10 UTC, Tomas Mysik
Details | Diff
naive Ant fix (3.54 KB, patch)
2015-07-16 06:11 UTC, Tomas Mysik
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tomas Mysik 2015-02-06 12:37:57 UTC
If one wants to use the New Project wizard with existing sources but his project contains package.json or bower.json file, it is not possible because of HTML5 ProjectConvertor for package/bower.json file. Once issue #250232 is fixed, we should be able to allow this.

Thanks.
Comment 1 Vladimir Riha 2015-02-06 12:39:54 UTC
I was just trying that after I saw the PHP bug :)
Comment 2 Tomas Mysik 2015-05-05 12:46:16 UTC
This definitely must be fixed in the current dev version.
Comment 3 Tomas Zezula 2015-07-15 12:56:03 UTC
The new ProjectConvertors.isCOnvertorProject() can be used to exclude the artifical project.
Comment 4 Tomas Mysik 2015-07-16 06:09:40 UTC
Unfortunately, it still does not work :/ Now, the problem is in Ant's ProjectGenerator. I tried to fix it (will attach my naive patch) but it still does not work [1].

Tome, could we please have a look at it?
Thanks.
[1]
WARNING [org.openide.WizardDescriptor]
java.lang.IllegalArgumentException: Project org.netbeans.modules.project.ui.convertor.ProjectConvertorFactory$ConvertorProject@6fdd594e was not recognized as an Ant-based project
        at org.netbeans.spi.project.support.ant.ProjectGenerator$1.run(ProjectGenerator.java:222)
        at org.netbeans.spi.project.support.ant.ProjectGenerator$1.run(ProjectGenerator.java:123)
        at org.netbeans.modules.openide.util.DefaultMutexImplementation.writeAccess(DefaultMutexImplementation.java:293)
        at org.openide.util.Mutex.writeAccess(Mutex.java:299)
        at org.netbeans.spi.project.support.ant.ProjectGenerator.createProject0(ProjectGenerator.java:123)
Comment 5 Tomas Mysik 2015-07-16 06:10:03 UTC
Created attachment 154663 [details]
proposed fix
Comment 6 Tomas Mysik 2015-07-16 06:11:02 UTC
Created attachment 154664 [details]
naive Ant fix
Comment 7 Tomas Mysik 2015-07-16 12:07:37 UTC
(In reply to Tomas Mysik from comment #5)
> Created attachment 154663 [details]
> proposed fix

Tomas just found out that this patch does not fix Existing nodejs project use case.. will improve it.

Thanks.
Comment 8 Tomas Mysik 2015-07-17 06:45:04 UTC
Should be fixed now (both existing-project wizards), thanks a lot, Tome! Láďo, please verify it.

Thanks.

http://hg.netbeans.org/web-main/rev/2cb8ad876dd6
Comment 9 Quality Engineering 2015-07-18 01:46:35 UTC
Integrated into 'main-silver', will be available in build *201507180001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/2cb8ad876dd6
User: Tomas Mysik <tmysik@netbeans.org>
Log: #250268 - New project cannot be created if project dir contains package.json or bower.json
Comment 10 Valery-Sh 2016-01-26 19:58:39 UTC
If i  write:

    Project p = FileOwnerQuery.getOwner(<any-maven-web-project-file-object>);

in a NetBeans module than p is an instance of ConvertorProject.
Comment 11 Valery-Sh 2016-01-26 20:05:39 UTC
Suppose I have a Maven web application and I put into the src/main/webapp a file named package.json.

If i  write in a NetBeans module:

    Project webProject = FileOwnerQuery.getOwner(<any-maven-web-project-file-object>);

than webProject is an instance of ConvertorProject. And the code:

    WebModule.getModule(<any-maven-web-project-file-object>) produces null value.

I have:
Windows 7 (64)
jdk-1.8.0_72
NetBeans 8.1