无法安装maven

时间:2017-07-19 17:21:49

标签: java eclipse maven spring-boot jar

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

[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.

1 个答案:

答案 0 :(得分:0)

你可以上传SpringBoot项目的pom.xml吗?以下是示例。还要确保自定义jar位于本地maven存储库中。

Project a 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>

Project B pom.xml(添加本地回购信息并在依赖部分中包含项目A)

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

              项目A信息