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

 当我们使用搭建一个nexus本地仓库,并且配置settings.xml来让应用启用这个仓库。我们使用Liferay 6.1.10的archetype来创建liferay portlet, 如下图:

 

当我们运行命令mvn package liferay:deploy时,会出现以下错误:

 
  1. [DEBUG] Using connector WagonRepositoryConnector with priority 0 for http://192.168.129.35:8080/nexus-2.0.4-1/content/groups/public
  2. 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 
  3. [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 
  4. [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 
  5. [INFO] ------------------------------------------------------------------------ 
  6. [INFO] BUILD FAILURE 
  7. [INFO] ------------------------------------------------------------------------ 
  8. [INFO] Total time: 2.015s 
  9. [INFO] Finished at: Sat Jun 01 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 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] 
  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 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/) 
  14.       at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:225) 
  15.       at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153) 
  16.       at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145) 

 

这个错误的原因是,Liferay版本为6.1的部署(deploy)插件版本太新了,而这个插件依赖于jai-codec版本为1.3的jar包,但是这个jar包在默认分组Public Repositories中找不到,所以出了这个问题。

 

为了解决这个问题,我们找了下,发现这个jai-codec.jar是JBoss 社区的,所以,我们重新配置nexus仓库,我们新建一个JBoss_Repository, 如下图所示:(注意,我们必须开启 Download Remote Indexes选项)

 

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

 

最后,我们重新配置~/.m2目录下的settings.xml,让其开启updatePolicy:

如261和270行所示,当把updatePolicy设为always时,构建过程不会从cache中获取artifact,而是总是直接更新artifact:

 

最后,我们重新运行 mvn package liferay: deploy 命令:

 

