Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build.bat 打包 没有主清单属性 #5319

Open
123456ZYF88 opened this issue Jan 21, 2025 · 1 comment
Open

build.bat 打包 没有主清单属性 #5319

123456ZYF88 opened this issue Jan 21, 2025 · 1 comment

Comments

@123456ZYF88
Copy link

2.2.0版本使用 build.bat 或者build.sh打包都没有主清单属性,我后面手动在jar包里面加入主类好同样显示这个问题,

Copy link

dosubot bot commented Jan 21, 2025

Hello, @123456ZYF88! I'm here to help you with any bugs, questions, or contributions you have. If you need assistance, feel free to ask.

在 Apollo 项目的 2.2.0 版本中,MANIFEST.MF 文件的生成可能与 maven-jar-plugin 的配置有关。该插件在构建过程中负责生成 MANIFEST.MF 文件,并添加默认的实现和规范条目。以下是相关的配置片段:

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

如果在使用 build.batbuild.sh 打包时没有生成主清单属性,可能需要检查 pom.xml 文件中是否正确配置了 maven-jar-plugin,并确保 Main-Class 属性在构建过程中被正确设置。你可以在 pom.xml 中的 <manifestEntries> 中手动添加 Main-Class 属性来解决这个问题。

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant