Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.5.5</version>
<version>4.0.1</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>

Expand Down Expand Up @@ -54,8 +54,8 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>17</java.version>
<apache-shiro.version>2.0.5</apache-shiro.version>
<wicket.version>10.6.0</wicket.version>
<wicketstuff.version>10.6.0</wicketstuff.version>
<wicket.version>10.8.0</wicket.version>
<wicketstuff.version>10.7.0</wicketstuff.version>
</properties>

<dependencyManagement>
Expand Down
4 changes: 2 additions & 2 deletions wicket-spring-boot-starter-example/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@
<version>4.0.6</version>
</dependency>
<dependency>
<groupId>org.liquibase</groupId>
<artifactId>liquibase-core</artifactId>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-liquibase</artifactId>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,13 @@ private Specification<Customer> filter(CustomerFilter filter) {
specs.add(CustomerSpecs.hasActive(filter.isActive()));
}

Specification<Customer> spec = null;
for (Specification<Customer> specification : specs) {
if (spec == null) {
spec = Specification.where(specification);
} else {
spec = spec.and(specification);
}
if (specs.isEmpty()) {
return (root, query, cb) -> cb.conjunction();
}

Specification<Customer> spec = specs.get(0);
for (int i = 1; i < specs.size(); i++) {
spec = spec.and(specs.get(i));
}

return spec;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.resource.loader.ClassStringResourceLoader;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.data.jpa.JpaRepositoriesAutoConfiguration;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.transaction.annotation.EnableTransactionManagement;

Expand All @@ -19,11 +16,7 @@
import com.giffing.wicket.spring.boot.starter.configuration.extensions.external.spring.security.SecureWebSession;

//TODO move to test
@SpringBootApplication(exclude = {
DataSourceAutoConfiguration.class,
JpaRepositoriesAutoConfiguration.class,
HibernateJpaAutoConfiguration.class,
})
@SpringBootApplication

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot why are exclusions removed?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The exclusions were removed because those AutoConfiguration classes no longer exist in Spring Boot 4.0:

  • DataSourceAutoConfiguration
  • JpaRepositoriesAutoConfiguration
  • HibernateJpaAutoConfiguration

These classes were reorganized/moved in Spring Boot 3.x/4.x. The test class using this configuration (WicketBaseTest) is currently @Disabled, so there's no functional impact.

If you need to re-enable this test and still want to exclude database/JPA autoconfiguration, Spring Boot 4.0 uses a modular approach where data-related autoconfiguration is in separate modules. You could either:

  1. Keep the test disabled (current state)
  2. Use @SpringBootTest(properties = {"spring.autoconfigure.exclude=...}) with the new class names if they exist
  3. Not exclude them and use @MockBean for dependencies instead

Would you like me to investigate the new equivalent exclusions for Spring Boot 4.0, or is the current state (with the test disabled) acceptable?

@ComponentScan(basePackageClasses = SpringBootWebPackageIdentifier.class)
@EnableTransactionManagement
public class WicketWebApplicationConfig extends WicketBootSecuredWebApplication {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
import org.apache.wicket.pageStore.IPageStore;
import org.apache.wicket.protocol.http.WebApplication;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.cassandra.CassandraAutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
Expand Down Expand Up @@ -37,7 +35,6 @@
@ConditionalOnProperty(prefix = DataStoreCassandraProperties.PROPERTY_PREFIX, value = "enabled", matchIfMissing = true)
@ConditionalOnClass(name = "com.datastax.driver.core.Session", value = {CassandraDataStore.class})
@EnableConfigurationProperties({DataStoreCassandraProperties.class})
@AutoConfigureAfter(CassandraAutoConfiguration.class)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot why is this removed?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The @AutoConfigureAfter(CassandraAutoConfiguration.class) annotation was removed because CassandraAutoConfiguration no longer exists in Spring Boot 4.0. This class was part of Spring Boot's autoconfiguration that was reorganized or removed in the 3.x/4.x transition.

The @AutoConfigureAfter annotation was used to ensure this configuration ran after Cassandra's autoconfiguration. Since that class is gone, the annotation had to be removed to compile. The configuration will still work - it just won't have explicit ordering relative to the (now non-existent) CassandraAutoConfiguration.

@RequiredArgsConstructor
public class DataStoreCassandraConfig implements WicketApplicationInitConfiguration {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@
import org.apache.wicket.pageStore.IPageStore;
import org.apache.wicket.protocol.http.WebApplication;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.autoconfigure.hazelcast.HazelcastAutoConfiguration;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.wicketstuff.datastores.common.SessionQuotaManagingDataStore;
import org.wicketstuff.datastores.hazelcast.HazelcastDataStore;
Expand Down Expand Up @@ -38,7 +36,6 @@
@ConditionalOnBean(HazelcastInstance.class)
@ConditionalOnClass({HazelcastInstance.class, HazelcastDataStore.class})
@EnableConfigurationProperties({DataStoreHazelcastProperties.class})
@AutoConfigureAfter(HazelcastAutoConfiguration.class)
@RequiredArgsConstructor
public class DataStoreHazelcastConfig implements WicketApplicationInitConfiguration {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@
import org.apache.wicket.pageStore.IPageStore;
import org.apache.wicket.protocol.http.WebApplication;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.wicketstuff.datastores.common.SessionQuotaManagingDataStore;
import org.wicketstuff.datastores.redis.IRedisSettings;
Expand Down Expand Up @@ -39,7 +37,6 @@
@ConditionalOnProperty(prefix = DataStoreRedisProperties.PROPERTY_PREFIX, value = "enabled", matchIfMissing = true)
@ConditionalOnClass({Jedis.class, RedisDataStore.class})
@EnableConfigurationProperties({DataStoreRedisProperties.class})
@AutoConfigureAfter(RedisAutoConfiguration.class)
@RequiredArgsConstructor
public class DataStoreRedisConfig implements WicketApplicationInitConfiguration {

Expand Down