質問するログイン新規登録

質問編集履歴

2

JavaConfigの確認のため、追記。

2016/08/01 04:07

投稿

shuhey
shuhey

スコア18

title CHANGED
File without changes
body CHANGED
@@ -112,17 +112,17 @@
112
112
  ```
113
113
 
114
114
  ```エラーメッセージ
115
+ エラーメッセージ
115
116
  [ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:1.4.0.RELEASE:run (default-cli) on project my-spring-boot: Unable to find a suitable main class, please add a 'mainClass' property -> [Help 1]
116
117
  [ERROR]
117
118
  [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
118
119
  [ERROR] Re-run Maven using the -X switch to enable full debug logging.
119
120
  [ERROR]
120
121
  [ERROR] For more information about the errors and possible solutions, please read the following articles:
121
- [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException```
122
+ [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
123
+ ```
122
124
 
123
125
  ```java
124
- JavaConfig(ネットから取得、自身のプロジェクト内には記入無し)
125
-
126
126
  package sample.spring;
127
127
 
128
128
  import org.springframework.context.annotation.Bean;

1

JavaConfigの確認のため、追記。

2016/08/01 04:07

投稿

shuhey
shuhey

スコア18

title CHANGED
File without changes
body CHANGED
@@ -118,4 +118,28 @@
118
118
  [ERROR] Re-run Maven using the -X switch to enable full debug logging.
119
119
  [ERROR]
120
120
  [ERROR] For more information about the errors and possible solutions, please read the following articles:
121
- [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException```
121
+ [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException```
122
+
123
+ ```java
124
+ JavaConfig(ネットから取得、自身のプロジェクト内には記入無し)
125
+
126
+ package sample.spring;
127
+
128
+ import org.springframework.context.annotation.Bean;
129
+ import org.springframework.context.annotation.ComponentScan;
130
+ import org.springframework.context.annotation.Configuration;
131
+ import org.springframework.context.annotation.PropertySource;
132
+ import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;
133
+
134
+ @Configuration
135
+ @ComponentScan
136
+ @PropertySource(value = {"classpath:beans.properties"})
137
+ public class AppConfig {
138
+
139
+ @Bean
140
+ public static PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer() {
141
+ return new PropertySourcesPlaceholderConfigurer();
142
+ }
143
+
144
+ }
145
+ ```