2014-09-05 62 views
0

我已經使用Maven插件創建了一個新的Liferay插件項目,當我執行MVN(從Eclipse中通過M2E插件直接)安裝我收到以下錯誤:安裝Liferay的門戶與Maven插件

Failed to execute goal com.liferay.maven.plugins:liferay-maven-plugin:6.1.1:build-css (default) on project sample-portlet: basedir C:\eclipseLiferay\workspace\sample-portlet\target\sample-portlet-1.0.0-SNAPSHOT does not exist 

現在如果我手動創建該目錄,那麼它可以工作,但不應該由插件自己創建它(就像其他非Liferay maven項目發生的那樣)?

回答

0

我們在上一個項目中遇到同樣的問題。在我們的例子中,我們並不需要合併CSS,所以我們已經配置Maven來跳過階段:

<build> 
    <plugins> 
     <plugin> 
      <groupId>com.liferay.maven.plugins</groupId> 
      <artifactId>liferay-maven-plugin</artifactId> 
      <version>${liferay.maven.plugin.version}</version> 
      <executions> 
       <!-- Commented! Is not necessary 
       <execution> 
        <phase>generate-sources</phase> 
        <goals> 
         <goal>build-css</goal> 
        </goals> 
       </execution> --> 
      </executions> 
      <configuration> 
       <autoDeployDir>${liferay.auto.deploy.dir}</autoDeployDir> 
       <appServerDeployDir>${liferay.app.server.deploy.dir}</appServerDeployDir> 
       <liferayVersion>${liferay.version}</liferayVersion> 
       <pluginType>portlet</pluginType> 
       [...] 
      </configuration> 
     </plugin> 
     [...] 
    </plugins> 
</build> 

在所有的項目中(幾個月)我找不到禁用這一階段的任何問題。

希望它有幫助!

0

此錯誤僅發生在6.1.1及更低版本中。我想不會有優雅的解決方案,除非你升級Liferay的版本

0

檢查下列文件.settings/org.eclipse.wst.common.component

<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0"> 
    <wb-module deploy-name="ProjectName"> 
     <wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/> 
     <wb-resource deploy-path="/" source-path="/target/m2e-liferay/resources"/> 
     <wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/> 
     <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/> 
     <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/> 
     <property name="java-output-path" value="/ProjectName/target/classes"/> 
     <property name="context-root" value="ProjectName"/> 
    </wb-module> 
</project-modules>