Skip to content

Commit

Permalink
Merge pull request #296 from apache/single-spring-1-8
Browse files Browse the repository at this point in the history
Back port single spring boot module to 1.x
  • Loading branch information
bdemers committed May 27, 2021
2 parents 358397b + 9f8e5c6 commit 1447e43
Show file tree
Hide file tree
Showing 18 changed files with 94 additions and 128 deletions.
5 changes: 5 additions & 0 deletions pom.xml
Expand Up @@ -1172,6 +1172,11 @@
<artifactId>spring-boot-test</artifactId>
<version>${spring-boot.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>${spring-boot.version}</version>
</dependency>

<!-- Guice -->
<dependency>
Expand Down
37 changes: 37 additions & 0 deletions support/spring-boot/spring-boot-starter/pom.xml
Expand Up @@ -44,6 +44,16 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-autoconfigure</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
Expand Down Expand Up @@ -76,4 +86,31 @@

</dependencies>

<build>
<plugins>
<plugin>
<groupId>com.github.siom79.japicmp</groupId>
<artifactId>japicmp-maven-plugin</artifactId>
<executions>
<execution>
<id>single-boot-jar</id>
<goals>
<goal>cmp</goal>
</goals>
<configuration>
<oldVersion>
<dependency>
<!-- This project was moved into another jar -->
<groupId>${project.groupId}</groupId>
<artifactId>shiro-spring-boot-web-starter</artifactId>
<version>${shiro.previousVersion}</version>
<type>jar</type>
</dependency>
</oldVersion>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Expand Up @@ -41,6 +41,7 @@
import org.springframework.boot.autoconfigure.AutoConfigureBefore;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

Expand All @@ -50,6 +51,7 @@
@Configuration
@AutoConfigureBefore(ShiroAutoConfiguration.class)
@AutoConfigureAfter(ShiroWebMvcAutoConfiguration.class)
@ConditionalOnWebApplication(type = ConditionalOnWebApplication.Type.SERVLET)
@ConditionalOnProperty(name = "shiro.web.enabled", matchIfMissing = true)
public class ShiroWebAutoConfiguration extends AbstractShiroWebConfiguration {

Expand Down
Expand Up @@ -24,6 +24,7 @@
import org.apache.shiro.web.servlet.AbstractShiroFilter;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
Expand All @@ -34,6 +35,7 @@
* @since 1.4.0
*/
@Configuration
@ConditionalOnWebApplication(type = ConditionalOnWebApplication.Type.SERVLET)
@ConditionalOnProperty(name = "shiro.web.enabled", matchIfMissing = true)
public class ShiroWebFilterConfiguration extends AbstractShiroWebFilterConfiguration {

Expand Down
Expand Up @@ -21,12 +21,14 @@
import org.apache.shiro.spring.web.config.ShiroRequestMappingConfig;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping;

@Configuration
@ConditionalOnClass(RequestMappingHandlerMapping.class)
@Import(ShiroRequestMappingConfig.class)
@ConditionalOnWebApplication(type = ConditionalOnWebApplication.Type.SERVLET)
@ConditionalOnProperty(name = "shiro.web.enabled", matchIfMissing = true)
public class ShiroWebMvcAutoConfiguration { }
Expand Up @@ -11,6 +11,42 @@
"type": "java.lang.Boolean",
"description": "A boolean flag that can disable all Shiro Spring Boot starters. This is mostly useful during testing or debugging, or if you want to compare behavior when Shiro is enabled or disabled.",
"defaultValue": true
},
{
"name": "shiro.web.enabled",
"type": "java.lang.Boolean",
"description": "A boolean flag that can disable all Shiro Spring Boot starters. This is mostly useful during testing or debugging, or if you want to compare behavior when Shiro is enabled or disabled.",
"defaultValue": true
},
{
"name": "shiro.loginUrl",
"type": "java.lang.String",
"description": "The application's login URL to be assigned to all acquired Filters that subclass AccessControlFilter or 'null' if no value should be assigned globally.",
"defaultValue": "/login.jsp"
},
{
"name": "shiro.successUrl",
"type": "java.lang.String",
"description": "The application's after-login success URL to be assigned to all acquired Filters that subclass AuthenticationFilter or null if no value should be assigned globally.",
"defaultValue": "/"
},
{
"name": "shiro.unauthorizedUrl",
"type": "java.lang.String",
"description": "The application's 'unauthorized' URL to apply to as a convenience to all discovered AuthorizationFilter instances.",
"defaultValue": null
},
{
"name": "shiro.sessionManager.sessionIdCookieEnabled",
"type": "java.lang.String",
"description": "Enable or disable session tracking via a cookie.",
"defaultValue": true
},
{
"name": "shiro.sessionManager.sessionIdUrlRewritingEnabled",
"type": "java.lang.String",
"description": "Enable or disable session tracking via a URL parameter. If your site requires cookies, it is recommended you disable this.",
"defaultValue": true
}
]
}
@@ -1,4 +1,7 @@
org.springframework.boot.autoconfigure.EnableAutoConfiguration = \
org.apache.shiro.spring.config.web.autoconfigure.ShiroWebAutoConfiguration,\
org.apache.shiro.spring.config.web.autoconfigure.ShiroWebFilterConfiguration,\
org.apache.shiro.spring.config.web.autoconfigure.ShiroWebMvcAutoConfiguration,\
org.apache.shiro.spring.boot.autoconfigure.ShiroBeanAutoConfiguration,\
org.apache.shiro.spring.boot.autoconfigure.ShiroAutoConfiguration,\
org.apache.shiro.spring.boot.autoconfigure.ShiroAnnotationProcessorAutoConfiguration
Expand Down
@@ -1 +1 @@
provides: shiro
provides: shiro,shiro-web
25 changes: 6 additions & 19 deletions support/spring-boot/spring-boot-web-starter/pom.xml
Expand Up @@ -31,6 +31,12 @@

<artifactId>shiro-spring-boot-web-starter</artifactId>
<name>Apache Shiro :: Support :: Spring Boot Web</name>
<description>Deprecated, these classes were moved to shiro-spring-boot-starter</description>

<properties>
<!-- japicmp config was moved into the combine 'shiro-spring-boot-starter' module -->
<japicmp.skip>true</japicmp.skip>
</properties>

<dependencies>

Expand Down Expand Up @@ -60,29 +66,10 @@
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
<version>${spring-boot.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>${spring-boot.version}</version>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>

</dependencies>
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit 1447e43

Please sign in to comment.