【问题标题】:Maven can't find a packagemaven找不到包
【发布时间】:2021-02-14 15:17:52
【问题描述】:

我创建了一个job talend,然后我将它导出为一个jar。

添加了该类的 jar。 (构建=>构建配置=>库=>添加外部jar) 但是,当我尝试构建项目时,我得到了这些错误:

package demo.kosecleaninfileuploading_0_1 does not exist
package demo.kosecleaninfileuploading_0_1.contexts does not exist

我错过了什么? (我正在使用 eclipse,Jhipster(Spring-boot))

谢谢!

【问题讨论】:

  • 你在构建spring boot项目并想添加外部jar。
  • 是的,就是这样,你知道我错过了什么吗?

标签: java spring-boot maven jhipster talend


【解决方案1】:

请在 pom.xml 中添加您的外部 jar 作为依赖项

    <dependency>
       <groupId>"external-jar-group-id"</groupId>
       <artifactId>"external-jar-artifact-id"</artifactId>
       <version>"external jar version"</version>
       <scope>system</scope>
       <systemPath>${basedir}/lib/"external_jar_file_name.jar"</systemPath>
    </dependency>

并通过添加将其包含在系统范围内

     <plugin>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-maven-plugin</artifactId>
        <configuration>
        <includeSystemScope>true</includeSystemScope>
        </configuration>
     </plugin>

【讨论】:

  • 您好,感谢您的帮助。我有一个愚蠢的小问题,我如何知道自定义 jar 中的 groupId 和 artifactId?
  • 给个名字试试看,把它放在正确的lib文件夹里。
  • 正确的 li 文件夹是什么意思?我把jar文件的路径?我试过 => freeming.kosecleaningkosecleaning1.0systemC:\Users\FMC_08 \Desktop\tmp\KoseCleaninFileUploading\kosecleaninfileuploading_0_1.jar
猜你喜欢
  • 2020-12-30
  • 2019-02-20
  • 1970-01-01
  • 1970-01-01
  • 2020-10-04
  • 2010-11-29
  • 1970-01-01
  • 1970-01-01
  • 2019-04-10
相关资源
最近更新 更多