Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Johnathan Burbea
mvn:liferay goals not working...No plugin found for prefix 'liferay' in the
March 1, 2013 1:08 PM
Answer

Johnathan Burbea

Rank: Junior Member

Posts: 39

Join Date: April 5, 2012

Recent Posts

I cant get either mvn liferay:deploy or mvn liferay:build-service to work with my local nexus. I followed the maven plugin development guide online:

http://www.liferay.com/documentation/liferay-portal/6.1/development/-/ai/developing-plugins-using-maven

Failed to execute goal com.liferay.maven.plugins:liferay-maven-plugin:6.1.1:build-service (default-cli) on proje
ct sample-service-portlet: Execution default-cli of goal com.liferay.maven.plugins:liferay-maven-plugin:6.1.1:build-serv
ice failed: Plugin com.liferay.maven.plugins:liferay-maven-plugin:6.1.1 or one of its dependencies could not be resolved
: Failure to find com.sun.media:jai-codec:jar:1.1.3 in http://localhost:8081/nexus/content/groups/public was cached in t
he local repository, resolution will not be reattempted until the update interval of nexus has elapsed or updates are fo
rced -> [Help 1]

Mika please help?
Attachments: parent.pom.xml (2.2k), pom.xml (4.3k), settings.xml (0.5k)
Johnathan Burbea
RE: mvn:liferay goals not working...Failure to find com.sun.media:jai-codec
March 1, 2013 7:59 AM
Answer

Johnathan Burbea

Rank: Junior Member

Posts: 39

Join Date: April 5, 2012

Recent Posts

Mika anyone please help?
Neil Griffin
RE: mvn:liferay goals not working...Failure to find com.sun.media:jai-codec
March 1, 2013 8:03 AM
Answer

Neil Griffin

LIFERAY STAFF

Rank: Liferay Legend

Posts: 2179

Join Date: July 26, 2005

Recent Posts

Whenever I see the error message "was cached in the local repository, resolution will not be reattempted ..." I find that I need to go into the maven repository and delete the artifact files. Then "mvn clean install" seems to work properly. That seems to work with a local $HOME/.m2/repository scenario, but I don't know if that will help with Nexus.
Cody Hoag
RE: mvn:liferay goals not working...Failure to find com.sun.media:jai-codec
March 1, 2013 9:47 AM
Answer

Cody Hoag

LIFERAY STAFF

Rank: New Member

Posts: 20

Join Date: April 26, 2012

Recent Posts

Hey J.B.,

The problem is that you're referencing the public repository in your Nexus for dependencies. This is fine when that repository is up to date, but from the looks of your error log, it can't find a dependency. If you remove the <mirrors>....</mirrors> section from your settings.xml, the POM will download the dependencies from the Central Maven Repository. Once it's downloaded, it'll update your local repository in .m2/repository and be able to reference the required dependencies to deploy the plugin to Liferay.
Johnathan Burbea
RE: mvn:liferay goals not working...Failure to find com.sun.media:jai-codec
March 1, 2013 1:05 PM
Answer

Johnathan Burbea

Rank: Junior Member

Posts: 39

Join Date: April 5, 2012

Recent Posts

Hi Cody,

I took the mirrors out of the settings.xml and get this exception--"No plugin found for prefix 'liferay' in the current project and in the plugin groups".

What am I doing wrong??

PS C:\liferay_maven_project\sample-parent-project> mvn liferay:deploy
Scanning for projects...
------------------------------------------------------------------------
Reactor Build Order:

sample-parent-project
sample-portlet Portlet
Downloading: http://repo.maven.apache.org/maven2/org/codehaus/mojo/maven-metadata.xml
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-metadata.xml
Downloaded: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-metadata.xml (11 KB at 52.1 KB/sec)
Downloaded: http://repo.maven.apache.org/maven2/org/codehaus/mojo/maven-metadata.xml (22 KB at 103.5 KB/sec)
------------------------------------------------------------------------
Reactor Summary:

sample-parent-project ............................. SKIPPED
sample-portlet Portlet ............................ SKIPPED
------------------------------------------------------------------------
BUILD FAILURE
------------------------------------------------------------------------
Total time: 0.889s
Finished at: Fri Mar 01 15:56:47 EST 2013
Final Memory: 5M/182M
------------------------------------------------------------------------
No plugin found for prefix 'liferay' in the current project and in the plugin groups [org.apache.maven.plugins,
org.codehaus.mojo] available from the repositories [local (C:\Users\jb\.m2\repository), central (http://repo.maven.apach
e.org/maven2)] -> [Help 1]

To see the full stack trace of the errors, re-run Maven with the -e switch.
Re-run Maven using the -X switch to enable full debug logging.

For more information about the errors and possible solutions, please read the following articles:
[Help 1] http://cwiki.apache.org/confluence/display/MAVEN/NoPluginFoundForPrefixException
PS C:\liferay_maven_project\sample-parent-project>
Cody Hoag
RE: mvn:liferay goals not working...Failure to find com.sun.media:jai-codec
March 1, 2013 1:45 PM
Answer

