日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

Liferay 用本地私服(nexus) 打包部署Portlet应用

發(fā)布時間:2023/12/6 编程问答 33 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Liferay 用本地私服(nexus) 打包部署Portlet应用 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

?當(dāng)我們使用搭建一個nexus本地倉庫,并且配置settings.xml來讓應(yīng)用啟用這個倉庫。我們使用Liferay 6.1.10的archetype來創(chuàng)建liferay portlet, 如下圖:

?

當(dāng)我們運(yùn)行命令mvn package liferay:deploy時,會出現(xiàn)以下錯誤:

  • [DEBUG]?Using?connector?WagonRepositoryConnector?with?priority?0?for?http://192.168.129.35:8080/nexus-2.0.4-1/content/groups/public/?
  • 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?
  • [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?
  • [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?
  • [INFO]?------------------------------------------------------------------------?
  • [INFO]?BUILD?FAILURE?
  • [INFO]?------------------------------------------------------------------------?
  • [INFO]?Total?time:?2.015s?
  • [INFO]?Finished?at:?Sat?Jun?01?18:26:20?CST?2012?
  • [INFO]?Final?Memory:?5M/9M?
  • [INFO]?------------------------------------------------------------------------?
  • [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?be?resolved:?Could?not?find?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]?
  • 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?not?be?resolved:?Could?not?find?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/)?
  • ??????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)?
  • ?

    這個錯誤的原因是,Liferay版本為6.1的部署(deploy)插件版本太新了,而這個插件依賴于jai-codec版本為1.3的jar包,但是這個jar包在默認(rèn)分組Public Repositories中找不到,所以出了這個問題。

    ?

    為了解決這個問題,我們找了下,發(fā)現(xiàn)這個jai-codec.jar是JBoss 社區(qū)的,所以,我們重新配置nexus倉庫,我們新建一個JBoss_Repository, 如下圖所示:(注意,我們必須開啟?Download Remote Indexes選項(xiàng))

    ?

    然后我們把新建的"JBoss Repository"加到"Public Repositories" 組中。

    ?

    最后,我們重新配置~/.m2目錄下的settings.xml,讓其開啟updatePolicy:

    如261和270行所示,當(dāng)把updatePolicy設(shè)為always時,構(gòu)建過程不會從cache中獲取artifact,而是總是直接更新artifact:

    ?

    最后,我們重新運(yùn)行?mvn package liferay: deploy?命令:

    ?

    可以看到這次 liferay:deploy過程不再有錯:

  • [DEBUG]?Verifying?availability?of?C:\Documents?and?Settings\charles.wang\.m2\repository\com\liferay\portal\portal-impl\6.1.0\portal-impl-6.1.0.pom?from?[nexus?(http://192.168.129.35:8080/nexus-2.0.4-1/content/groups/public/,?releases+snapshots)]?
  • [DEBUG]?Skipped?remote?update?check?for?com.liferay.portal:portal-impl:pom:6.1.0,?locally?cached?artifact?up-to-date.?
  • [DEBUG]?Using?connector?WagonRepositoryConnector?with?priority?0?for?http://192.168.129.35:8080/nexus-2.0.4-1/content/groups/public/?
  • Downloading:?http://192.168.129.35:8080/nexus-2.0.4-1/content/groups/public/com/liferay/portal/portal-impl/6.1.0/portal-impl-6.1.0.pom?
  • Downloaded:?http://192.168.129.35:8080/nexus-2.0.4-1/content/groups/public/com/liferay/portal/portal-impl/6.1.0/portal-impl-6.1.0.pom?(0?B?at?0.0?KB/sec)?
  • [DEBUG]?Reading?resolution?tracking?file?C:\Documents?and?Settings\charles.wang\.m2\repository\com\liferay\portal\portal-impl\6.1.0\portal-impl-6.1.0.pom.lastUpdated?
  • [DEBUG]?Writing?resolution?tracking?file?C:\Documents?and?Settings\charles.wang\.m2\repository\com\liferay\portal\portal-impl\6.1.0\portal-impl-6.1.0.pom.lastUpdated?
  • [DEBUG]?Verifying?availability?of?C:\Documents?and?Settings\charles.wang\.m2\repository\com\sun\media\jai-codec\1.1.3\jai-codec-1.1.3.pom?from?[nexus?(http://192.168.129.35:8080/nexus-2.0.4-1/content/groups/public/,?releases+snapshots)]?
  • [DEBUG]?Skipped?remote?update?check?for?com.sun.media:jai-codec:pom:1.1.3,?locally?cached?artifact?up-to-date.?
  • [DEBUG]?Using?connector?WagonRepositoryConnector?with?priority?0?for?http://192.168.129.35:8080/nexus-2.0.4-1/content/groups/public/?
  • 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.pom?
  • Downloaded:?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.pom?(0?B?at?0.0?KB/sec)?
  • [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.pom.lastUpdated?
  • [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.pom.lastUpdated?
  • [DEBUG]?Verifying?availability?of?C:\Documents?and?Settings\charles.wang\.m2\repository\javax\media\jai-core\1.1.3\jai-core-1.1.3.pom?from?[nexus?(http://192.168.129.35:8080/nexus-2.0.4-1/content/groups/public/,?releases+snapshots)]?
  • [DEBUG]?Using?connector?WagonRepositoryConnector?with?priority?0?for?http://192.168.129.35:8080/nexus-2.0.4-1/content/groups/public/?
  • Downloading:?http://192.168.129.35:8080/nexus-2.0.4-1/content/groups/public/javax/media/jai-core/1.1.3/jai-core-1.1.3.pom?
  • Downloaded:?http://192.168.129.35:8080/nexus-2.0.4-1/content/groups/public/javax/media/jai-core/1.1.3/jai-core-1.1.3.pom?(0?B?at?0.0?KB/sec)?
  • [DEBUG]?Reading?resolution?tracking?file?C:\Documents?and?Settings\charles.wang\.m2\repository\javax\media\jai-core\1.1.3\jai-core-1.1.3.pom.lastUpdated?
  • [DEBUG]?Writing?resolution?tracking?file?C:\Documents?and?Settings\charles.wang\.m2\repository\javax\media\jai-core\1.1.3\jai-core-1.1.3.pom.lastUpdated?
  • [ignore?some?output?here…]?
  • [DEBUG]?Verifying?availability?of?C:\Documents?and?Settings\charles.wang\.m2\repository\com\liferay\portal\portal-impl\6.1.0\portal-impl-6.1.0.jar?from?[nexus?(http://192.168.129.35:8080/nexus-2.0.4-1/content/groups/public/,?releases+snapshots)]?
  • [DEBUG]?Verifying?availability?of?C:\Documents?and?Settings\charles.wang\.m2\repository\com\sun\media\jai-codec\1.1.3\jai-codec-1.1.3.jar?from?[nexus?(http://192.168.129.35:8080/nexus-2.0.4-1/content/groups/public/,?releases+snapshots)]?
  • [DEBUG]?Verifying?availability?of?C:\Documents?and?Settings\charles.wang\.m2\repository\javax\media\jai-core\1.1.3\jai-core-1.1.3.jar?from?[nexus?(http://192.168.129.35:8080/nexus-2.0.4-1/content/groups/public/,?releases+snapshots)]?
  • [DEBUG]?Skipped?remote?update?check?for?com.liferay.portal:portal-impl:jar:6.1.0,?locally?cached?artifact?up-to-date.?
  • [DEBUG]?Skipped?remote?update?check?for?com.sun.media:jai-codec:jar:1.1.3,?locally?cached?artifact?up-to-date.?
  • [DEBUG]?Using?connector?WagonRepositoryConnector?with?priority?0?for?http://192.168.129.35:8080/nexus-2.0.4-1/content/groups/public/?
  • Downloading:?http://192.168.129.35:8080/nexus-2.0.4-1/content/groups/public/com/liferay/portal/portal-impl/6.1.0/portal-impl-6.1.0.jar?
  • 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?
  • Downloading:?http://192.168.129.35:8080/nexus-2.0.4-1/content/groups/public/javax/media/jai-core/1.1.3/jai-core-1.1.3.jar?
  • Downloaded:?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?(0?B?at?0.0?KB/sec)?
  • Downloaded:?http://192.168.129.35:8080/nexus-2.0.4-1/content/groups/public/javax/media/jai-core/1.1.3/jai-core-1.1.3.jar?(0?B?at?0.0?KB/sec)?
  • Downloaded:?http://192.168.129.35:8080/nexus-2.0.4-1/content/groups/public/com/liferay/portal/portal-impl/6.1.0/portal-impl-6.1.0.jar?(0?B?at?0.0?KB/sec)?
  • [DEBUG]?Reading?resolution?tracking?file?C:\Documents?and?Settings\charles.wang\.m2\repository\com\liferay\portal\portal-impl\6.1.0\portal-impl-6.1.0.jar.lastUpdated?
  • [DEBUG]?Writing?resolution?tracking?file?C:\Documents?and?Settings\charles.wang\.m2\repository\com\liferay\portal\portal-impl\6.1.0\portal-impl-6.1.0.jar.lastUpdated?
  • [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?
  • [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?
  • [DEBUG]?Reading?resolution?tracking?file?C:\Documents?and?Settings\charles.wang\.m2\repository\javax\media\jai-core\1.1.3\jai-core-1.1.3.jar.lastUpdated?
  • [DEBUG]?Writing?resolution?tracking?file?C:\Documents?and?Settings\charles.wang\.m2\repository\javax\media\jai-core\1.1.3\jai-core-1.1.3.jar.lastUpdated?
  • [ignore?some?output?here…]?
  • [DEBUG]?Configuring?mojo?com.liferay.maven.plugins:liferay-maven-plugin:6.1.0:deploy?from?plugin?realm?ClassRealm[plugin>com.liferay.maven.plugins:liferay-maven-plugin:6.1.0,?parent:?sun.misc.Launcher$AppClassLoader@11b86e7]?
  • [DEBUG]?Configuring?mojo?'com.liferay.maven.plugins:liferay-maven-plugin:6.1.0:deploy'?with?basic?configurator?-->?
  • [DEBUG]???(f)?autoDeployDir?=?D:\Liferay\RI\liferay-portal-6.1.0-ce-ga1\deploy?
  • [DEBUG]???(f)?warFile?=?D:\Charles\Eclipse_Workspace\charles-portlet\target\charles-portlet-0.0.1-SNAPSHOT.war?
  • [DEBUG]???(f)?warFileName?=?charles-portlet-0.0.1-SNAPSHOT.war?
  • [DEBUG]?--?end?configuration?--?
  • [INFO]?Deploying?charles-portlet-0.0.1-SNAPSHOT.war?to?D:\Liferay\RI\liferay-portal-6.1.0-ce-ga1\deploy?
  • [INFO]?------------------------------------------------------------------------?
  • [INFO]?BUILD?SUCCESS?
  • [INFO]?------------------------------------------------------------------------?
  • [INFO]?Total?time:?1:20.564s?
  • [INFO]?Finished?at:?Mon?Jun?04?09:18:13?CST?2012?
  • [INFO]?Final?Memory:?5M/11M?
  • [INFO]?------------------------------------------------------------------------?




  • 本文轉(zhuǎn)自 charles_wang888 51CTO博客,原文鏈接:http://blog.51cto.com/supercharles888/887784,如需轉(zhuǎn)載請自行聯(lián)系原作者

    總結(jié)

    以上是生活随笔為你收集整理的Liferay 用本地私服(nexus) 打包部署Portlet应用的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

    如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。