是否有可能将AngularJs包含到Gradle项目中 [英] Is it possible to include AngularJs to a project with Gradle

查看:111
本文介绍了是否有可能将AngularJs包含到Gradle项目中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道可以将包含Maven的AngularJs包含到Spring项目中,但是如何将其包含在Gradle中?

I know that it is possible to include AngularJs with Maven into a Spring project for instance but how would one include it with Gradle?

查看Gradle存储库,我发现没有AngularJs条目。也许有可能使用Gradle从Maven仓库获取它?但是,如何做到这一点。

Looking into gradle repository I find no AngularJs entries. Maybe it's possible to fetch it from Maven repository with Gradle? But how would one do that.

推荐答案

尽管在下面的讨论中证明了这个问题没有意义通过gradle下载angular可以用以下代码完成:

Although it turned out in the discussion below the question that it doesn't make sense to download angular via gradle it can be done with the following piece of code:

repositories {
   ivy {
      name = 'AngularJS'
      url = 'https://code.angularjs.org/'
      layout 'pattern', {
         artifact '[revision]/[module](.[classifier]).[ext]'
      }
   }
}

configurations {
   angular
}

dependencies {
   angular group: 'angular', name: 'angular', version: '1.3.9', classifier: 'min', ext: 'js'
}

task fetch(type: Copy) {
   from configurations.angular
   into 'src/main/webapp/js'
   rename {
      'angular.js'
   }
}

这篇关于是否有可能将AngularJs包含到Gradle项目中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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