我在gradle中使用shadow插件来构建jar文件,我已按如下方式添加了构建脚本
object App extends SimpleSwingApplication {
lazy val ui = new GridPanel(2,1) {
val button = new Button("1")
contents += button
contents += new Label("2")
listenTo(button)
reactions += {
case evt @ MouseClicked(b, pt, _, _, _) if b == button && evt.peer.getButton == java.awt.event.MouseEvent.BUTTON2 =>
println(s"Mouse clicked at (${pt.x}; ${pt.y}) - button: ${evt.peer.getButton}")
}
}
def top = new MainFrame {
contents = ui
visible = true
preferredSize = new Dimension(500,500)
}
}
我没有要求buildscript {
repositories { jcenter() }
dependencies {
classpath 'com.github.jengelman.gradle.plugins:shadow:1.2.2'
}
}
从gradle
获取shadow-1.2.2.jar,而是希望从http://jcenter.bintray.com/com/github/jengelman/gradle/plugins/shadow/1.2.2/获取jcenter()
我只想在本地构建它,我已将shadow-1.2.2.jar
放在libs文件夹中,我的构建脚本是
shadow-1.2.2.jar
但它不起作用请帮忙!
答案 0 :(得分:1)
以下代码应该有效:
buildscript {
dependencies {
classpath fileTree(dir: 'libs', include: '*.jar')
}
}
gradle compile
依赖项没有buildscript
配置。