2015-01-13 30 views
0

我使用的是maven 3.0.5,我試圖將它升級到maven 3.2.5。除了 flexmojos以外,一切都很順利。maven中的flexmojo支持3.2.5

當我建立使用maven 3.0.5 - 應用程序構建精緻而3.2.5 verison給我下面的錯誤:

[ERROR] Failed to execute goal org.sonatype.flexmojos:flexmojos-maven-plugin:4.0-RC2:copy-flex-resources 

(默認)項目NGI-網站:目標 執行默認org.sonatype.flexmojos:flexmojos-maven-plugin:4.0-RC2:copy-flex-resources失敗: 執行時遇到API不兼容 org.sonatype.flexmojos:flexmojos-maven-plugin:4.0-RC2:copy- flex-resources: java.lang.NoSuchMethodError:org.apache.maven.execution.MavenSession.getRepositorySession()Lorg/sonatype/aether/RepositorySystemSession;

解決這個問題,我的flexmojo版本更新至6.0.0,但我仍得到如下錯誤

[ERROR] Plugin net.flexmojos.oss:flexmojos-maven-plugin:6.0.0 or one of its dependencies could not be resolved: Failed to read artifact descriptor for net.flexmojos.oss:flexmojos-maven-plugin:jar:6.0.0: Could not find artifact com.adobe.flex:framework:pom:4.6.0.23201 in all-repos (http://repo.cdiapps.com/repo) -> [Help 1] 

[錯誤] [錯誤]要查看錯誤的完整堆棧跟蹤,再用-e開關運行Maven。 [錯誤]使用-X開關重新運行Maven以啓用完整的調試日誌記錄。

確實flexmojo 4.0-RC2只適用於maven 3.0.5嗎?有人可以幫助我嗎?

這裏是pom.xml文件的flexmojo配置:

<flexVersion>4.5.1.21328</flexVersion> 
    <flexUnitVersion>4.0-rc-1</flexUnitVersion> 
    <flexMojosVersion>4.0-RC2</flexMojosVersion> 
    <plugins> 
     <plugin> 
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-compiler-plugin</artifactId> 
      <version>2.5.1</version> 
      <configuration> 
       <source>1.6</source> 
       <target>1.6</target> 
      </configuration> 
     </plugin> 

     <plugin> 
      <artifactId>maven-resources-plugin</artifactId> 
      <version>2.5</version> 
      <configuration> 
       <encoding>UTF-8</encoding> 
      </configuration> 
     </plugin> 

     <plugin> 
      <groupId>org.sonatype.flexmojos</groupId> 
      <artifactId>flexmojos-maven-plugin</artifactId> 
      <dependencies> 
       <dependency> 
        <groupId>com.adobe.flex</groupId> 
        <artifactId>compiler</artifactId> 
        <version>${flexVersion}</version> 
        <type>pom</type> 
       </dependency> 
       <dependency> 
        <groupId>com.adobe.flex.compiler</groupId> 
        <artifactId>asdoc</artifactId> 
        <version>${flexVersion}</version> 
        <classifier>template</classifier> 
        <type>zip</type> 
       </dependency> 
      </dependencies> 
      <version>${flexMojosVersion}</version> 
      <executions> 
       <execution> 
        <goals> 
         <goal>copy-flex-resources</goal> 
        </goals> 
       </execution> 
      </executions> 
      <configuration> 
       <webappDirectory>${basedir}/src/main/webapp/static</webappDirectory> 
       <storepass/> 
      </configuration> 
     </plugin> 

回答

1

我今天得到了同樣的錯誤使用Maven 3.2.3和7.0.1的Flexmojos。

我在這裏找到了一個解決方法:http://mantis.jspresso.org/view.php?id=1186 即由maven-dependency-plugin:copy-dependencies替換flexmojos-maven-plugin:copy-flex-resources'。

+0

好吧..會嘗試這一個,並讓你張貼。 – Suresh

+0

我已經爲此做了一個解決方法。當我們升級maven時,應該正式發佈在pom.xml中配置的特定於應用程序的依賴關係。如果依賴關係是alpha版或beta版,那麼更高版本的maven可能不起作用。這也是我的代碼中發生的事情。 Flexmojo被配置爲4.0.Beta並且在MAven3.0.5中得到了支持。但在maven 3.2.5中失敗。當我將flexmojo修改爲官方發佈的3.8版本時,它在3.2.5中構建得很好。 – Suresh

+0

@Suresh:「flexmojo to 3.8」。 你是在談論一箇舊的velo的發佈?最後一個穩定版本是第七個(https://flexmojos.atlassian.net/wiki/display/FLEXMOJOS/Versions) – atao