Liferay maven dependency could not be resolved

1.5k views Asked by At

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

There are 3 answers

1
wemu On

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.

0
Pawel Kruszewski On

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

0
Carlos Durán On

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.