可以看到这次 liferay:deploy过程不再有错:

 
  1. [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)] 
  2. [DEBUG] Skipped remote update check for com.liferay.portal:portal-impl:pom:6.1.0, locally cached artifact up-to-date
  3. [DEBUG] Using connector WagonRepositoryConnector with priority 0 for http://192.168.129.35:8080/nexus-2.0.4-1/content/groups/public
  4. 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 
  5. 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) 
  6. [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 
  7. [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 
  8. [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)] 
  9. [DEBUG] Skipped remote update check for com.sun.media:jai-codec:pom:1.1.3, locally cached artifact up-to-date
  10. [DEBUG] Using connector WagonRepositoryConnector with priority 0 for http://192.168.129.35:8080/nexus-2.0.4-1/content/groups/public
  11. 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 
  12. 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) 
  13. [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 
  14. [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 
  15. [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)] 
  16. [DEBUG] Using connector WagonRepositoryConnector with priority 0 for http://192.168.129.35:8080/nexus-2.0.4-1/content/groups/public
  17. 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 
  18. 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) 
  19. [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 
  20. [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 
  21. [ignore some output here…] 
  22. [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)] 
  23. [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)] 
  24. [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)] 
  25. [DEBUG] Skipped remote update check for com.liferay.portal:portal-impl:jar:6.1.0, locally cached artifact up-to-date
  26. [DEBUG] Skipped remote update check for com.sun.media:jai-codec:jar:1.1.3, locally cached artifact up-to-date
  27. [DEBUG] Using connector WagonRepositoryConnector with priority 0 for http://192.168.129.35:8080/nexus-2.0.4-1/content/groups/public
  28. 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 
  29. 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 
  30. 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 
  31. 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) 
  32. 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) 
  33. 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) 
  34. [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 
  35. [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 
  36. [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 
  37. [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 
  38. [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 
  39. [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 
  40. [ignore some output here…] 
  41. [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] 
  42. [DEBUG] Configuring mojo 'com.liferay.maven.plugins:liferay-maven-plugin:6.1.0:deploy' with basic configurator --> 
  43. [DEBUG]   (f) autoDeployDir = D:\Liferay\RI\liferay-portal-6.1.0-ce-ga1\deploy 
  44. [DEBUG]   (f) warFile = D:\Charles\Eclipse_Workspace\charles-portlet\target\charles-portlet-0.0.1-SNAPSHOT.war 
  45. [DEBUG]   (f) warFileName = charles-portlet-0.0.1-SNAPSHOT.war 
  46. [DEBUG] -- end configuration -- 
  47. [INFO] Deploying charles-portlet-0.0.1-SNAPSHOT.war to D:\Liferay\RI\liferay-portal-6.1.0-ce-ga1\deploy 
  48. [INFO] ------------------------------------------------------------------------ 
  49. [INFO] BUILD SUCCESS 
  50. [INFO] ------------------------------------------------------------------------ 
  51. [INFO] Total time: 1:20.564s 
  52. [INFO] Finished at: Mon Jun 04 09:18:13 CST 2012 
  53. [INFO] Final Memory: 5M/11M 
  54. [INFO] ------------------------------------------------------------------------ 




本文转自 charles_wang888 51CTO博客,原文链接:http://blog.51cto.com/supercharles888/887784,如需转载请自行联系原作者

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/286051.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

.NET Core 分布式事务 CAP 发布 6.1 正式版

前言我们很高兴宣布 CAP 发布 6.1 版本正式版,在这个版本中我们主要针对目前已经发现的几个BUG进行了修复了以及添加了一些小特性。那么,接下来我们具体看一下吧。总览可能有些人还不知道 CAP 是什么,老规矩来一个简介。CAP地址:h…

【MATLAB统计分析与应用100例】案例016:matlab读取Excel数据,进行样品系统聚类分析

1. 聚类分析结果 2. matlab完整代码 (1)读取数据,并进行标准化 [X,textdata] = xlsread(examp09_02.xls); % 从Excel文件中读取数据 X = zscore(X

解决React Native报错:Error:Found unexpected optical bounds (red pixel)

问题背景 同样是在升级 gradle plugin V2.2.3 --> gradle plugin V3.0.1后,运行至打包APK期间报错: Error:found unexpected optical bounds (red pixel) on top border at x14.(错误:在X14的上边框上发现意外的光学边界&am…

C语言试题五十六之计算并输出给定整数n的所有因子(不包括1与自身)之和。规定n的值不大于1000。

📃个人主页:个人主页 🔥系列专栏:C语言试题200例目录 💬推荐一款刷算法、笔试、面经、拿大公司offer神器 👉 点击跳转进入网站 ✅作者简介:大家好,我是码莎拉蒂,CSDN博客专家(全站排名Top 50),阿里云博客专家、51CTO博客专家、华为云享专家 1、题目 请编写函数…

webpack 入门

什么是WebPack,为什么要使用它? 为什要使用WebPack 现今的很多网页其实可以看做是功能丰富的应用,它们拥有着复杂的JavaScript代码和一大堆依赖包。为了简化开发的复杂度,前端社区涌现出了很多好的实践方法 模块化,让我…

mysql 列类型

列类型整型 tinyint,smallint,mediumint,int,bigint (可选参数unsigned ,(M,zerofill,结合使用才有意义))浮点型 float(可选参数D,M) decimal(可选参数D,M)字…

使用vsftp虚拟用户实现安全访问控制

一、ftp连接方式 1、命令连接 ftp在与用户交互时,首先打开的是TCP的21号端口,建立命令连接,这个连接会始终存在,直到用户输入bye的那一刻,才断开命令连接。 2、数据连接 1)主动连接 主动连接是基于TCP21号端…

【前端就业课 第二阶段】CSS 零基础到实战(04)定位

若是大一学子或者是真心想学习刚入门的小伙伴可以私聊我,若你是真心学习可以送你书籍,指导你学习,给予你目标方向的学习路线,无套路,博客为证。 一、定位 定位分为相对定位以及绝对定位。 相对定位可以理解为在 HTM…

Android TextView设置ClickableSpan 点击结尾空白位置也响应点击的问题

解决办法,在后边紧接着追加一个0宽度字符: builder.append("\u200b"); 相关知识: “\u200b” 为 Unicode Character ‘ZERO WIDTH SPACE’ (U200B),可用于内容标识,不占位数(宽度0&#xff0…

【MATLAB统计分析与应用100例】案例017:matlab读取Excel数据,进行变量系统聚类分析

1. 变量系统聚类分析结果 2. matlab完整代码 (1)读取数据,并转为距离向量 [X,textdata] = xlsread(examp09_03.xls); % 从Excel文件中读取数据 y = 1 -

WinForm 之 窗口最小化到托盘及右键图标显示菜单

日常开发有时候需要实现窗口最小化到系统托盘,本文就来讲讲该如何实现winfrom最小化到系统托盘,本例子基于VS2019编写。用C#开发winform桌面程序时,程序启动后,默认是显示在桌面而且在任务栏中有对应的图标。有的时候,…

C语言学习笔记--函数与指针

1. 函数类型 (1)C 语言中的函数有自己特定的类型,这个类型由返回值、参数类型和参数个数共同决定。如 int add(int i,int j)的类型为 int(int,int)。 (2)C 语言中通过 typedef 为函数类型重命名 typedef type name(parameter list);//如 typedef int f(int,int); 2. 函数指针 (…

C语言试题五十七之假定输入的字符串中只包含字母和*号。请编写函数function,它的功能是:删除字符串中所有*号。在编写函数时,不得使用c语言提供的字符串函数。

📃个人主页:个人主页 🔥系列专栏:C语言试题200例目录 💬推荐一款刷算法、笔试、面经、拿大公司offer神器 👉 点击跳转进入网站 ✅作者简介:大家好,我是码莎拉蒂,CSDN博客专家(全站排名Top 50),阿里云博客专家、51CTO博客专家、华为云享专家 1、题目 假定输入的…

Wordpress:将图片、post等的URL转换为相对路径

2019独角兽企业重金招聘Python工程师标准>>> 例如上传一张图片,其地址是可能 http://127.0.0.1/wp-content/uploads/2015/12/1_.png, 问题是如果我们通过其他的电脑通过wordpress主机的公网IP访问这张图片时会提示找不到。 最好的处理方法是不…

MySQL数据库的优化(下)MySQL数据库的高可用架构方案

【51CTO独家特稿】如果单MySQL的优化始终还是顶不住压力时,这个时候我们就必须考虑MySQL的高可用架构(很多同学也爱说成是MySQL集群)了,目前可行的方案有:一、MySQL Cluster 优势:可用性非常高,性能非常好。每份数据至…

【MATLAB统计分析与应用100例】案例018:matlab读取Excel数据,进行K均值聚类分析

文章目录 1. K均值聚类分析结果2. matlab完整代码(1)读取数据,并进行标准化变换(2)选取初始凝聚点,进行聚类(3)绘制轮廓图1. K均值聚类分析结果 2. matlab完整代码 (1)读取数据,并进行标准化变换 [X, textdata] = xlsread(examp09_04.xls

C# 扩展object类 将string强制转换成int

扩展代码&#xff1a; public static class ClassExtend{/// <summary>/// 将object强制转化为int/// </summary>/// <param name"o">要强制转换的object</param>/// <param name"defaultValue">o为null或者转换失败的默认值…

Android之华为手机打开app奔溃提示java.io.FileNotFoundException: res/drawable/abc_vector_test.xml

1、问题 新建立的项目,华为手机运行起来提示如下 06-24 18:24:03.175 13314 13314 E AndroidRuntime: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.appsinnova.android.booming/com.appsinnova.android.picper.MainActivity}: android.content…

CSS 零基础到实战(05)布局、盒子模型、弹性盒子【前端就业课 第二阶段】

若是大一学子或者是真心想学习刚入门的小伙伴可以私聊我&#xff0c;若你是真心学习可以送你书籍&#xff0c;指导你学习&#xff0c;给予你目标方向的学习路线&#xff0c;无套路&#xff0c;博客为证。 一、流动布局 流动布局有3种布局模型&#xff0c;分别是流动布局&…

DVWA系列之24 high级别上传漏洞

最后再来分析high级别的代码&#xff1a;这里首先有一条语句需要理解&#xff1a;$uploaded_ext substr($uploaded_name, strrpos($uploaded_name, .) 1);在这条语句里&#xff0c;首先利用strrpos() 函数来查找“.”在变量$uploaded_name中出现的位置&#xff0c;然后将得到…