When we use to build a Nexus local warehouse, and configure Settings.xml to enable this repository for applications. We use the archetype of Liferay 6.1.10 to create the Liferay portlet, as shown in the following figure:
When we run the command MVN package Liferay:deploy, the following error occurs:
01.[debug] Using connector Wagonrepositoryconnector with priority 0 for http://192.168.129.35:8080/nexus-2.0.4-1/ content/groups/public/
02.downloading:http://192.168.129.35:8080/nexus-2.0.4-1/content/groups/public/com/sun/media/jai-codec/1.1.3/ Jai-codec-1.1.3.jar
03.[debug] Reading Resolution tracking file C:\Documents and Settings\charles.wang\.m2\repository\com\sun\media\ jai-codec\1.1.3\jai-codec-1.1.3.jar.lastupdated
04.[debug] Writing resolution tracking file C:\Documents and Settings\charles.wang\.m2\repository\com\sun\media\ jai-codec\1.1.3\jai-codec-1.1.3.jar.lastupdated
05.[info]------------------------------------------------------------------------
06.[info] Build Failure
07.[info]------------------------------------------------------------------------
08.[info] Total time:2.015s
09.[info] finished At:sat June 18:26:20 CST 2012
10.[info] Final memory:5m/9m
11.[info]------------------------------------------------------------------------
12.[error] Failed to execute goal com.liferay.maven.plugins:liferay-maven-plugin:6.1.0:deploy (DEFAULT-CLI) on project Charles-portlet:execution Default-cli of goal Com.liferay.maven.plugins:liferay-maven-plugin:6.1.0:deploy failed: Plugin com.liferay.maven.plugins:liferay-maven-plugin:6.1.0 or one of its dependencies could not being resolved:could not fi nd artifact com.sun.media:jai-codec:jar:1.1.3 in Nexus (http://192.168.129.35:8080/nexus-2.0.4-1/content/groups/ public/)-> [Help 1]
13.org.apache.maven.lifecycle.lifecycleexecutionexception:failed to execute goal com.liferay.maven.plugins: Liferay-maven-plugin:6.1.0:deploy (DEFAULT-CLI) on project
Charles-portlet:execution Default-cli of goal Com.liferay.maven.plugins:liferay-maven-plugin:6.1.0:deploy failed: Plugin com.liferay.maven.plugins:liferay-maven-
plugin:6.1.0 or one of its dependencies could is resolved:could not find artifact I N Nexus (http://192.168.129.35:8080/nexus-
2.0.4-1/content/groups/public/)
At Org.apache.maven.lifecycle.internal.MojoExecutor.execute (mojoexecutor.java:225)
At Org.apache.maven.lifecycle.internal.MojoExecutor.execute (mojoexecutor.java:153)
At Org.apache.maven.lifecycle.internal.MojoExecutor.execute (mojoexecutor.java:145)
The reason for this error is that the Liferay version of the deployment (deploy) plug-in version is too new, and the plug-in relies on a jai-codec version of 1.3 jar package, but the jar package is not found in the default group public repositories. So that's the problem.