0
votes

I have created a new Liferay Plugin project using the maven plugin, and when I execute mvn install (directly from Eclipse through m2e plugin) I get the following error:

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

Now if I manually create that directory then it works, but shouldn't the plugin be creating it by itself (as it happens with the rest of non-Liferay maven projects)?

3

3 Answers

0
votes

This error only happen in 6.1.1 and lower. I think not have elegant solution unless you upgrade the liferay version

0
votes

Check the following file .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>
0
votes

We have the same problem in our last project. In our case, we don't need to merge the CSS so we had been configured maven to skip that phase:

<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>

In all the project (several months) I can't find any issue disabling this phase.

Hope it helps! :D