简体   繁体   English

与数据库连接到非数据库项目的Spring Boot

[英]Spring boot with DB Connection to a Non database project

I have a project with Spring boot 1.4.1 which connects to an Oracle database, i want to generate another project with no connection to database, I removed the pom dependencies and changed the Starter code 我有一个使用Spring boot 1.4.1的项目,该项目连接到Oracle数据库,我想生成另一个不连接数据库的项目,我删除了pom依赖项并更改了Starter代码

TO: 至:

@Configuration
@EnableAutoConfiguration
@ComponentScan
public class App {
/**
 * Init method
 * @param args
 */
public static void main( String[] args ){
    SpringApplication.run(App.class, args);
   }
}

FROM : 来自

@SpringBootApplication
public class App {
/**
 * Init method
 * @param args
 */
public static void main( String[] args ){
    SpringApplication.run(App.class, args);
   }
}

the project still keep trying to configure database. 该项目仍然继续尝试配置数据库。

How can i leave the project just as a simple RestController Project with no database. 我如何才能像没有数据库的简单RestController项目一样离开项目。

Thanks. 谢谢。

It was a problem of my configuration. 这是我的配置问题。 I had included a connection in a library. 我已经在图书馆中加入了一个连接。 After recompiling the library it worked! 重新编译库后,它就可以了!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM