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出jar后,无法正常运行 #4

Open
saxon-y opened this issue Jul 2, 2019 · 0 comments
Open

我在用源码重新build出jar后,无法正常运行 #4

saxon-y opened this issue Jul 2, 2019 · 0 comments

Comments

@saxon-y
Copy link

saxon-y commented Jul 2, 2019

我在用源码重新build出jar时,pom.xml中的配置好像并没有生效,manifest.mf文件没有class_path和主类
pom.xml中的源码:

                <plugin>
                    <artifactId>maven-jar-plugin</artifactId>
                    <configuration>
                        <archive>
                            <!--生成的jar中,不要包含pom.xml和pom.properties这两个文件-->
                            <addMavenDescriptor>false</addMavenDescriptor>

                            <manifest>
                                <!--是否要把第三方jar放到manifest的classpath中-->
                                <addClasspath>true</addClasspath>
                                <!--生成的manifest中classpath的前缀,因为要把第三方jar放到lib目录下,所以classpath的前缀是lib/-->
                                <classpathPrefix>../lib/</classpathPrefix>
                                <!--应用的main class-->
                                <mainClass>com.shinemo.mpush.alloc.Main</mainClass>
                            </manifest>
                        </archive>
                    </configuration>
                    <executions>
                        <execution>
                            <phase>package</phase>
                        </execution>
                    </executions>
                </plugin>

build出的jar中的manifest.mf文件:

    Manifest-Version: 1.0
    Archiver-Version: Plexus Archiver
    Built-By: 10243
    Created-By: Apache Maven 3.6.1
    Build-Jdk: 1.8.0_211
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