【问题标题】:How to create a nodejs archetype from maven如何从 maven 创建 nodejs 原型
【发布时间】:2015-07-14 06:07:11
【问题描述】:

项目的当前默认性质是'org.eclipse.jdt.core.javanature'(Java性质)但我想将项目的默认性质更改为org.nodeclipse .ui.NodeNature' (nodejs)。

我应该在 maven 原型中的哪里指定这个插件以及在哪个阶段。

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>

它不适合我。有什么想法吗?

谢谢

【问题讨论】:

  • 你的“跟随插件”是什么意思?
  • 我在 pom.xml 中使用了 'maven-eclipse-plugin' 但这不起作用。

标签: eclipse node.js maven maven-plugin maven-eclipse-plugin


【解决方案1】:

您似乎想用 Node 替换 Java Nature。 AFAICT,引用的页面提供了通过 pom.xml 向默认值添加性质的说明。默认值在 .project 文件中定义...将该文件中的“buildspec”和“natures”标签替换为:

    <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>

您可能还需要将 .jshintrc 文件添加到项目的根目录,但我认为您可以在 Preferences -> JSHint 面板中构建它

【讨论】:

  • 谢谢。但我不想手动更改 .project 文件,我想在创建项目时使用我的原型将项目的性质设置为 nodejs 。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2011-06-28
  • 1970-01-01
  • 2011-12-09
  • 2023-03-17
  • 1970-01-01
  • 2011-03-26
  • 2011-05-04
相关资源
最近更新 更多