2013-11-22 49 views
0

我試圖用Maven構建一個multimodule原型到一個項目。當我包含我的JSP時,我從Velocity中得到一個異常。構建和原型到Maven,速度ParseErrorException與JSP的

[INFO] Parent element not overwritten in /home/gortiz/workspaces/archetype/miPrueba/miPrueba-new-aw/pom.xml 
[ERROR] Parser Exception: archetype-resources/__rootArtifactId__-new-aw/src/main/webapp/WEB-INF/jsp/open/login.jsp 
[ERROR] org.apache.velocity.runtime.parser.ParseException: Encountered " eq 1}\">\n 

我發現了這個URL,但它對我不起作用。 http://yajdb.wordpress.com/2012/08/28/maven-archetype-creation-conflicts-between-jsp-and-velocity-templates/

我的配置文件是:

<modules> 
     <module id="${implantation}-new-aw" dir="__rootArtifactId__-new-aw" 
      name="${implantation}-new-aw"> 
      <fileSets> 
       <fileSet filtered="true" encoding="UTF-8"> 
        <directory>src/main/java</directory> 
        <includes> 
         <include>**/*.java</include> 
        </includes> 
       </fileSet> 
       <fileSet filtered="true" encoding="UTF-8"> 
        <directory>src/test/java</directory> 
        <includes> 
         <include>**/*.java</include> 
        </includes>     
       </fileSet> 
       <!-- <fileSet filtered=」true」 packaged=」false」> 
       <directory>src/main/webapp</directory> 
        <excludes> 
         <exclude>**/**/*.jsp</exclude> 
         <exclude>**/*.xml</exclude> 
        </excludes> 
       </fileSet>-->     
       <fileSet filtered="true" encoding="UTF-8"> 
        <directory>src/main/webapp</directory> 
        <includes> 
         <include>**/*.xml</include> 
        </includes> 
       </fileSet> 
       <fileSet filtered="true" packaged="false" encoding="UTF-8"> 
        <directory>src/main/webapp</directory> 
        <includes> 
         <include>**/*.jsp</include> 
        </includes> 
       </fileSet>               
       <fileSet filtered="true" encoding="UTF-8"> 
        <directory>src/main/resources/</directory> 
        <includes> 
         <include>**/**/*.*</include> 
        </includes>     
       </fileSet> 
      </fileSets> 
     </module>  
    </modules> 

回答

1

刪除或使你的JSP配置的過濾屬性假,也爲資源。

filtered = true,文件集可以被過濾,這意味着選定的文件將被用作速度模板。

filtere = false,它們可以非過濾,這意味着所選文件將被複制而不用修改。
默認值爲:false。

<fileSet packaged="false" encoding="UTF-8"> 
    <directory>src/main/webapp</directory> 
    <includes> 
     <include>**/*.jsp</include> 
    </includes> 
</fileSet>