如何安装jtransc?

时间:2018-10-15 17:44:20

标签: java gradle build build.gradle gradle-plugin

jtransc Github自述文件显示我可以添加一个gradle插件:

plugins {
    id "com.jtransc" version "0.6.8"
}

但是,每当我同步项目时,它都会显示以下错误:

> Could not resolve all artifacts for configuration ':classpath'.
   > Could not find com.jtransc:jtransc-main:unspecified.
     Searched in the following locations:
       - https://plugins.gradle.org/m2/com/jtransc/jtransc-main/unspecified/jtransc-main-unspecified.pom
       - https://plugins.gradle.org/m2/com/jtransc/jtransc-main/unspecified/jtransc-main-unspecified.jar
     Required by:
         project : > com.jtransc:com.jtransc.gradle.plugin:0.6.8 > gradle.plugin.com.jtransc:jtransc-gradle-plugin:0.6.8

如果我在浏览器中转到这些URL,它将返回404。

如何让jtransc gradle插件在我的项目中工作?

1 个答案:

答案 0 :(得分:1)

不知道为什么plugins块不起作用,但是以下操作可以完成:

buildscript {
  repositories {
    maven {
      url "https://plugins.gradle.org/m2/"
    }
  }
  dependencies {
    classpath "com.jtransc:jtransc-gradle-plugin:0.6.8"
  }
}

apply plugin: "com.jtransc"

也许是因为该gradle.plugin.前缀here似乎完全不合适,所以发布不正确。