idea 使用jboot 项目打包,无法编译本地jar包,请问如何修改?

本地启动项目没有问题,但使用jboot文档的fatjar 打包,把项目达到一个jar中,但打包时无法编译本地引用的jar包

img


下面是pom的编码

<build>
    <resources>
        <resource>
            <directory>src/main/resources</directory>
            <includes>
                <include>**/*.*</include>
            </includes>
            <filtering>false</filtering>
        </resource>

        <resource>
            <directory>src/main/webapp</directory>
            <includes>
                <include>**/*.*</include>
            </includes>
            <filtering>false</filtering>
        </resource>
    </resources>

    <plugins>

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <configuration>
                <source>1.8</source>
                <target>1.8</target>
                <encoding>UTF-8</encoding>
                <compilerArgument>-parameters</compilerArgument>
            </configuration>
        </plugin>


        <plugin>
            <artifactId>maven-resources-plugin</artifactId>
            <executions>
                <execution>
                    <id>copy-resources</id>
                    <phase>validate</phase>
                    <goals>
                        <goal>copy-resources</goal>
                    </goals>
                    <configuration>
                        <outputDirectory>${basedir}/target/classes/webapp</outputDirectory>
                        <resources>
                            <resource>
                                <directory>${basedir}/src/main/webapp</directory>
                            </resource>
                        </resources>
                    </configuration>
                </execution>
            </executions>
        </plugin>


        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-assembly-plugin</artifactId>
            <version>3.1.0</version>
            <executions>
                <execution>
                    <id>make-assembly</id>
                    <phase>package</phase>
                    <goals>
                        <goal>single</goal>
                    </goals>
                    <configuration>
                        <archive>
                            <manifest>
                                <mainClass>io.jboot.app.JbootApplication</mainClass>
<!--                                如果该服务只提供 RPC 服务,不提供 WEB 服务,使用下方的配置启动速度更快,占用资源更少-->
<!--                                <mainClass>io.jboot.app.JbootSimpleApplication</mainClass>-->
                            </manifest>
                        </archive>
                        <descriptorRefs>
                            <descriptorRef>jar-with-dependencies</descriptorRef>
                        </descriptorRefs>
                    </configuration>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>


请问idea,jboot项目怎么把本地jar包也进行打包编译

把本地的jar包,放在pom文件里面不可以吗?然后再重新打包一下。建好文件夹,然后把jar包放在文件夹里面,然后在pom里面引入一下。看看行不行呢?

这种是项目打包时未将lib下面的jar包打包进工程中,因为你的引用方式是system系统引入,这种情况在maven的管理下只支持在工具中使用(idea工具启动正常),所以启动不了。这里也是因为lib下面的包没有被maven管理起来,因为你打包的工具是maven,所以在这一步无法通过。想要用maven管理起来需要用maven命令把包加入本地maven仓库即可。
参考命令:mvn install:install-file -Dfile=jar包的位置(参数一) -DgroupId=groupId(参数二) -DartifactId=artifactId(参数三) -Dversion=version(参数四) -Dpackaging=jar
例子:mvn install:install-file -Dfile="D:\Program Files\mvn\ojdbc-10.2.0.4.0.jar" -DgroupId=com.oracle -DartifactId=ojdbc14 -Dversion=10.2.0.4.0 -Dpackaging=jar