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

Fixes #6756 - Deprecate jetty-spring sub-project #7813

Merged
merged 2 commits into from
Mar 31, 2022
Merged
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
2 changes: 1 addition & 1 deletion jetty-spring/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<name>Example :: Jetty Spring</name>

<properties>
<spring-version>3.2.18.RELEASE</spring-version>
<spring-version>5.3.18</spring-version>
<dependencies>target/dependencies</dependencies>
<bundle-symbolic-name>${project.groupId}.spring</bundle-symbolic-name>
<jacoco.skip>true</jacoco.skip>
Expand Down
3 changes: 3 additions & 0 deletions jetty-spring/src/main/java/org/eclipse/jetty/spring/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,14 @@

/**
* Runs Jetty from a Spring configuration file passed as argument.
* @deprecated Has been removed in Jetty 10+
*/
@Deprecated
public class Main
{
public static void main(String[] args) throws Exception
{
System.err.println("DEPRECATION WARNING - The `jetty-spring` project will see no further updates, and has been fully removed from Jetty 10 onwards");
Resource config = Resource.newResource(args.length == 1 ? args[0] : "etc/jetty-spring.xml");
XmlConfiguration.main(config.getFile().getAbsolutePath());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@
* <p>
* This processor is returned by the {@link SpringConfigurationProcessorFactory} for any XML document whos first
* element is "beans". The factory is discovered by a {@link ServiceLoader} for {@link ConfigurationProcessorFactory}.
* @deprecated Has been removed in Jetty 10+
*/
@Deprecated
public class SpringConfigurationProcessor implements ConfigurationProcessor
{
private static final Logger LOG = Log.getLogger(SpringConfigurationProcessor.class);
Expand All @@ -67,6 +69,11 @@ public class SpringConfigurationProcessor implements ConfigurationProcessor
private DefaultListableBeanFactory _beanFactory;
private String _main;

public SpringConfigurationProcessor()
{
LOG.warn("DEPRECATION WARNING - The `jetty-spring` project will see no further updates, and has been fully removed from Jetty 10 onwards");
}

@Override
public void init(URL url, XmlParser.Node root, XmlConfiguration configuration)
{
Expand Down Expand Up @@ -141,7 +148,7 @@ private void doConfigure()
{
LOG.debug("{} - {}", bean, Arrays.asList(_beanFactory.getAliases(bean)));
String[] aliases = _beanFactory.getAliases(bean);
if ("Main".equals(bean) || aliases != null && Arrays.asList(aliases).contains("Main"))
if ("Main".equals(bean) || Arrays.asList(aliases).contains("Main"))
{
_main = bean;
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@
*
* @see SpringConfigurationProcessor
* @see XmlConfiguration
* @deprecated Has been removed in Jetty 10+
*/
@Deprecated
public class SpringConfigurationProcessorFactory implements ConfigurationProcessorFactory
{
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
//

/**
* Jetty Spring : Spring IoC Configuration for Jetty
* Jetty Spring : (Deprecated) Spring IoC Configuration for Jetty
* @deprecated
*/
package org.eclipse.jetty.spring;

Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.3.xsd">

<!-- define the singleton properties Map, filled in with XmlConfiguration.getProperties() -->
<bean id="properties" class="java.util.Map"/>

<!-- extract a value from the property map -->
<bean id="testProperty" class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
<property name="targetObject"><ref local="properties" /></property>
<property name="targetObject" ref="properties" />
<property name="targetMethod" value="get" />
<property name="arguments"><list><value>test</value></list></property>
</bean>
Expand Down