【问题标题】:Download dependencies from a maven repository using grunt使用 grunt 从 maven 存储库下载依赖项
【发布时间】:2013-10-08 23:55:06
【问题描述】:

我想访问 maven 并下载我在 pom.xml 中的 1 个依赖项

    <artifactId>id</artifactId>
  <packaging>pom</packaging>
  <name>lorep ipsum</name>

  <parent>
    <groupId>com.whatever.client</groupId>
    <artifactId>client-parent</artifactId>
    <version>2.0</version>
  </parent>

  <dependencies>
    <dependency>
      <groupId>com.cubeia.firebase.client</groupId>
      <artifactId>firebase-js-api</artifactId>
      <classifier>javascript</classifier>
      <type>js</type>
    </dependency>


  </dependencies>

是否有任何插件可以访问 maven 存储库,或者我应该通过 node-js 编写它?我知道有插件可以部署和发布到 maven,但没有下载依赖项。

有什么建议吗?

【问题讨论】:

  • 如果您有一个基于 maven 的项目,您可以简单地将依赖项添加为依赖项,它将自动下载。如果你想明确地这样做,你可以使用 maven-dependency-plugin 来达到这样的目的。
  • 这可以帮助我做第一种方法,但我想使用 grunt 或 node.js 下载位于 maven 存储库上的依赖项。

标签: node.js maven npm gruntjs


【解决方案1】:

最后,我使用“grunt-git”调用的 maven 构建从 maven 下载依赖项

shell: {
            development: {
                options: {
                    stdout: true
                },
                command: 'mvn clean install -f ./dependencies/pom.xml'                    
        }

我只是运行我的 mvn 构建,只需将依赖项下载到我想要的目标文件夹。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-07-13
    • 2016-04-13
    • 1970-01-01
    • 1970-01-01
    • 2013-06-30
    • 1970-01-01
    • 2019-07-31
    • 2020-10-30
    相关资源
    最近更新 更多