2017-04-06 1 views
1

Web Flowに関する私の最後のquestionのフォローアップで、バリデータークラスが見つからないため、検証に関する別の問題が発生しました。IDEでSpring Web Flowの検証が機能しない

mvn spring-boot:runでプロジェクトを実行すると、検証は問題なく動作します。しかし、Springブートアプリケーションとしてメインクラスを実行してEclipse、STSまたはIntelliJで実行すると、検証はもう機能しません。

この問題のヒントを探す場所はわかりません。まずはpomファイルです。私は彼らの開発者とプロファイルの実装を好きなのでJHipster pom.xmlに基づいています。

親ポンポン

<?xml version="1.0" encoding="UTF-8"?> 
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 
    <modelVersion>4.0.0</modelVersion> 

    <groupId>twofa</groupId> 
    <artifactId>2fa-parent</artifactId> 
    <version>1.0.0</version> 
    <packaging>pom</packaging> 

    <modules> 
     <module>../2fa-portal</module> 
    </modules> 

    <properties> 
     <java.version>1.7</java.version> 
     <maven-enforcer-plugin.version>1.4.1</maven-enforcer-plugin.version> 
     <maven-war-plugin.version>2.6</maven-war-plugin.version> 
     <maven.compiler.source>1.7</maven.compiler.source> 
     <maven.compiler.target>1.7</maven.compiler.target> 
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> 
     <sortpom-maven-plugin.version>2.5.0</sortpom-maven-plugin.version> 
     <spring.boot.version>1.4.1.RELEASE</spring.boot.version> 
    </properties> 

    <dependencyManagement> 
     <dependencies> 
      <dependency> 
       <!-- Import dependency management from Spring Boot --> 
       <groupId>org.springframework.boot</groupId> 
       <artifactId>spring-boot-dependencies</artifactId> 
       <version>${spring.boot.version}</version> 
       <type>pom</type> 
       <scope>import</scope> 
      </dependency> 
     </dependencies> 
    </dependencyManagement> 

    <dependencies> 
     <dependency> 
      <groupId>org.springframework.boot</groupId> 
      <artifactId>spring-boot-starter-test</artifactId> 
      <scope>test</scope> 
     </dependency> 
     <dependency> 
      <groupId>org.springframework.boot</groupId> 
      <artifactId>spring-boot-starter-web</artifactId> 
     </dependency> 
    </dependencies> 

    <repositories> 
     <repository> 
      <id>com.springsource.repository.bundles.release</id> 
      <name>SpringSource Enterprise Bundle Repository - SpringSource Bundle Releases</name> 
      <url>http://repository.springsource.com/maven/bundles/release</url> 
     </repository> 

     <repository> 
      <id>com.springsource.repository.bundles.external</id> 
      <name>SpringSource Enterprise Bundle Repository - External Bundle Releases</name> 
      <url>http://repository.springsource.com/maven/bundles/external</url> 
     </repository> 
    </repositories> 

    <build> 
     <defaultGoal>spring-boot:run</defaultGoal> 
     <plugins> 
      <plugin> 
       <groupId>com.github.ekryd.sortpom</groupId> 
       <artifactId>sortpom-maven-plugin</artifactId> 
       <version>${sortpom-maven-plugin.version}</version> 
       <executions> 
        <execution> 
         <phase>verify</phase> 
         <goals> 
          <goal>sort</goal> 
         </goals> 
        </execution> 
       </executions> 
       <configuration> 
        <sortProperties>true</sortProperties> 
        <nrOfIndentSpace>4</nrOfIndentSpace> 
        <sortDependencies>groupId,artifactId</sortDependencies> 
        <sortPlugins>groupId,artifactId</sortPlugins> 
        <keepBlankLines>true</keepBlankLines> 
        <expandEmptyElements>false</expandEmptyElements> 
       </configuration> 
      </plugin> 
      <plugin> 
       <artifactId>maven-compiler-plugin</artifactId> 
       <version>3.6.0</version> 
       <configuration> 
        <source>${maven.compiler.source}</source> 
        <target>${maven.compiler.target}</target> 
       </configuration> 
      </plugin> 
      <plugin> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-enforcer-plugin</artifactId> 
       <version>${maven-enforcer-plugin.version}</version> 
       <executions> 
        <execution> 
         <id>enforce-versions</id> 
         <goals> 
          <goal>enforce</goal> 
         </goals> 
        </execution> 
       </executions> 
       <configuration> 
        <rules> 
         <requireMavenVersion> 
          <message>You are running an older version of Maven. Application requires at least Maven 3.0</message> 
          <version>[3.0.0,)</version> 
         </requireMavenVersion> 
         <requireJavaVersion> 
          <message>You are running an older version of Java. Application requires at least JDK ${java.version}</message> 
          <version>[${java.version}.0,)</version> 
         </requireJavaVersion> 
        </rules> 
       </configuration> 
      </plugin> 
      <plugin> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-surefire-plugin</artifactId> 
       <version>2.18.1</version> 
       <configuration> 
        <!-- Force alphabetical order to have a reproducible build --> 
        <runOrder>alphabetical</runOrder> 
        <includes> 
         <include>**/*Tests.java</include> 
         <include>**/*Test.java</include> 
         <include>**/Test*.java</include> 
        </includes> 
        <excludes> 
         <exclude>**/Abstract*.java</exclude> 
        </excludes> 
       </configuration> 
      </plugin> 
      <plugin> 
       <groupId>org.springframework.boot</groupId> 
       <artifactId>spring-boot-maven-plugin</artifactId> 
       <version>${spring.boot.version}</version> 
       <configuration> 
        <executable>true</executable> 
        <fork>true</fork> 
       </configuration> 
      </plugin> 
     </plugins> 
    </build> 

