Mac 10.11.6上的Java:代码没有资源,但签名表明它们必须存在

时间:2016-09-15 06:18:03

标签: java oracle macos ant

我试图按照Oracle提供的说明打包Java App,以便在Mac上进行分发。

http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/packagingAppsForMac.html

我正在使用运行OS 10.11.6的Mac。一切正常,直到我进入代码签名步骤。在搜索网后,我创建了以下ant脚本片段。

<property name="MyApp.app" location="dist/ButtonDemo.app"/>
<property name="jdk" value="jdk1.8.0_101.jdk"/>

<exec executable="chmod">
    <arg line="-R a+w ${MyApp.app}"/>
</exec>
<apply executable="codesign">
    <arg line="-f -s 'Developer ID Application: MyName'"/>
    <fileset dir="${MyApp.app}/Contents/PlugIns/${jdk}" />
</apply>
<exec executable="codesign">
    <arg line="-f -s 'Developer ID Application: MyName' ${MyApp.app}"/>
</exec>
<!-- verify codesign -->
<exec executable="codesign" failonerror="true">
    <arg line="-d --verbose=4 --strict ${MyApp.app}"/>
</exec>
<!-- verify gatekeeper -->
<exec executable="spctl" failonerror="true">
    <arg line="--assess --verbose=4 --type execute ${MyApp.app}"/>
</exec>

我得到以下输出。

clean:
[delete] Deleting directory /Users/mike/ButtonDemo/components-ButtonDemoProject/dist/ButtonDemo.app

bundle-buttonDemo:
[bundleapp] Creating app bundle: ButtonDemo

sign:
[exec] Executable=/Users/mike/ButtonDemo/components-ButtonDemoProject/dist/ButtonDemo.app/Contents/MacOS/JavaAppLauncher
[exec] Identifier=components.ButtonDemo
[exec] Format=app bundle with Mach-O thin (x86_64)
[exec] CodeDirectory v=20200 size=341 flags=0x0(none) hashes=5+3 location=embedded
[exec] Hash type=sha256 size=32
[exec] CandidateCDHash sha1=8e4ec99904729d3faf45b8d5f26048d16a9f11c5
[exec] CandidateCDHash sha256=1feeb3eb8479ddfdf25e09cc5660e992f52bda06
[exec] Hash choices=sha1,sha256
[exec] CDHash=1feeb3eb8479ddfdf25e09cc5660e992f52bda06
[exec] Signature size=8919
[exec] Authority=Developer ID Application: MyName (XXXX)
[exec] Authority=Developer ID Certification Authority
[exec] Authority=Apple Root CA
[exec] Timestamp=Sep 13, 2016, 2:47:41 AM
[exec] Info.plist entries=16
[exec] TeamIdentifier=XXXX
[exec] Sealed Resources version=2 rules=12 files=4
[exec] Internal requirements count=1 size=184
[exec] /Users/mike/ButtonDemo/components-ButtonDemoProject/dist/ButtonDemo.app: code has no resources but signature indicates they must be present

BUILD FAILED
/Users/mike/ButtonDemo/components-ButtonDemoProject/build.xml:46: exec returned: 1

在dist / ButtonDemo.app / Contents / Resources中对应用程序包的简单检查表明存在资源。为什么我会收到此错误?

0 个答案:

没有答案