javaeclipsemavenspring-bootjar

Can't run maven install


I had been created a jar from my Java project using Eclipse IDE. Then I have added that jar into my spring boot maven project's build path. When I am trying to maven clean and install after adding my custom jar, I'm not able to run maven install successfully. I am getting below error:

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

Solution

  • Can you upload the pom.xml of the SpringBoot Project ? Below is the example. Also make sure the custom jar is in your local maven repository.

    Project A pom.xml ( Add the below plugin)

    <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 (Add your local repo information and include Project A under dependency section)

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

    Project A Information