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

feat: enable ctr annotation build custom configuration #5368

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
<module>spring-cloud-dataflow-server</module>
<module>spring-cloud-dataflow-tasklauncher</module>
<module>spring-cloud-dataflow-single-step-batch-job</module>
<module>spring-cloud-dataflow-composed-task-runner-core</module>
<module>spring-cloud-dataflow-composed-task-runner</module>
<module>spring-cloud-dataflow-test</module>
<module>spring-cloud-dataflow-dependencies</module>
Expand Down
129 changes: 129 additions & 0 deletions spring-cloud-dataflow-composed-task-runner-core/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dataflow-parent</artifactId>
<version>2.11.0-SNAPSHOT</version>
<relativePath>../spring-cloud-dataflow-parent</relativePath>
</parent>
<version>2.11.0-SNAPSHOT</version>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dataflow-composed-task-runner-core</artifactId>
<packaging>jar</packaging>
<properties>
<java.version>1.8</java.version>
<plexus.utils.version>3.3.0</plexus.utils.version>
<failIfNoTests>true</failIfNoTests>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-autoconfigure</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dataflow-rest-client</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.pivotal.cfenv</groupId>
<artifactId>java-cfenv</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-batch</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dataflow-core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-task-batch</artifactId>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
</dependency>
<dependency>
<groupId>org.mariadb.jdbc</groupId>
<artifactId>mariadb-java-client</artifactId>
<version>[3.1.2,)</version>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
</dependency>
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
<scope>runtime</scope>
<exclusions>
<exclusion>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-keyvault</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
<version>${plexus.utils.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-common-security-config-web</artifactId>
<scope>test</scope>
<type>test-jar</type>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.micrometer.prometheus</groupId>
<artifactId>prometheus-rsocket-spring</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* Copyright 2016 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.springframework.cloud.dataflow.composedtaskrunner;

import org.springframework.boot.autoconfigure.AutoConfigureBefore;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;

/**
* Auto-configuration for dataflow server.
*
* @author Tobias Soloschenko
*/
@Configuration
@AutoConfigureBefore({JacksonAutoConfiguration.class})
@ConditionalOnBean(EnableComposedTaskRunnerConfiguration.Marker.class)
@Import({ComposedTaskRunnerConfiguration.class, ComposedTaskRunnerOAuth2Configuration.class})
public class ComposedTaskRunnerAutoConfiguration {
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,20 @@
@EnableBatchProcessing
@EnableTask
@EnableConfigurationProperties(ComposedTaskProperties.class)
@Configuration
@Import(org.springframework.cloud.dataflow.composedtaskrunner.StepBeanDefinitionRegistrar.class)
@Configuration(
proxyBeanMethods = false
)
@Import(StepBeanDefinitionRegistrar.class)
public class ComposedTaskRunnerConfiguration {

@Bean
public StepExecutionListener composedTaskStepExecutionListener(TaskExplorer taskExplorer){
return new org.springframework.cloud.dataflow.composedtaskrunner.ComposedTaskStepExecutionListener(taskExplorer);
return new ComposedTaskStepExecutionListener(taskExplorer);
}

@Bean
public org.springframework.cloud.dataflow.composedtaskrunner.ComposedRunnerJobFactory composedTaskJob(ComposedTaskProperties properties) {

return new org.springframework.cloud.dataflow.composedtaskrunner.ComposedRunnerJobFactory(properties);
public ComposedRunnerJobFactory composedTaskJob(ComposedTaskProperties properties) {
return new ComposedRunnerJobFactory(properties);
}

@Bean
Expand All @@ -74,7 +75,7 @@ public TaskExecutor taskExecutor(ComposedTaskProperties properties) {
public BatchConfigurer getComposedBatchConfigurer(BatchProperties properties,
DataSource dataSource, TransactionManagerCustomizers transactionManagerCustomizers,
ComposedTaskProperties composedTaskProperties) {
return new org.springframework.cloud.dataflow.composedtaskrunner.ComposedBatchConfigurer(properties,
dataSource, transactionManagerCustomizers, composedTaskProperties);
return new ComposedBatchConfigurer(properties, dataSource,
transactionManagerCustomizers, composedTaskProperties);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,12 @@
* @author Gunnar Hillert
* @author Ilayaperumal Gopinathan
*/
@Configuration
@Configuration(
proxyBeanMethods = false
)
@Conditional(OnOAuth2ClientCredentialsEnabled.class)
public class DataFlowConfiguration {
public class ComposedTaskRunnerOAuth2Configuration {

@Bean
public InMemoryClientRegistrationRepository clientRegistrationRepository(
ComposedTaskProperties properties) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*
* Copyright 2016 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.springframework.cloud.dataflow.composedtaskrunner;

import org.springframework.context.annotation.Import;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
* Activates a Spring Cloud Data Flow Server implementation.
*
* @author Tobias Soloschenko
*/
@Target({ ElementType.TYPE })
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Inherited
@Import(EnableComposedTaskRunnerConfiguration.class)
public @interface EnableComposedTaskRunner {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*
* Copyright 2016 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.springframework.cloud.dataflow.composedtaskrunner;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
* Configuration for {@link EnableComposedTaskRunner} which adds a marker bean which
* auto-config classes can use to conditionally check if auto configuration should be
* activated.
*
* @author Tobias Soloschenko
*/
@Configuration
public class EnableComposedTaskRunnerConfiguration {

@Bean
public Marker enableConfigServerMarker() {
return new Marker();
}

class Marker {
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
org.springframework.context.ApplicationListener=\
org.springframework.cloud.dataflow.composedtaskrunner.support.CfServiceBindingPropertySourceInitializer

org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
org.springframework.cloud.dataflow.composedtaskrunner.ComposedTaskRunnerAutoConfiguration
Loading