问题描述
我使用liferay 7.1,并且当我想部署SpringMvcPortlet时出现此错误:
无法解析配置':wars:mySpringMvcPortlet:compileClasspath'的所有文件。
找不到javax.validation:validation-api:。 要求: 项目:wars:SpringMvcPortletFormation 找不到org.hibernate.validator:hibernate-validator:。 要求: 项目:wars:SpringMvcPortletFormation可能的解决方案:
- 声明提供工件的存储库,请参阅https://docs.gradle.org/current/userguide/declaring_repositories.html上的文档
您知道我的错误在哪里吗?
预先感谢
解决方法
您在这里有一个依赖项问题,您必须管理SpringMvcPortletFormationPossible项目的所有依赖项,并且需要将它们正确放置在build.gradle文件中,
因此,我建议将mavenLocal()
添加到repositories { }
中,以便能够从本地存储库中搜索所有本地依赖项并正确找到它们:
示例:
buildscript {
dependencies {
classpath group: "com.liferay",name: "com.liferay.gradle.plugins",version: "3.13.8"
}
repositories {
mavenLocal()
maven {
url "https://repository-cdn.liferay.com/nexus/content/groups/public"
}
}
}
apply plugin: "com.liferay.plugin"
dependencies { .... // your dependency here // .... }
repositories {
mavenLocal()
maven {
url "https://repository-cdn.liferay.com/nexus/content/groups/public"
}
}