Liferay maven dependency could not be resolved

夙愿已清 提交于 2020-01-06 14:14:14

问题


I am using liferay 6.2.10.4 enterprise edition with maven.while deploying it with maven clean package commad I got below error.

The following artifacts could not be resolved: com.liferay.portal:portal-service:jar:6.2.10.4, com.liferay.portal:util-bridges:jar:6.2.10.4, com.liferay.portal:util-taglib:jar:6.2.10.4, com.liferay.portal:util-java:jar:6.2.10.4: Could not find artifact com.liferay.portal:portal-service:jar:6.2.10.4 in central (http://repo.maven.apache.org/maven2) -> [Help 1]

I have used below as well.

repositories>
        <repository>
            <id>liferay-ce</id>
            <name>Liferay CE</name>
            <url>https://repository.liferay.com/nexus/content/groups/liferay-ce</url>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
    </repositories>
    <pluginRepositories>
        <pluginRepository>
            <id>liferay-ce</id>
            <url>https://repository.liferay.com/nexus/content/groups/liferay-ce/</url>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </pluginRepository>
    </pluginRepositories>

回答1:


I think the problem is that versions doesn't exist in maven repository. You must put a correct version. For example, you can see util-taglib available versions here.




回答2:


You need to add those dependencies to your own Maven Repository. If you don't already use a Repository Proxy: now is the time! (it really helps with lots of things). Sonatype Nexus or Artifactory are the most known ones. Both are good. Choose the one you like (but choose one).

I think this maven plugin has (or had?) a goal to upload the artifacts from the Enterprise Edition to the Repository Proxy. Otherwise you need to do that manually.




回答3:


You can install the packages you need with installation package that's available from liferay itself. Extensive manual on how to do this is available in 6.2 documentation section "Installing Required Liferay Artifacts".

Management of your own repository of artifacts is described in section "Managing Maven Repositories". You'll need this repository anyway because EE artifacts are not available in public repos (license reasons).

Good news is that installation of nexus repository is quite easy and installation of EE artifacts is automated with ant :)



来源:https://stackoverflow.com/questions/27017674/liferay-maven-dependency-could-not-be-resolved

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!