質問編集履歴

2

JavaConfigの確認のため、追記。

2016/08/01 04:07

投稿

shuhey
shuhey

スコア18

test CHANGED
File without changes
test CHANGED
@@ -226,6 +226,8 @@
226
226
 
227
227
  ```エラーメッセージ
228
228
 
229
+ エラーメッセージ
230
+
229
231
  [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]
230
232
 
231
233
  [ERROR]
@@ -238,16 +240,14 @@
238
240
 
239
241
  [ERROR] For more information about the errors and possible solutions, please read the following articles:
240
242
 
241
- [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException```
243
+ [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
244
+
245
+ ```
242
246
 
243
247
 
244
248
 
245
249
  ```java
246
250
 
247
- JavaConfig(ネットから取得、自身のプロジェクト内には記入無し)
248
-
249
-
250
-
251
251
  package sample.spring;
252
252
 
253
253
 

1

JavaConfigの確認のため、追記。

2016/08/01 04:07

投稿

shuhey
shuhey

スコア18

test CHANGED
File without changes
test CHANGED
@@ -239,3 +239,51 @@
239
239
  [ERROR] For more information about the errors and possible solutions, please read the following articles:
240
240
 
241
241
  [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException```
242
+
243
+
244
+
245
+ ```java
246
+
247
+ JavaConfig(ネットから取得、自身のプロジェクト内には記入無し)
248
+
249
+
250
+
251
+ package sample.spring;
252
+
253
+
254
+
255
+ import org.springframework.context.annotation.Bean;
256
+
257
+ import org.springframework.context.annotation.ComponentScan;
258
+
259
+ import org.springframework.context.annotation.Configuration;
260
+
261
+ import org.springframework.context.annotation.PropertySource;
262
+
263
+ import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;
264
+
265
+
266
+
267
+ @Configuration
268
+
269
+ @ComponentScan
270
+
271
+ @PropertySource(value = {"classpath:beans.properties"})
272
+
273
+ public class AppConfig {
274
+
275
+
276
+
277
+ @Bean
278
+
279
+ public static PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer() {
280
+
281
+ return new PropertySourcesPlaceholderConfigurer();
282
+
283
+ }
284
+
285
+
286
+
287
+ }
288
+
289
+ ```