Cody Hoag

LIFERAY STAFF

Rank: New Member

Posts: 20

Join Date: April 26, 2012

Recent Posts

Make sure you're in your sample-portlet directory. I see you're still in the sample-parent-project directory, which will give that error because you're not deploying a liferay plugin.
Johnathan Burbea
RE: mvn:liferay goals not working...Failure to find com.sun.media:jai-codec
March 1, 2013 1:57 PM
Answer

Johnathan Burbea

Rank: Junior Member

Posts: 39

Join Date: April 5, 2012

Recent Posts

indeed that worked...

Downloading: http://repository.jboss.org/nexus/content/groups/public/com/sun/media/jai-codec/1.1.3/jai-codec-1.1.3.jar
Downloading: http://repository.jboss.org/nexus/content/groups/public/javax/media/jai-core/1.1.3/jai-core-1.1.3.jar
Downloaded: http://repository.jboss.org/nexus/content/groups/public/com/sun/media/jai-codec/1.1.3/jai-codec-1.1.3.jar (2
53 KB at 129.3 KB/sec)
Downloaded: http://repository.jboss.org/nexus/content/groups/public/javax/media/jai-core/1.1.3/jai-core-1.1.3.jar (1857
KB at 374.1 KB/sec)
...
Loading jar:file:/C:/Users/jb/.m2/repository/com/liferay/portal/portal-impl/6.1.1/portal-impl-6.1.1.jar!/portal.properties
Deploying sample-portlet-1.0-SNAPSHOT.war to C:\liferay-portal-6.1.1-ce-ga2\deploy
------------------------------------------------------------------------
BUILD SUCCESS
------------------------------------------------------------------------
Total time: 24.757s
Finished at: Fri Mar 01 16:50:04 EST 2013
Final Memory: 12M/179M
------------------------------------------------------------------------
PS C:\liferay_maven_project\sample-parent-project\sample-portlet>

Next question should I turn the mirrors back on in the settings.xml? How do I get these plugins to work with nexus snapshot and the ce 6.1.1 ga2 release artifacts.

What are the other maven goals I should try?

mvn -P build-service package
mvn liferay:build-service
mvn compile
mvn package
mvn install
mvn deploy
mvn liferay:deploy

DBBuilder - build-db goal allows you to execute the DBBuilder to generate SQL files
SassToCSSBuilder - build-css goal precompiles SASS in your css and this goal has been added to theme archetype

I really appreciate your direction Cody...I am following the documentation closely
Cody Hoag
RE: mvn:liferay goals not working...Failure to find com.sun.media:jai-codec
March 2, 2013 11:36 AM
Answer

Cody Hoag

LIFERAY STAFF

Rank: New Member

Posts: 20

Join Date: April 26, 2012

Recent Posts

Glad you got that working!

You don't necessarily have to put the mirrors back. It really depends on what you're trying to accomplish by using Maven. A great use of the mirrors is if you're referencing something that another developer/company has created and is not available from the Maven Central Repo. If you're just creating basic Liferay archetypes, using the Maven Central Repo is usually sufficient.

You can send a plugin like your sample-portlet to your Nexus release and snapshot repositories by typing mvn deploy. It looks like you have your sample-portlet's pom.xml and settings.xml configured to do this. Note that release repositories, by default, don't allow redeployments after its initial install. You'll need to change that in the release repo's Configuration menu (if you've already deployed stuff there). Also, since you specified in your pom.xml its version as <version>1.0-SNAPSHOT</version>, it's is not compatible with a release repo.
Vitesh Shah
RE: mvn:liferay goals not working...Failure to find com.sun.media:jai-codec
July 29, 2013 3:15 PM
Answer

Vitesh Shah

Rank: New Member

Posts: 1

Join Date: July 15, 2013

Recent Posts

Hello Cody,

I removed the <mirrors> from my settings.xml, but still I am getting the error as 'Could not find goal 'Deploy' in plugin com.liferay.maven.plugins:liferay-maven-plugin:6.1.20 among available goals direct-deploy, build-css, build-thumbnail, build-service, build-db, build-lang, build-ext, deploy, theme-merge, build-wsdd -> [Help 1]'

Any idea why?

Thanks in advance,
Vitesh
Cody Hoag
RE: mvn:liferay goals not working...Failure to find com.sun.media:jai-codec
July 29, 2013 5:46 PM
Answer

Cody Hoag

LIFERAY STAFF

Rank: New Member

Posts: 20

Join Date: April 26, 2012

Recent Posts

Hi Vitesh,

Did you capitalize "Deploy" when you ran the command? I was able to reproduce your error message by running mvn liferay: Deploy. It needs to be lower-case "deploy". The error message indicates that the deploy goal is available, so it should work.