如何约曼与脚手架现有的Java目录结构相结合 [英] How to combine Yeoman scaffolding with existing Java directory structure

查看:260
本文介绍了如何约曼与脚手架现有的Java目录结构相结合的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我现有的Web项目的目录结构的服务HTML内容,同时与码头的发展是myProject的/ src目录/主/ web应用/

In my existing web project the directory structure for the served html content while development with jetty is "myProject/src/main/webapp/"

现在,我想在这里集成了一个angularjs项目。
我打得有点与约曼。

Now, I want to integrate an angularjs project here. I've played a little bit with Yeoman.

如果我与自耕农脚手架,我不知道我怎么能整合到我们现有的开发和部署结构。
我想用主文件夹myProject的运行自由民的脚手架就可以了。然后,我会得到一个myProject的/应用/为我所有的东西前端diretory。我应该指示不知何故(如何?)我的码头服务器使用... / src目录/主/ web应用/作为新的应用程序目录的别名?

If I'm scaffolding with yeoman, I'm wondering how I can integrate it into our existing dev and deployment structure. I suppose to use the main folder "myProject" to run yeoman scaffolding would be fine. Then I would get a "myProject/app/" diretory for all my frontend stuff. Should I instruct somehow (how?) my jetty server to use ".../src/main/webapp/" as an alias for the new app directory?

我们使用的码头主要是请求后端的代理。有还没有办法做到类似现场重装为自耕农服务器,结合码头?

We use jetty mainly as a proxy for requesting the backend. Is there also a way to do a live reload similar to "yeoman server" in combination with jetty?

推荐答案

看看我就怎么做Django的约曼回答集成。结果
建筑的概念是一样的,甚至外部的文章(绝对是一个不容读取)都是基于Java的。

Take a look at my answer on how to do Django-Yeoman integration.
Architectural concepts will be the same, even external articles (definitely a must-reads) are Java-based.

在短:


  • 使用自耕农 - Maven的插件。如果您在摇篮这就是尚酷,因为你将有繁重的任务,更好地控制被调用。

  • 您的项目结构可以像某事,如:

  • Use yeoman-maven-plugin. If you are on Gradle that's still cool, since you will have better control on grunt tasks being invoked.
  • Your project structure can resemble sth like:

pom.xml

src/
    main/
        java/
            ...
        resources/
            ...
        webapp/
            WEB-INF/
yo/
    dist/
    <<rest of Yeoman-generated stuff here (mkdir yo; cd yo; yo angular ...)>>


  • 该插件负责复制生产就绪<​​code>哟/ DIST 到 WEB-INF 。< BR>
    所有你需要做的是服务于它作为一个静态资源,这对Spring MVC的(调度的servlet):

  • The plugin takes care for copying production-ready yo/dist to WEB-INF.
    All you have to do is to serve it as a static resource, that's for Spring MVC (dispatcher servlet):

    <!--Yeoman static content-->
    <mvc:resources location="WEB-INF/yo/" mapping="/**"/>
    

    做某事呈三角的码头或纯servlet配置。

    Do sth simillar for Jetty or in pure Servlet config.

    剩下的,尤其是开发设置在参考答案描述。

    The rest, particularly dev setup is described in referenced answer.

    这篇关于如何约曼与脚手架现有的Java目录结构相结合的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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