5

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.

Pacman
  • 568
  • 3
  • 6
  • 17
  • Can you try deleting the directory of projectB in your local maven repository and doing a new clean install of B (and then A)? – Geoffrey De Vylder Jan 03 '17 at 15:19
  • 4
    Are you using Spring Boot 1.4? Does `projectB` uses the spring-boot repackage goal? If both of these questions are true -> http://docs.spring.io/spring-boot/docs/current/maven-plugin/examples/repackage-classifier.html – Stephane Nicoll Jan 03 '17 at 15:20

1 Answers1

8

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.

Pacman
  • 568
  • 3
  • 6
  • 17
  • i have same issue. after adding the plugin, i always have a compilation error. Please check my issue: http://stackoverflow.com/questions/41364697/mvn-compilation-error-error-reading-jar-error-in-opening-zip-file – emoleumassi Jan 06 '17 at 13:44
  • Hi, please mark this as true answer, I've tried your solutions and it worked! – Sal Prima Apr 18 '17 at 09:55