</project> 

ポータルポンポン

<?xml version="1.0" encoding="UTF-8"?> 
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 
    <modelVersion>4.0.0</modelVersion> 

    <parent> 
     <artifactId>2fa-parent</artifactId> 
     <groupId>twofa</groupId> 
     <version>1.0.0</version> 
     <relativePath>../2fa-parent/pom.xml</relativePath> 
    </parent> 

    <artifactId>2fa-portal</artifactId> 
    <packaging>war</packaging> 

    <name>2fa-portal</name> 

    <prerequisites> 
     <maven>3.0.0</maven> 
    </prerequisites> 

    <dependencies> 
     <dependency> 
      <groupId>org.springframework.boot</groupId> 
      <artifactId>spring-boot-starter-velocity</artifactId> 
     </dependency> 
     <dependency> 
      <groupId>org.springframework.webflow</groupId> 
      <artifactId>spring-webflow</artifactId> 
      <version>2.4.4.RELEASE</version> 
     </dependency> 
    </dependencies> 

    <build> 
     <!-- creates 2fa-portal.war file --> 
     <!-- Resource filtering to fill in placeholders "@[email protected]" in properties --> 
     <resources> 
      <resource> 
       <filtering>true</filtering> 
       <directory>${basedir}/src/main/resources</directory> 
       <includes> 
        <include>**/application*.properties</include> 
       </includes> 
      </resource> 
      <resource> 
       <directory>${basedir}/src/main/resources</directory> 
       <excludes> 
        <exclude>**/application*.properties</exclude> 
       </excludes> 
      </resource> 
     </resources> 
     <finalName>2fa-portal</finalName> 
     <pluginManagement> 
      <plugins> 
       <plugin> 
        <groupId>org.apache.maven.plugins</groupId> 
        <artifactId>maven-resources-plugin</artifactId> 
        <version>2.7</version> 
        <dependencies> 
         <dependency> 
          <groupId>org.apache.maven.shared</groupId> 
          <artifactId>maven-filtering</artifactId> 
          <version>1.3</version> 
         </dependency> 
        </dependencies> 
        <configuration> 
         <delimiters> 
          <delimiter>@</delimiter> 
          <!-- delimiter that doesn't clash with Spring ${} placeholders --> 
         </delimiters> 
         <useDefaultDelimiters>false</useDefaultDelimiters> 
        </configuration> 
       </plugin> 
       <plugin> 
        <groupId>org.apache.maven.plugins</groupId> 
        <artifactId>maven-war-plugin</artifactId> 
        <configuration> 
         <failOnMissingWebXml>false</failOnMissingWebXml> 
         <archive> 
          <manifest> 
           <addDefaultImplementationEntries>true</addDefaultImplementationEntries> 
          </manifest> 
         </archive> 
        </configuration> 
       </plugin> 
      </plugins> 
     </pluginManagement> 
    </build> 

    <profiles> 
     <profile> 
      <id>dev</id> 
      <activation> 
       <activeByDefault>true</activeByDefault> 
      </activation> 
      <build> 
       <plugins> 
        <plugin> 
         <groupId>org.apache.maven.plugins</groupId> 
         <artifactId>maven-war-plugin</artifactId> 
         <version>${maven-war-plugin.version}</version> 
        </plugin> 
       </plugins> 
      </build> 
      <properties> 
       <!-- log configuration --> 
       <logback.loglevel>DEBUG</logback.loglevel> 
       <!-- default Spring profile --> 
       <spring.profiles.active>dev</spring.profiles.active> 
      </properties> 
      <dependencies> 
       <dependency> 
        <groupId>org.springframework.boot</groupId> 
        <artifactId>spring-boot-devtools</artifactId> 
        <optional>true</optional> 
       </dependency> 
       <dependency> 
        <groupId>org.springframework.boot</groupId> 
        <artifactId>spring-boot-starter-tomcat</artifactId> 
       </dependency> 
      </dependencies> 
     </profile> 
     <profile> 
      <id>test</id> 
      <build> 
       <plugins> 
        <plugin> 
         <artifactId>maven-clean-plugin</artifactId> 
         <version>2.5</version> 
         <configuration> 
          <filesets> 
           <fileset> 
            <directory>target/</directory> 
           </fileset> 
          </filesets> 
         </configuration> 
        </plugin> 
        <plugin> 
         <groupId>org.apache.maven.plugins</groupId> 
         <artifactId>maven-war-plugin</artifactId> 
         <configuration> 
          <failOnMissingWebXml>false</failOnMissingWebXml> 

         </configuration> 
        </plugin> 
        <plugin> 
         <groupId>org.springframework.boot</groupId> 
         <artifactId>spring-boot-maven-plugin</artifactId> 
         <executions> 
          <execution> 
           <goals> 
            <goal>build-info</goal> 
           </goals> 
          </execution> 
         </executions> 
         <configuration> 
          <executable>false</executable> 
         </configuration> 
        </plugin> 
       </plugins> 
      </build> 
      <properties> 
       <spring.profiles.active>test</spring.profiles.active> 
      </properties> 
      <dependencies> 
       <dependency> 
        <groupId>org.springframework.boot</groupId> 
        <artifactId>spring-boot-starter-tomcat</artifactId> 
        <scope>provided</scope> 
       </dependency> 
      </dependencies> 
     </profile> 
     <profile> 
      <id>prod</id> 
      <build> 
       <plugins> 
        <plugin> 
         <artifactId>maven-clean-plugin</artifactId> 
         <version>2.5</version> 
         <configuration> 
          <filesets> 
           <fileset> 
            <directory>target/</directory> 
           </fileset> 
          </filesets> 
         </configuration> 
        </plugin> 
        <plugin> 
         <groupId>org.apache.maven.plugins</groupId> 
         <artifactId>maven-war-plugin</artifactId> 
         <configuration> 
          <failOnMissingWebXml>false</failOnMissingWebXml> 

         </configuration> 
        </plugin> 
        <plugin> 
         <groupId>org.springframework.boot</groupId> 
         <artifactId>spring-boot-maven-plugin</artifactId> 
         <executions> 
          <execution> 
           <goals> 
            <goal>build-info</goal> 
           </goals> 
          </execution> 
         </executions> 
         <configuration> 
          <executable>false</executable> 
         </configuration> 
        </plugin> 
       </plugins> 
      </build> 
      <properties> 
       <spring.profiles.active>prod</spring.profiles.active> 
      </properties> 
      <dependencies> 
       <dependency> 
        <groupId>org.springframework.boot</groupId> 
        <artifactId>spring-boot-starter-tomcat</artifactId> 
        <scope>provided</scope> 
       </dependency> 
      </dependencies> 
     </profile> 
    </profiles> 
</project> 

答えて

0

それは一緒に春のWebフローと春デベロッパーツールに問題があることが判明。詳細情報と回避策はat this Spring Boot issueです。

回避策引用:

を私はこの問題は、再起動して、基本クラスローダーの分離によるものであり、簡単に次のエントリspring-devtools.properties

restart.include.spring=/spring-.*\.jar 
を追加することによって解決されると思います