When you try to run mvn install , in the Spring boot project, the assembly will fail due to:
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-jersey</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-jpa</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-security</artifactId> </dependency>
The goal of org.apache.maven.plugins failed: Maven-compiler-plugin: 3.3: compile (default compilation) on the project wave: fatal error compilation: java.lang.RuntimeException: com.sun.tools.javac.code. Symbol $ CompletionFailure: class file for org.springframework.security.ldap.DefaultSpringSecurityContextSource not found → [Help 1]
Two things solved this problem:
Removing the following security configuration
@Configuration @EnableWebSecurity public class SecurityConfig extends WebSecurityConfigurerAdapter { @Inject private UserDetailsService userDetailsService; @Inject public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception { auth .userDetailsService(userDetailsService); } @Override protected void configure(HttpSecurity http) throws Exception { http .httpBasic() .realmName("Wave") .and() .authorizeRequests() .antMatchers(HttpMethod.POST, "/wave/service/employees/**").anonymous() .antMatchers("/wave/service/**").authenticated() .and() .sessionManagement() .sessionCreationPolicy(SessionCreationPolicy.STATELESS); } }
Removing the configuration from the command line is not an option, since it disables protection from my application.
Adding the following dependency
<dependency> <groupId>org.springframework.security</groupId> <artifactId>spring-security-ldap</artifactId> </dependency>
However, adding that the error has disappeared, a new similar error has appeared (just pointing to another class):
The goal of org.apache.maven.plugins failed: Maven-compiler-plugin: 3.3: compile (default compilation) on the project wave: fatal error compilation: java.lang.RuntimeException: com.sun.tools.javac.code. Symbol $ CompletionFailure: class file for org.springframework.security.openid.OpenIDAttribute not found → [Help 1]
Eliminating this, I added the following dependency:
<dependency> <groupId>org.springframework.security</groupId> <artifactId>spring-security-openid</artifactId> </dependency>
This fixed the problem again, but another error appeared:
The goal of org.apache.maven.plugins failed: Maven-compiler-plugin: 3.3: compile (default compilation) on the project wave: fatal error compilation: java.lang.RuntimeException: com.sun.tools.javac.code. Symbol $ CompletionFailure: class file for org.apache.http.Header not found → [Help 1]
Finally, adding the following dependency, fixed all the problems:
<dependency> <groupId>org.apache.httpcomponents</groupId> <artifactId>httpclient</artifactId> <version>4.5.1</version> </dependency>
However, I now have several dependencies that I do not use.
Is there any other way to fix this problem?