2017-07-19 133 views
0

我已经使用Eclipse IDE从我的Java项目创建了一个jar。 然后我已经将该jar添加到我的spring boot maven项目的构建路径中。 当我试图maven干净和添加我的自定义jar后安装,我无法成功运行maven安装。 我收到以下错误,无法安装maven installer

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project springBootExample: Compilation failure: Compilation failure: 
[ERROR] error reading C:\Users\VAIBHAV-PC\.m2\repository\org\hsqldb\hsqldb\2.3.3\hsqldb-2.3.3.jar; invalid LOC header (bad signature) 
[ERROR] /D:springBootExample/src/main/java/com/springBootExample/service/impl/UserServiceImpl.java:[9,29] package com.ResponceGenerator does not exist 
[ERROR] -> [Help 1] 
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. 
[ERROR] Re-run Maven using the -X switch to enable full debug logging. 
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles: 
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException. 
+0

这似乎是相关的:[错误]错误读取C:\ Users \ VAIBHAV-P C.m2 \库\组织\ HSQLDB \ HSQLDB \ 2.3.3 \ HSQLDB-2.3.3.jar;无效的LOC标头(错误签名)[错误]。按照错误消息运行并打开-X开关。你会得到更多的信息。我觉得Maven找到了。这是您当地的.m2回购有问题。 – duffymo

+0

删除'C:\ Users \ VAIBHAV-PC.m2 \ repository \ org \ hsqldb \ hsqldb \ 2.3.3'文件夹并重试。 – talex

+0

'VAIBHAV-PC.m2'看起来很奇怪。可能是错误的Maven仓库文件夹设置。你如何调用maven?同时检查'settings.xml'。 – talex

回答

0

你可以上传SpringBoot项目的pom.xml?下面是例子。还要确保自定义jar在你的本地maven仓库中。

项目一个pom.xml(添加下面的插件)

<plugin> 
       <groupId>org.springframework.boot</groupId> 
       <artifactId>spring-boot-maven-plugin</artifactId> 
       <version>1.4.1.RELEASE</version> 
       <executions> 
        <execution> 
         <goals> 
          <goal>repackage</goal> 
         </goals> 
         <configuration> 
          <classifier>exec</classifier> 
         </configuration> 
        </execution> 
       </executions> 
      </plugin> 

项目B的pom.xml(添加本地的回购信息,包括A计划下的依赖性节)

<repositories> 
    <repository> 
     <id>local-repo</id> 
     <url>file:${user.home}\.m2\repository</url> 
    </repository> 
</repositories> 

项目A的信息

+0

我无法附加我的pom.xml代码,因为限制字符的长度。 –

+0

我想从java项目中创建一个jar以实现某些特定的功能,所以无论何时我想再次使用该功能,我只需要将该jar添加到我的项目中。您可以从中提供一个链接,我可以从中了解更多信息。 –