Maven Archiver putting in weird line breaks in classpath for manifest

前端 未结 2 1427
眼角桃花
眼角桃花 2021-01-17 18:13

Per the java spec the classpath line in the manifest.mf for a jar can only be a certain number of bytes. After that a line break is inserted and the new line begins with an

相关标签:
2条回答
  • 2021-01-17 18:16

    I was struggling ~8 hours. Plexus archiver always repacks/restructures your MANIFEST file if even you specify custom one. Line breaks are always added (72 chars limitation) There is no way to change this behaviour plexus archiver code I found the following workaround. I started using truezip-maven-plugin to update generated ear:

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>truezip-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>replace-broken-manifest</id>
                        <goals>
                            <goal>copy</goal>
                        </goals>
                        <phase>package</phase>
                        <configuration>
                          <files>
                            <file>
                              <source>src/main/resources/META-INF/MANIFEST.MF</source>
                              <outputDirectory>${project.build.directory}/${project.build.finalName}.${project.packaging}/META-INF</outputDirectory>
                            </file>
                          </files>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
    
    0 讨论(0)
  • 2021-01-17 18:41

    This is in line with the specification for Java manifest files. Note the line length is 72 characters, and if it exceeds that it is meant to wrap at that point.

    0 讨论(0)
提交回复
热议问题