Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(Weld) Weld should autodetect beans and inject them into the resources #30360

Closed
wants to merge 1 commit into from
Closed
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
14 changes: 4 additions & 10 deletions bom/application/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1151,19 +1151,13 @@
<dependency>
<groupId>org.jboss.weld.servlet</groupId>
<artifactId>weld-servlet-shaded</artifactId>
<version>3.1.9.Final</version>
</dependency>

<dependency>
<groupId>org.glassfish.hk2.external</groupId>
<artifactId>bean-validator</artifactId>
<version>2.5.0-b06</version>
<version>3.0.0.Final</version>
</dependency>

<dependency>
<groupId>org.glassfish.hk2</groupId>
<artifactId>hk2-locator</artifactId>
<version>2.5.0</version>
<groupId>org.glassfish.jersey.inject</groupId>
<artifactId>jersey-cdi2-se</artifactId>
<version>2.34</version>
</dependency>

<dependency>
Expand Down
13 changes: 4 additions & 9 deletions dotCMS/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1402,18 +1402,13 @@
<dependency>
<groupId>org.jboss.weld.servlet</groupId>
<artifactId>weld-servlet-shaded</artifactId>
<version>3.1.9.Final</version>
<version>3.0.0.Final</version>
</dependency>

<dependency>
<groupId>org.glassfish.hk2.external</groupId>
<artifactId>bean-validator</artifactId>
<version>2.5.0-b06</version>
</dependency>

<dependency>
<groupId>org.glassfish.hk2</groupId>
<artifactId>hk2-locator</artifactId>
<groupId>org.glassfish.jersey.inject</groupId>
<artifactId>jersey-cdi2-se</artifactId>
<version>2.34</version>
</dependency>

<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ protected AuthenticationResource(final LoginServiceAPI loginService,
@ApiResponse(responseCode = "500", description = "Unexpected error")
}
)
public final Response authentication(
public Response authentication(
@Context final HttpServletRequest request,
@Context final HttpServletResponse response,
@RequestBody(description = "This method takes a user's credentials and language preferences to authenticate them.\n\n" +
Expand Down Expand Up @@ -230,7 +230,7 @@ public final Response authentication(
@ApiResponse(responseCode = "404", description = "User not found")
})
@Path("logInUser")
public final Response getLoginUser(@Context final HttpServletRequest request){
public Response getLoginUser(@Context final HttpServletRequest request){
Response res = null;

try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public AppContextInitResource(AppConfigurationHelper helper) {
@AccessControlAllowOrigin
@InitRequestRequired
@Produces({ MediaType.APPLICATION_JSON, "application/javascript" })
public final Response list(@Context final HttpServletRequest request) {
public Response list(@Context final HttpServletRequest request) {
try {
final Object configData = this.helper.getConfigurationData(request);
// Return all configuration parameters in one response
Expand Down
11 changes: 9 additions & 2 deletions dotCMS/src/main/webapp/WEB-INF/beans.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:weld="http://xmlns.jcp.org/xml/ns/javaee"
xsi:schemaLocation="
http://xmlns.jcp.org/xml/ns/javaee
http://xmlns.jcp.org/xml/ns/javaee/beans_2_0.xsd"
version="2.0" bean-discovery-mode="annotated">

<scan>
<exclude name="org.apache.**"/>
<exclude name="io.swagger.**"/>
<exclude name="org.glashfish.jersey.**"/>
<exclude name="com.dotcms.vanityurl.**"/>
</scan>

</beans>
1 change: 1 addition & 0 deletions dotCMS/src/main/webapp/WEB-INF/web.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

<!-- Don't ever delete the following comment tags, it will break the build -->
<!-- BEGIN JSPS --> <!-- END JSPS -->

<context-param>
<param-name>company_id</param-name>
<param-value>dotcms.org</param-value>
Expand Down
9 changes: 7 additions & 2 deletions dotcms-integration/src/test/resources/META-INF/beans.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:weld="http://xmlns.jcp.org/xml/ns/javaee"
xsi:schemaLocation="
http://xmlns.jcp.org/xml/ns/javaee
http://xmlns.jcp.org/xml/ns/javaee/beans_2_0.xsd"
version="2.0" bean-discovery-mode="annotated">

<scan>
<exclude name="org.apache.**"/>
<exclude name="io.swagger.**"/>
</scan>

</beans>
Loading