1
Failed to install artifact: C:\Test\7\config\analyzers\analyzers-7.0.0-13-SNAPSHOT-jar-with-dependencies.jar: org.osgi.framework.BundleException: The bundle file:/C:/Test/7/config/analyzers/analyzers-7.0.0-13-SNAPSHOT-jar-with-dependencies.jar does not have a META-INF/MANIFEST.MF! Make sure, META-INF and MANIFEST.MF are the first 2 entries in your JAR!
org.osgi.framework.BundleException: The bundle file:/C:/Palamida/7.0-v4/config/analyzers/analyzers-7.0.0-13-SNAPSHOT-jar-with-dependencies.jar does not have a META-INF/MANIFEST.MF! Make sure, META-INF and MANIFEST.MF are the first 2 entries in your JAR!
at org.apache.felix.fileinstall.internal.DirectoryWatcher.installOrUpdateBundle(DirectoryWatcher.java:1004)
at org.apache.felix.fileinstall.internal.DirectoryWatcher.install(DirectoryWatcher.java:952)
at org.apache.felix.fileinstall.internal.DirectoryWatcher.install(DirectoryWatcher.java:871)
at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:485)
at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:361)
at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:312)

错误的第一部分声称没有MANIFEST.MF,但手动检查显示它在那里。错误的第二部分声称这MANIFEST.MF不是我无法验证的 jar 中的第一个两个条目之一。我的程序集插件是否存在配置问题?

pom.xml包含我的 maven-assembly-plugin 配置:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-assembly-plugin</artifactId>
    <version>2.6</version>
    <configuration>
      <descriptorRefs>
        <descriptorRef>jar-with-dependencies</descriptorRef>
      </descriptorRefs>           
      <archive>
        <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>          
      </archive>
    </configuration>
    <executions>
      <execution>
        <phase>package</phase>
        <goals>
          <goal>single</goal>
        </goals>
      </execution>
    </executions>
</plugin>

我也在使用带有 manifest 目标的 maven-bundle-plugin,它输出一个 manifest.mf,它由 assembly-plugin 使用,但我不认为这会造成任何干扰。

4

1 回答 1

0
<plugin>
            <artifactId>maven-assembly-plugin</artifactId>
            <version>3.1.1</version>
            <configuration>
                <finalName>${name.project}</finalName>
                <archive>
                    <manifest>
                        <mainClass>br.com.car.view</mainClass>
                    </manifest>
                    <manifestFile>${basedir}/META-INF/MANIFEST.MF</manifestFile>
                </archive>
                <descriptorRefs>
                    <descriptorRef>jar-with-dependencies</descriptorRef>
                </descriptorRefs>
                <appendAssemblyId>false</appendAssemblyId>
            </configuration>
            <executions>
                <execution>
                    <id>make-assembly</id>
                    <phase>package</phase>
                    <goals>
                        <goal>single</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>

在 maven (pom) 配置文件中使用清单命令文件的方法

于 2019-01-22T13:41:01.740 回答