我正在尝试将 scala 项目打包到 jar 中,并使用 Buildrs package()方法将属性写入清单。
该软件包似乎对 Manifest 没有影响。这是构建文件:
VERSION_NUMBER = "1.0.0"
GROUP = "Green"
COPYRIGHT = "Green CopyRight"
require 'buildr/scala'
Buildr::Scala::Scalac::REQUIRES.library = '2.8.0-SNAPSHOT'
Buildr::Scala::Scalac::REQUIRES.compiler = '2.8.0-SNAPSHOT'
Java.classpath.reject! { |c| c.to_s.index('scala') }
Java.classpath << Buildr::Scala::Scalac::REQUIRES
ENV['USE_FSC'] = 'yes'
repositories.remote << "http://www.ibiblio.org/maven2/"
desc "The Green project"
define "Green" do
project.version = VERSION_NUMBER
project.group = GROUP
package(:jar).with :manifest=>manifest.merge(
'Main-Class'=>'com.acme.Main',
'Implementation-Vendor'=>COPYRIGHT
)
end
这是生成的清单:
Build-By: brianheylin
Build-Jdk: 1.6.0_17
Implementation-Title: The Green project
Implementation-Version:
Implementation-Vendor:
Main-Class: green.GreenMain
Manifest-Version: 1.0
Created-By: Buildr
请注意,Implementation-Vendor或Main-Class属性都没有被覆盖。我按如下方式运行 Buildr:
jruby -S buildr clean package
我正在使用 jRuby 1.4.0 和 Buildr 1.3.5(作为 gem 安装)。有人对为什么会这样有任何想法吗?