1

The current default nature of the project is 'org.eclipse.jdt.core.javanature' (Java nature) But I want change the default nature of the project to org.nodeclipse.ui.NodeNature' (nodejs).

Where should I specify this plugin in the maven archetype and in which phase .

https://maven.apache.org/plugins/maven-eclipse-plugin/examples/provide-project-natures-and-build-commands.html

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-eclipse-plugin</artifactId>
            <version>2.9</version>
            <configuration>

                <projectnature>org.nodeclipse.ui.NodeNature</projectnature>
                <projectnature>org.eclipse.wst.jsdt.core.jsNature</projectnature>
                <projectnature>tern.eclipse.ide.core.ternnature</projectnature>

                <buildcommand>com.eclipsesource.jshint.ui.builder</buildcommand>


            </configuration>
        </plugin>
    </plugins>

</build>

Its not working for me .Any thoughts?.

Thanks

eagerToLearn
  • 429
  • 1
  • 10
  • 20

1 Answers1

0

It looks like you want to replace the Java Nature with the Node one. AFAICT, the page referenced gives instructions for adding natures to the default via the pom. The default is defined in the .project file... replace the 'buildspec' and 'natures' tags in that file with:

    <buildSpec>
            <buildCommand>
                    <name>com.eclipsesource.jshint.ui.builder</name>
                    <arguments>
                    </arguments>
            </buildCommand>
    </buildSpec>
    <natures>
            <nature>org.nodeclipse.ui.NodeNature</nature>
            <nature>org.eclipse.wst.jsdt.core.jsNature</nature>
            <nature>tern.eclipse.ide.core.ternnature</nature>
    </natures>

You may need to add a .jshintrc file to the root of the project as well, but iI think you can build that in the Preferences -> JSHint panel

Rondo
  • 3,458
  • 28
  • 26
  • Thanks . But I am not looking to change the .project file manually, I want to set the nature of the project to nodejs at the time of project creation by using my archetype . – eagerToLearn Jul 08 '15 at 14:19