如何使用 Jenkins 安装 Log4perl 模块
How to install Log4perl module using Jenkins
我是 Jenkins 和 Perl 的新手,我正在尝试使用 Jenkin Job 安装 Log4perl 模块。下面是我在 Jenkin 的执行 shell 框
中使用的命令
perl -MCPAN -e 'install Log::Log4Perl'
下面是 Jenkin 控制台日志消息
12:44:49 PATH="/home/jenkins/perl5/bin${PATH:+:${PATH}}"; export PATH;
12:44:49 PERL5LIB="/home/jenkins/perl5/lib/perl5${PERL5LIB:+:${PERL5LIB}}"; export PERL5LIB;
12:44:49 PERL_LOCAL_LIB_ROOT="/home/jenkins/perl5${PERL_LOCAL_LIB_ROOT:+:${PERL_LOCAL_LIB_ROOT}}"; export PERL_LOCAL_LIB_ROOT;
12:44:49 PERL_MB_OPT="--install_base \"/home/jenkins/perl5\""; export PERL_MB_OPT;
12:44:49 PERL_MM_OPT="INSTALL_BASE=/home/jenkins/perl5"; export PERL_MM_OPT;
12:44:49
12:44:49 Would you like me to append that to /home/jenkins/.bashrc now? [yes] yes
12:44:49
12:44:49
12:44:49 commit: wrote '/home/jenkins/.cpan/CPAN/MyConfig.pm'
12:44:49
12:44:49 You can re-run configuration any time with 'o conf init' in the CPAN shell
12:44:49 Warning: Cannot install Log::Log4Perl, don't know what it is.
12:44:49 Try the command
12:44:49
12:44:49 i /Log::Log4Perl/
12:44:49
12:44:49 to find objects with matching identifiers.
12:44:52 [DEV_etl_europcar] $ /bin/sh -xe /tmp/hudson6339194449797505730.sh
12:44:52 Warning: you have no plugins providing access control for builds, so falling back to legacy behavior of permitting any downstream builds to be triggered
12:44:52 DEV_send_welcome_email is disabled. Triggering skipped
12:44:52 Finished: SUCCESS
在日志消息中说
Warning: Cannot install Log::Log4Perl, don't know what it is.
我不确定是否应该忽略上述声明。
还有如何确认log4perl模块是否安装成功。
您不应该依赖于能够在 Perl 中省略字符串周围的引号。 perl -MCPAN -e 'install Log::Log4Perl'
最好写成 perl -MCPAN -e 'install "Log::Log4Perl"'
(如果您尝试 install/update CPAN 本身加载的任何模块,省略引号也会导致奇怪的问题)。
无论如何都可以简化为cpan Log::Log4Perl
。
错误发生是因为Log::Log4Perl
确实不存在,但是Log::Log4perl
存在(小写p
)。
因此:cpan Log::Log4perl
应该做你想做的事。
关于您的其他问题:"Cannot install ..."表示安装失败(这不是您可以忽略的问题)。
要确认模块是否存在,请尝试加载它:perl -e 'require Log::Log4perl'
(如果不存在,您将得到 Can't locate Log/Log4perl.pm in @INC ...
)。
我是 Jenkins 和 Perl 的新手,我正在尝试使用 Jenkin Job 安装 Log4perl 模块。下面是我在 Jenkin 的执行 shell 框
中使用的命令perl -MCPAN -e 'install Log::Log4Perl'
下面是 Jenkin 控制台日志消息
12:44:49 PATH="/home/jenkins/perl5/bin${PATH:+:${PATH}}"; export PATH;
12:44:49 PERL5LIB="/home/jenkins/perl5/lib/perl5${PERL5LIB:+:${PERL5LIB}}"; export PERL5LIB;
12:44:49 PERL_LOCAL_LIB_ROOT="/home/jenkins/perl5${PERL_LOCAL_LIB_ROOT:+:${PERL_LOCAL_LIB_ROOT}}"; export PERL_LOCAL_LIB_ROOT;
12:44:49 PERL_MB_OPT="--install_base \"/home/jenkins/perl5\""; export PERL_MB_OPT;
12:44:49 PERL_MM_OPT="INSTALL_BASE=/home/jenkins/perl5"; export PERL_MM_OPT;
12:44:49
12:44:49 Would you like me to append that to /home/jenkins/.bashrc now? [yes] yes
12:44:49
12:44:49
12:44:49 commit: wrote '/home/jenkins/.cpan/CPAN/MyConfig.pm'
12:44:49
12:44:49 You can re-run configuration any time with 'o conf init' in the CPAN shell
12:44:49 Warning: Cannot install Log::Log4Perl, don't know what it is.
12:44:49 Try the command
12:44:49
12:44:49 i /Log::Log4Perl/
12:44:49
12:44:49 to find objects with matching identifiers.
12:44:52 [DEV_etl_europcar] $ /bin/sh -xe /tmp/hudson6339194449797505730.sh
12:44:52 Warning: you have no plugins providing access control for builds, so falling back to legacy behavior of permitting any downstream builds to be triggered
12:44:52 DEV_send_welcome_email is disabled. Triggering skipped
12:44:52 Finished: SUCCESS
在日志消息中说
Warning: Cannot install Log::Log4Perl, don't know what it is.
我不确定是否应该忽略上述声明。 还有如何确认log4perl模块是否安装成功。
您不应该依赖于能够在 Perl 中省略字符串周围的引号。
perl -MCPAN -e 'install Log::Log4Perl'
最好写成perl -MCPAN -e 'install "Log::Log4Perl"'
(如果您尝试 install/update CPAN 本身加载的任何模块,省略引号也会导致奇怪的问题)。无论如何都可以简化为
cpan Log::Log4Perl
。错误发生是因为
Log::Log4Perl
确实不存在,但是Log::Log4perl
存在(小写p
)。
因此:cpan Log::Log4perl
应该做你想做的事。
关于您的其他问题:"Cannot install ..."表示安装失败(这不是您可以忽略的问题)。
要确认模块是否存在,请尝试加载它:perl -e 'require Log::Log4perl'
(如果不存在,您将得到 Can't locate Log/Log4perl.pm in @INC ...
)。