Метод настройки не вызывается в Springboot 3.0.9. Проблема во время миграции.
Я перехожу с Springboot 2.7.7 на Springboot 3.0.9. Я использовал openrewrite, чтобы внести изменения в пакет. Приложение не работает после обновления 3.0.9. Я создаю файл войны и вручную развертываю его в Tomcat. Я могу отладить то, что метод configure() в основном классе не вызывается.
У этого также есть подпроекты. Pom.xml ниже является основным pom.
DoceditApplication.java
@SpringBootApplication(scanBasePackages = {
"be.schaubroeck.docedit",
"be.schaubroeck.esse.docedit"
})
@EnableScheduling
public class DoceditApplication extends SpringBootServletInitializer
{
@Bean
public MethodValidationPostProcessor methodValidationPostProcessor()
{
return new MethodValidationPostProcessor();
}
public static void main(String[] args)
{
SpringApplication.run(DoceditApplication.class, args);
}
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder builder)
{
return builder.sources(DoceditApplication.class);
}
@Bean
public ServletRegistrationBean restApiV1Jersey()
{
ServletRegistrationBean v1Jersey = new ServletRegistrationBean(new ServletContainer(new JerseyConfig()));
v1Jersey.addUrlMappings("/v1/api/*");
v1Jersey.setName("Rest API V1");
v1Jersey.setLoadOnStartup(0);
return v1Jersey;
}
}
пом.xml:
<modelVersion>4.0.0</modelVersion>
<groupId>be.schaubroeck.docedit</groupId>
<artifactId>docedit-boot</artifactId>
<version>1.2.0-SNAPSHOT</version>
<packaging>war</packaging>
<name>docedit-boot</name>
<description>Spring Boot app
</description>
<parent>
<groupId>be.schaubroeck.docedit</groupId>
<artifactId>docedit-all</artifactId>
<version>1.2.0-SNAPSHOT</version>
</parent>
<dependencies>
<dependency>
<groupId>be.schaubroeck.docedit</groupId>
<artifactId>docedit-rest-api</artifactId>
</dependency>
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-jersey2-jaxrs</artifactId>
</dependency>
<dependency>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-multipart</artifactId>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
</dependency>
<dependency>
<groupId>org.mapstruct</groupId>
<artifactId>mapstruct</artifactId>
<version>1.5.5.Final</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
</dependency>
<dependency>
<groupId>de.codecentric</groupId>
<artifactId>spring-boot-admin-starter-client</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<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>com.github.lookfirst</groupId>
<artifactId>sardine</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.jaxrs</groupId>
<artifactId>jackson-jaxrs-json-provider</artifactId>
<version>2.8.8</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>be.schaubroeck.esse</groupId>
<artifactId>docedit-client</artifactId>
<version>2.0.0-A.3</version>
<exclusions>
<exclusion>
<artifactId>atlas-compat-hib36-spring25</artifactId>
<groupId>be.schaubroeck.atlas</groupId>
</exclusion>
<exclusion>
<artifactId>atlas-config</artifactId>
<groupId>be.schaubroeck.atlas</groupId>
</exclusion>
<exclusion>
<artifactId>icu4j</artifactId>
<groupId>com.ibm.icu</groupId>
</exclusion>
<exclusion>
<artifactId>stax-api</artifactId>
<groupId>stax</groupId>
</exclusion>
<exclusion>
<artifactId>xmlbeans</artifactId>
<groupId>org.apache.xmlbeans</groupId>
</exclusion>
<exclusion>
<artifactId>servlet-api</artifactId>
<groupId>javax.servlet</groupId>
</exclusion>
<exclusion>
<artifactId>jcl-over-slf4j</artifactId>
<groupId>org.slf4j</groupId>
</exclusion>
<exclusion>
<artifactId>log4j</artifactId>
<groupId>log4j</groupId>
</exclusion>
<exclusion>
<artifactId>slf4j-api</artifactId>
<groupId>org.slf4j</groupId>
</exclusion>
<exclusion>
<artifactId>slf4j-log4j12</artifactId>
<groupId>org.slf4j</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<version>2.1.18.RELEASE</version>
<optional>true</optional>
</dependency>
</dependencies>
<build>
<finalName>${project.runnable.name}</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<executable>true</executable>
<requiresUnpack>
<dependency>
<groupId>be.schaubroeck.docedit</groupId>
<artifactId>docedit-rest-api</artifactId>
</dependency>
</requiresUnpack>
<embeddedLaunchScriptProperties>
<initInfoChkconfig>2345 92 08</initInfoChkconfig>
</embeddedLaunchScriptProperties>
</configuration>
</plugin>
<plugin>
<groupId>org.bsc.maven</groupId>
<artifactId>maven-processor-plugin</artifactId>
<version>2.2.4</version>
<configuration>
<defaultOutputDirectory>
${project.build.directory}/generated-sources
</defaultOutputDirectory>
<processors>
<processor>org.mapstruct.ap.MappingProcessor</processor>
</processors>
</configuration>
<executions>
<execution>
<id>process</id>
<phase>generate-sources</phase>
<goals>
<goal>process</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.mapstruct</groupId>
<artifactId>mapstruct-processor</artifactId>
<version>1.5.5.Final</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>1.10.4</version>
<executions>
<execution>
<id>install node and npm</id>
<goals>
<goal>install-node-and-npm</goal>
</goals>
<phase>generate-sources</phase>
</execution>
<execution>
<id>npm install</id>
<goals>
<goal>npm</goal>
</goals>
<phase>generate-sources</phase>
<configuration>
<arguments>install</arguments>
</configuration>
</execution>
<execution>
<id>bower uninstall checkpoint-ria</id>
<goals>
<goal>bower</goal>
</goals>
<phase>generate-sources</phase>
<configuration>
<arguments>uninstall checkpoint-ria --no-color --allow-root</arguments>
</configuration>
</execution>
<execution>
<id>bower update</id>
<goals>
<goal>bower</goal>
</goals>
<phase>generate-sources</phase>
<configuration>
<arguments>update --no-color --allow-root</arguments>
</configuration>
</execution>
<execution>
<id>grunt build</id>
<goals>
<goal>grunt</goal>
</goals>
<phase>process-classes</phase>
<configuration>
<arguments>build</arguments>
</configuration>
</execution>
</executions>
<configuration>
<nodeVersion>v10.23.0</nodeVersion>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.8</version>
<executions>
<execution>
<id>generateVersionJs</id>
<phase>generate-sources</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<property name="src.dir" value="${basedir}/src/main/webapp/" />
<property name="app.name" value="doceditApp" />
<copy file="${src.dir}/version_tpl.js" tofile="${src.dir}/version.js" overwrite="true" />
<replace file="${src.dir}/version.js" token="@appname@" value="${app.name}" />
<replace file="${src.dir}/version.js" token="@version@" value="${version}" />
<replace file="${src.dir}/version.js" token="@buildtime@" value="${maven.build.timestamp}" />
<echo message="version.js aangemaakt voor ${version}" />
</target>
</configuration>
</execution>
<execution>
<id>uitvoerenGrunt</id>
<phase>prepare-package</phase>
<configuration>
<target>
<taskdef resource="net/sf/antcontrib/antcontrib.properties" classpathref="maven.plugin.classpath" />
<if>
<available file="dist" />
<then>
<echo message="Distro available !" />
<copy todir="target/dist">
<fileset dir="dist" />
</copy>
</then>
<else>
<echo message="Distro not available, using source..." />
<copy todir="target/dist">
<fileset dir="app" />
</copy>
</else>
</if>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>ant-contrib</groupId>
<artifactId>ant-contrib</artifactId>
<version>20020829</version>
</dependency>
<dependency>
<groupId>org.apache.ant</groupId>
<artifactId>ant</artifactId>
<version>1.8.4</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</project>