Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dependency not found in Spring Boot project

When doing a mvn clean compile in projectA I'm getting a package does not exist compilation error. The error is refering to a package imported from projectB, which is a Spring Boot project (projectA is a regular maven project). projectB compiles nicely and the resulting jar is in my local maven repo.

projectB is included in projectA:

    <projectB.version>1.0.4-SNAPSHOT</projectB.version>

    [...]

    <dependency>
        <groupId>de.company</groupId>
        <artifactId>projectB</artifactId>
        <version>${projectB.version}</version>
    </dependency>

I already did the usual cleaning and also deleted the contents of the local repo for projectB manually.

like image 603
Pacman Avatar asked Jan 03 '17 15:01

Pacman


1 Answers

I did not use the repackage goal, but after going from

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

to

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

...it worked.

like image 85
Pacman Avatar answered Oct 19 '22 22:10

Pacman