plugin的条目打破了应用程序

plugin的条目打破了应用程序

本文介绍了新的< updateManifestEntries> webstart-maven-plugin的条目打破了应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我的JDK版本升级到u45时,我收到有关缺少安全信息的警告。因此,我使用以下安全更新作为使用webstart-maven-plugin进行webstart签名的一部分

As my JDK version upgraded to u45 now I get warnings about missing security information. So I used following security updates as part of webstart signing using webstart-maven-plugin

<plugin>
<groupId> org.codehaus.mojo</groupId>
<artifactId>webstart-maven-plugin</artifactId>
<version>1.0-beta-4</version>
<executions>
    <execution>
        <phase>package</phase>
        <goals>
            <goal>jnlp-inline</goal>
            <!-- use jnlp, jnlp-inline or jnlp-single as appropriate -->
        </goals>
    </execution>
</executions>
<configuration>
    <!--outputDirectory></outputDirectory -->
    <!-- not required?? -->
    <!-- Set to true to exclude all transitive dependencies. Default is
        false. -->
    <excludeTransitive>false</excludeTransitive>
    <!-- The path where the libraries are stored within the jnlp structure.
        not required. by default the libraries are within the working directory -->
    <libPath>lib</libPath>
    <!-- resourcesDirectory>${project.basedir}/src/main/jnlp/resources</resourcesDirectory -->
    <!-- default value -->
    <!-- JNLP generation -->
    <jnlp>
        <!-- default values -->
        <!-- inputTemplateResourcePath>${project.basedir}</inputTemplateResourcePath -->
        <!--inputTemplate>src/main/jnlp/template.vm</inputTemplate -->
        <!-- relative to inputTemplateResourcePath -->
        <outputFile>xxxx.template</outputFile>
        <!-- defaults to launch.jnlp -->
        <!-- used to automatically identify the jar containing the main class. -->
        <!-- this is perhaps going to change -->
        <mainClass>XXXXXX</mainClass>
    </jnlp>
    <!-- SIGNING -->
    <!-- defining this will automatically sign the jar and its dependencies,
        if necessary -->
    <sign>
        ..................
    </sign>
    <!-- BUILDING PROCESS -->
    <pack200>
        <enabled>false</enabled>
    </pack200>
    <gzip>true</gzip>
    <!-- default force when pack200 false, true when pack200 selected
        ?? -->
    <!-- causes a version attribute to be output in each jar resource
        element, optional, default is false -->
    <outputJarVersions>true</outputJarVersions>
    <!--install>false</install -->
    <!-- not yet supported -->
    <verbose>true</verbose>
    <updateManifestEntries>
        <Application-Name>cccccc</Application-Name>
        <Trusted-Library>true</Trusted-Library>
        <Permissions>all-permissions</Permissions>
        <Codebase>*</Codebase>
        <Trusted-Only>true</Trusted-Only>
    </updateManifestEntries>
</configuration>

此处

<updateManifestEntries>
<Application-Name>cccccc</Application-Name>
<Trusted-Library>true</Trusted-Library>
<Permissions>all-permissions</Permissions>
<Codebase>*</Codebase>
<Trusted-Only>true</Trusted-Only>
</updateManifestEntries>

在启动时破坏应用程序。依赖注入没有发生。我不得不添加更新的清单信息,即使是与Spring相关的jar。

breaks the application when it launches. Dependency injection not happening. I had to add updated manifest information even for Spring related jar.

我尝试用同样的方式执行

I tried doing the same with

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-jar-plugin</artifactId>
    <inherited>true</inherited>
    <configuration>
        <archive>
            <manifest>
                <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
            </manifest>
        </archive>
    </configuration>
</plugin>

但似乎没有效果。

欣赏自上周以来我一直在尝试这样做的即时回复

Appreciate your immediate reply as I have been trying this since last week

问题在于webstart-maven-plugin(1.0-beta-4)

The issue is with webstart-maven-plugin (1.0-beta-4) whose

<updateManifestEntries>
                            <!--    <Permissions>all-permissions</Permissions>
                                <Application-Name>catsvision</Application-Name>
                                <Trusted-Library>true</Trusted-Library>
                                <Codebase>*</Codebase>
                                <Trusted-Only>true</Trusted-Only>  -->
                            </updateManifestEntries>

未按预期工作。

何时我尝试使用

<plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-jar-plugin</artifactId>
                        <inherited>true</inherited>
                        <configuration>
                            <archive>
                            <addMavenDescriptor>false</addMavenDescriptor>
                            <manifestFile>
                                src/main/resources/META-INF/MANIFEST.MF
                                </manifestFile>
                                <manifest>
                                    <addDefaultImplementationEntries>false</addDefaultImplementationEntries>
                                    <addDefaultSpecificationEntries>false</addDefaultSpecificationEntries>
                                </manifest>
                            </archive>
                        </configuration>
                    </plugin>

其中MANIFEST.MF有以下条目

where MANIFEST.MF has following entry

Permissions: all-permissions
Application-Name: CATS Vision
Codebase: *
Trusted-Library: true
Trusted-Only: true

为我工作。但这是针对特定的JAR。如何更新一组JAR的清单条目(我的意思是我的webstart包)?是否有任何插件除了maven-webstart-plugin

worked for me. But it was for a particular JAR. How can I update manifest entries for a bundle of JARs (I mean my webstart bundle)? Is there any plugin for it other than maven-webstart-plugin

推荐答案

这似乎是maven-webstart-plugin的一个漏洞

This seems an open bug with maven-webstart-plugin

我解决了这个问题:


  1. 使用maven-antrun-plugin更新权限属性

  2. 使用maven-jarsigner-plugin签名JARS

  3. 使用maven-webstart-plugin只是为了创建JNLP包,不用于签名或其他任何内容

这篇关于新的&lt; updateManifestEntries&gt; webstart-maven-plugin的条目打破了应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-15 20:51