Skip to content

Commit

Permalink
#167 - replaces the Java Config classes by the corresponding generate…
Browse files Browse the repository at this point in the history
…d xml config and disables Spring Boot's database-related auto-config
  • Loading branch information
tjuerge committed Aug 10, 2019
1 parent 5a85052 commit 9ae41ff
Show file tree
Hide file tree
Showing 13 changed files with 75 additions and 334 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,17 @@
package org.sculptor.examples.boot;

import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration;
import org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration;
import org.springframework.boot.builder.SpringApplicationBuilder;

@SpringBootApplication
@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class,
DataSourceTransactionManagerAutoConfiguration.class, HibernateJpaAutoConfiguration.class })
public class Application {

public static void main(String[] args) throws Exception {
new SpringApplicationBuilder().
sources(Application.class).profiles("web").
run(args);
new SpringApplicationBuilder().sources(Application.class).profiles("web").run(args);
}

}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
* Copyright 2019 The Sculptor Project Team, including 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
*
* http://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.sculptor.examples.boot.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.ImportResource;
import org.springframework.context.annotation.Profile;

@Profile("!test")
@Configuration
@ImportResource("classpath:applicationContext.xml")
public class BackendConfig {
}

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ spring.thymeleaf.cache=false

# EMBEDDED WEB CONTAINER CONFIGURATION
# Set the error path
error.path=/error
server.error.path=/error
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

project.nature=business-tier

generate.spring.annotation.tx=true
generate.spring.dataSourceSupport=true
generate.restWeb=false

generate.modeldoc=false
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
* Copyright 2019 The Sculptor Project Team, including 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
*
* http://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.sculptor.examples.boot.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.ImportResource;
import org.springframework.context.annotation.Profile;

@Profile("test")
@Configuration
@ImportResource("classpath:applicationContext-test.xml")
public class BackendTestConfig {
}

0 comments on commit 9ae41ff

Please sign in to comment.