使用maven和spring REST配置角度2项目 [英] Configure angular 2 project with maven and spring REST

查看:108
本文介绍了使用maven和spring REST配置角度2项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将我的小应用程序从角度1升级到角度2.我对角度2和节点配置有些新颖。我的web应用程序使用eclipse和maven。问题是我无法使用角度2配置。

I wanted to upgrade my small application from angular 1 to angular 2. I am somewhat new to angular 2 and node configurations. My web application use eclipse and maven. The problem is i could not able to configure using angular 2.

如果有任何教程配置目录结构,任何人都可以帮我吗?

Can anyone please help me if there is any tutorial to configure it with directory structure?

有maven插件可用,但我对我的角度2应用程序的目录结构感到困惑。

There are maven plugins available but i am bit confused about the directory structure of my angular 2 app.

提前感谢。

推荐答案

这里从角位置
显示了如何构造一个角度2项目的几个演示。在eclipse maven网络应用程序中,我将客户端文件启动到与web-inf文件夹相同级别的src / main / resources文件夹。

Here from the angular site shows several demonstrations of how to structure an angular 2 project. In an eclipse maven web app I would start my client side files into the src/main/resources folder at the same level as the web-inf folder.

Maven pom。 xml,将其包含在您的项目中。 Maven-fronted-plugin不应该用于生产。 Maven将使用此设置,节点和node_modules在项目根级别安装两个文件夹。

Maven pom.xml, include this into your project. Maven-fronted-plugin shouldn't be used for production. Maven will install two folders at the project root level with this setup, node and node_modules.

<build>
   <plugins>    
        <plugin>
                <groupId>com.github.eirslett</groupId>
                <artifactId>frontend-maven-plugin</artifactId>
                <version>1.0</version>
                <executions>
                    <execution>
                        <id>install node and npm</id>
                        <goals>
                            <goal>install-node-and-npm</goal>
                        </goals>
                        <configuration>
                            <nodeVersion>v5.3.0</nodeVersion>
                            <npmVersion>3.3.12</npmVersion>
                        </configuration>
                    </execution>

                    <execution>
                        <id>npm install</id>
                        <goals>
                            <goal>npm</goal>
                        </goals>
                        <!-- Optional configuration which provides for running any npm command -->
                        <configuration>
                            <arguments>install</arguments>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
    </plugins>
</build>

package.json将此添加到项目的根级别,然后再安装maven。

package.json add this to the root level of the project before maven clean install.

{
  "name": "budget_calculator",
  "version": "1.0.0",
  "dependencies": {
    "@angular/common":  "2.0.0-rc.1",
    "@angular/compiler":  "2.0.0-rc.1",
    "@angular/core":  "2.0.0-rc.1",
    "@angular/http":  "2.0.0-rc.1",
    "@angular/platform-browser":  "2.0.0-rc.1",
    "@angular/platform-browser-dynamic":  "2.0.0-rc.1",
    "@angular/router":  "2.0.0-rc.1",
    "@angular/router-deprecated":  "2.0.0-rc.1",
    "@angular/upgrade":  "2.0.0-rc.1",
    "systemjs": "0.19.27",
    "core-js": "^2.4.0",
    "reflect-metadata": "^0.1.3",
    "rxjs": "5.0.0-beta.6",
    "zone.js": "^0.6.12",
    "angular2-in-memory-web-api": "0.0.10",
    "bootstrap": "^3.3.6"
  }
}

这篇关于使用maven和spring REST配置角度2项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