通过Maven生成单个jar文件时,现有库需要Java文件

通过Maven生成单个jar文件时,现有库需要Java文件,java,maven,Java,Maven,我通过install命令将toaster库添加到maven项目中,如下所示 mvn install:install-file -Dfile=./jtoaster-1.0.5.jar -DgroupId=com.jtoaster -DartifactId=jtoaster -Dversion=1.0.5 -Dpackaging=jar 它在projectpom.xml文件中的依赖项定义 <dependency> <groupId>com.jtoaster</gr

我通过install命令将toaster库添加到maven项目中,如下所示

mvn install:install-file -Dfile=./jtoaster-1.0.5.jar -DgroupId=com.jtoaster -DartifactId=jtoaster -Dversion=1.0.5 -Dpackaging=jar
它在projectpom.xml文件中的依赖项定义

<dependency>
  <groupId>com.jtoaster</groupId>
  <artifactId>jtoaster</artifactId>
  <version>1.0.5</version>
</dependency>

maven搜索了toasted.java文件(不是类文件,在jar库中,只有类文件存在)。我怎样才能解决这个问题

我没有通过mvn安装,而是通过在依赖项定义中显示本地jar文件的路径来添加本地jar文件。我将jar文件的依赖项定义添加到pom.xml中,如下所示

<dependency>
    <groupId>com.nitido</groupId>
    <artifactId>jtoaster</artifactId>
    <version>1.0.5</version>
    <scope>system</scope>
    <systemPath>D:\javalibraries\jtoaster\jtoaster-1.0.5.jar</systemPath>
</dependency>

com.nitido
jtoaster
1.0.5
系统
D:\javalibraries\jtoaster\jtoaster-1.0.5.jar
我用这种方法解决了我的问题

<dependency>
    <groupId>com.nitido</groupId>
    <artifactId>jtoaster</artifactId>
    <version>1.0.5</version>
    <scope>system</scope>
    <systemPath>D:\javalibraries\jtoaster\jtoaster-1.0.5.jar</systemPath>
</dependency>