Maven打包本地jar包导不进去,报错should not point at files within the project directory

Maven打包本地jar包导不进去,报错should not point at files within the project directory

原始方法

	<dependencies>
		<dependency>
			<groupId>com.suninggroupId>
			<artifactId>suning-payartifactId>
			<version>1.0.0version>
			<scope>systemscope>
			<systemPath>${project.basedir}/src/main/resources/lib/suning-pay.jarsystemPath>
		dependency>
	dependencies>
	<build>
		<resources>
			<resource>
				<directory>libdirectory>
				<targetPath>/BOOT-INF/lib/targetPath>
				<includes>
					<include>**/*.jarinclude>
				includes>
			resource>
		resources>
    build>

但是在进行package打包后发现jar包里并没有导入所需要的依赖包。

解决方法

在clean时将本地依赖安装进本地仓库,然后再进行重新打包就可以导入。

	<dependencies>
		<dependency>
			<groupId>com.suninggroupId>
			<artifactId>suning-payartifactId>
			<version>1.0.0version>
		dependency>
	dependencies>
	<build>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.pluginsgroupId>
				<artifactId>maven-install-pluginartifactId>
				<version>2.5.2version>
				<executions>
					<execution>
						<id>install-suning-modelid>
						<phase>cleanphase>
						<configuration>
							<file>${basedir}/src/main/resources/lib/sunig-pay.jarfile>
							<repositoryLayout>defaultrepositoryLayout>
							<groupId>com.suninggroupId>
							<artifactId>suning-payartifactId>
							<version>1.0.0version>
							<packaging>jarpackaging>
							<generatePom>truegeneratePom>
						configuration>
						<goals>
							<goal>install-filegoal>
						goals>
					execution>
				executions>
			plugin>
		plugins>
	build>

你可能感兴趣的:(错误异常,maven,jar,bug,java)