2016-03-26 21 views
-1

Basit bir önyükleme çoklu modülünü yazdım. Bir ana modülde iki alt modül erişimi ve web modülü bulunur. Tüm modül konfigürasyonunu aşağıda yazdım. Bu örnek proje çalışması doğru zaman bir tek modül olan ama bu istisnaYay önyükleme maven çoklu modül

güncellemesini atmak birden modülünde koydu: Tam yığın takibi

İstisna dizisindeki "ana" java.lang.IllegalArgumentException : Geçersiz bağımsız değişken sözdizimi: - org.springframework.core.env.SimpleCommandLineArgsParser.parse (SimpleCommandLineArgsParser.java:75) en = org.springframework.core.env.SimpleCommandLinePropertySource de (SimpleCommandLinePropertySource.java:87) org. .springframework.boot.SpringApplication.configurePropertySources (SpringApplication.java:44 3) org.springframework.boot.SpringApplication.run de org.springframework.boot.SpringApplication.run (SpringApplication.java:284) de org.springframework.boot.SpringApplication.configureEnvironment (SpringApplication.java:414) (en com.spring.controller.Application.main de org.springframework.boot.SpringApplication.run (SpringApplication.java:950) de SpringApplication.java:961) (Application.java:21)

yapacağım ihtiyacınız varsa örnek hakkında daha fazla bilgi koyun.

ebeveyn modülü:

<parent> 
    <artifactId>parent</artifactId> 
    <groupId>com.spring</groupId> 
    <version>0.0.1-SNAPSHOT</version> 
</parent> 
<modelVersion>4.0.0</modelVersion> 

<artifactId>web</artifactId> 
<dependencies> 
    <dependency> 
     <groupId>com.spring</groupId> 
     <artifactId>access</artifactId> 
     <version>0.0.1-SNAPSHOT</version> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework.boot</groupId> 
     <artifactId>spring-boot-starter-thymeleaf</artifactId> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework.boot</groupId> 
     <artifactId>spring-boot-starter-data-jpa</artifactId> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework.boot</groupId> 
     <artifactId>spring-boot-starter-data-rest</artifactId> 
    </dependency> 
    <dependency> 
     <groupId>mysql</groupId> 
     <artifactId>mysql-connector-java</artifactId> 
    </dependency> 
</dependencies> 

<properties> 
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> 
    <start-class>com.spring.controller.Application</start-class> 
    <java.version>1.8</java.version> 
</properties> 

<build> 
    <plugins> 
     <plugin> 
      <groupId>org.springframework.boot</groupId> 
      <artifactId>spring-boot-maven-plugin</artifactId> 
      <configuration> 
       <executable>true</executable> 
      </configuration> 
     </plugin> 
     <plugin> 
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-surefire-plugin</artifactId> 
      <configuration> 
       <useSystemClassLoader>false</useSystemClassLoader> 
      </configuration> 
     </plugin> 
    </plugins> 
</build> 

ve uygulama sınıfı kodu:

<parent> 
    <groupId>org.springframework.boot</groupId> 
    <artifactId>spring-boot-starter-parent</artifactId> 
    <version>1.2.7.RELEASE</version> 
</parent> 
<modelVersion>4.0.0</modelVersion> 
<name>parent</name> 
<groupId>com.spring</groupId> 
<artifactId>parent</artifactId> 
<version>0.0.1-SNAPSHOT</version> 
<packaging>pom</packaging> 
<properties> 
    <maven.compiler.source>1.8</maven.compiler.source> 
    <maven.compiler.target>1.8</maven.compiler.target> 
    <spring-boot.version>1.3.3.RELEASE</spring-boot.version> 
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> 
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> 
</properties> 

<modules> 
    <module>access</module> 
    <module>web</module> 
</modules> 

ve erişim modülü yapılandırma bu

<parent> 
    <artifactId>parent</artifactId> 
    <groupId>com.spring</groupId> 
    <version>0.0.1-SNAPSHOT</version> 
</parent> 
<modelVersion>4.0.0</modelVersion> 

<artifactId>access</artifactId> 
<dependencies> 
    <dependency> 
     <groupId>org.springframework.boot</groupId> 
     <artifactId>spring-boot-starter-thymeleaf</artifactId> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework.boot</groupId> 
     <artifactId>spring-boot-starter-data-jpa</artifactId> 
    </dependency> 
    <dependency> 
     <groupId>mysql</groupId> 
     <artifactId>mysql-connector-java</artifactId> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework.data</groupId> 
     <artifactId>spring-data-rest-core</artifactId> 
     <version>2.2.1.RELEASE</version> 
    </dependency> 
</dependencies> 
<build> 
    <plugins> 
     <plugin> 
      <groupId>org.springframework.boot</groupId> 
      <artifactId>spring-boot-maven-plugin</artifactId> 
      <configuration> 
       <executable>true</executable> 
      </configuration> 
     </plugin> 
     <plugin> 
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-surefire-plugin</artifactId> 
      <configuration> 
       <useSystemClassLoader>false</useSystemClassLoader> 
      </configuration> 
     </plugin> 
    </plugins> 
</build> 

ve web modülü yapılandırma şudur olduğunu :

@Configuration 
@ComponentScan("com.spring.controller") 
@EnableJpaRepositories 
@Import(RepositoryRestMvcConfiguration.class) 
@EnableAutoConfiguration 
@PropertySource("application.properties") 
public class Application { 

    public static void main(String[] args) { 
    SpringApplication.run(Application.class, args); 
} 
} 
+0

Tam yığın izi nedir? –

+0

@Andy Wilkinson, tam yığın izini koydum. – ali

cevap

2

Kural dışı durum, SpringApplication.run(...) yöntemini kullanarak özlediğinizi belirtir. Geçtiğiniz gibi görünüyor - = argümanlar olarak.

Yaylı önyükleme kılavuzunu kullanımına göre kontrol edin veya kod snippet'inizi bize bildirin.

https://spring.io/guides/gs/spring-boot/

Düzenleme 1:

Sorun çalıştırmak yapılandırma argümanlar gelmektedir.

Hatalar içinde bulunan parametreler yanlış. --= kabul edilemez.

+0

Cevabınız için teşekkür ederiz. lütfen güncellenmiş soruma bakın. uygulama sınıfı ekliyorum. – ali

+1

Sorun, çalışma yapılandırmanızın argümanlarından geliyor. Hatalar içinde bulunan parametreler yanlış. –

İlgili konular