You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@netbeans.apache.org by "Jaroslav Tulach (JIRA)" <ji...@apache.org> on 2017/10/31 07:26:00 UTC

[jira] [Commented] (NETBEANS-103) Cannot open Maven and node.js projects after New Project wizard

    [ https://issues.apache.org/jira/browse/NETBEANS-103?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16226389#comment-16226389 ] 

Jaroslav Tulach commented on NETBEANS-103:
------------------------------------------

To reproduce the problem you can obtain my {{graal-js-archetype}} repository: https://github.com/jaroslavtulach/graal-js-archetype/ and build and install its {{nbwizard}} project. Then you should see the project registered in the IDE as the illustrative picture shows: !https://raw.githubusercontent.com/JaroslavTulach/graal-js-archetype/master/docs/wizard.png!
After creating it only the Maven project is opened. It would be nice if nested {{src/main/js/package.json}} was recognized as a project as well and opened too.

> Cannot open Maven and node.js projects after New Project wizard
> ---------------------------------------------------------------
>
>                 Key: NETBEANS-103
>                 URL: https://issues.apache.org/jira/browse/NETBEANS-103
>             Project: NetBeans
>          Issue Type: Bug
>          Components: projects - Generic Projects UI, projects - Maven
>    Affects Versions: 8.2
>            Reporter: Jaroslav Tulach
>            Assignee: Tomas Zezula
>            Priority: Minor
>
> I have a [wizard that creates two projects|https://github.com/JaroslavTulach/graal-js-archetype/commit/379693f2a47c21bffd5bdad9321d727c7affdcbe] - one Maven and inside of it a node.js 
> ready folder with `packages.json` file. I'd like the *New Project* wizard to open both projects.
> Currently only the Maven project is opened. Only if I patch *NetBeans* as:
> {code}
> netbeans$ hg diff
> diff -r fcaaa60addf7 maven/src/org/netbeans/modules/maven/NbMavenProjectImpl.java
> --- a/maven/src/org/netbeans/modules/maven/NbMavenProjectImpl.java      Tue Oct 17 16:38:27 2017 +0200
> +++ b/maven/src/org/netbeans/modules/maven/NbMavenProjectImpl.java      Thu Oct 26 16:43:23 2017 +0200
> @@ -912,11 +912,17 @@
>              if (obj instanceof NbMavenProjectImpl) {
>                  impl = ((NbMavenProjectImpl) obj);
>              } else {
> -                impl = ((Project) obj).getLookup().lookup(NbMavenProjectImpl.class);
> +                NbMavenProjectImpl realMaven = ((Project) obj).getLookup().lookup(NbMavenProjectImpl.class);
> +                if (realMaven != null && realMaven.getProjectDirectory().equals(((Project) obj).getProjectDirectory())) {
> +                    impl = realMaven;
> +                } else {
> +                    impl = null;
> +                }
>              }
>              if (impl != null) {
>                  return getPOMFile().equals(impl.getPOMFile());
>              }
> +
>          }
>          return false;
>      }
> diff -r fcaaa60addf7 projectui/src/org/netbeans/modules/project/ui/actions/NewProject.java
> --- a/projectui/src/org/netbeans/modules/project/ui/actions/NewProject.java     Tue Oct 17 16:38:27 2017 +0200
> +++ b/projectui/src/org/netbeans/modules/project/ui/actions/NewProject.java     Thu Oct 26 16:43:23 2017 +0200
> @@ -198,7 +198,7 @@
>                              if (newFo.isFolder()) {
>                                  try {
>                                      Project p = ProjectManager.getDefault().findProject(newFo);
> -                                    if (p != null && !ProjectConvertors.isConvertorProject(p)) {
> +                                    if (p != null) {
>                                          // It is a project, so schedule it to open:
>                                          projectsToOpen.add(p);
>                                      } else {
> {code}
> I am sure my patch isn't 100% correct and I am ready to adjust it according to here in provided suggestions.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)