![](/img/trans.png)
[英]Liferay - Maven -Missing artifact com.liferay.portal in default portlet
[英]Installing Liferay portlet with Maven plugin
我使用 maven 插件创建了一个新的 Liferay 插件项目,当我执行 mvn install (直接从 Eclipse 通过 m2e 插件)时,我收到以下错误:
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 项目一样)?
我们在上一个项目中遇到了同样的问题。 在我们的例子中,我们不需要合并 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>
在所有项目(几个月)中,我找不到任何禁用此阶段的问题。
希望能帮助到你! :D
此错误仅发生在 6.1.1 及更低版本中。 我认为除非您升级 liferay 版本,否则没有优雅的解决方案
检查以下文件 .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>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.