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

NB打包成fatjar的缺陷 #303

Open
juqkai opened this issue May 11, 2024 · 0 comments
Open

NB打包成fatjar的缺陷 #303

juqkai opened this issue May 11, 2024 · 0 comments

Comments

@juqkai
Copy link
Member

juqkai commented May 11, 2024

在NbApp中有以下代码:
Enumeration _en = ctx.getClassLoader().getResources("META-INF/nutz/org.nutz.boot.starter.NbStarter");
会默认读取每个JAR包里面的【META-INF/nutz/org.nutz.boot.starter.NbStarter】文件。
当项目被打包成单一jar时,会导致【META-INF/nutz/org.nutz.boot.starter.NbStarter】被覆盖,从而导致只有一个starter会被加载,其它starter都会丢失。

<plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-assembly-plugin</artifactId>
                <configuration>
                    <finalName>${project.name}</finalName>
                    <appendAssemblyId>false</appendAssemblyId>
                    <descriptorRefs>
                        <descriptorRef>jar-with-dependencies</descriptorRef>
                    </descriptorRefs>
                    <archive>
                        <manifest>
                            <mainClass>webapp.HelloApp</mainClass>
                        </manifest>
                    </archive>
                </configuration>
                <executions>
                    <execution>
                        <id>make-assembly</id>
                        <phase>package</phase>
                        <goals>
                            <goal>single</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
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