jenkins-mailer-plugin 相关问题


如何创建安装git和jenkins的Dockerfile?

背景信息 我计划创建两个容器。 容器 1 将安装 Jenkins 和 Git。将 Git 与 Jenkins 一起安装的目的是这样我可以在“S...


从给定的 Jenkins 视图/选项卡禁用所有 Jenkins 作业

我在 Jenkins 中创建的名为“Gradle Deploys”的视图之一中有大约 100-120 个作业。如何仅从给定的视图/选项卡禁用 Jenkins 的所有作业。 我尝试了以下方法...


如何将 SonarCloud 与 GitHub 和 Jenkins 集成

我刚刚完成了 GitHub 与 Jenkins 的集成,这样每次我将代码提交到 GitHub 存储库时,Jenkins 都会自动构建。 现在我也在尝试集成 SonarCloud,但我还没有...


如何用docker搭建一个安装了git的jenkins代理节点

我用 docker 构建了我的 Jenkins 代理节点 詹金斯_巴塞罗那_节点: 图片:jenkins/ssh-agent:jdk11 特权:真实 用户:根 组添加: - “998” 取决于...


Rootless docker run -u $CURRENT_USER 但是安装仍然以 root 身份安装

我正在尝试设置 Jenkins 实例以无根运行 docker 容器。 当 jenkins 启动容器时,-u is 标志会与 jenkins 运行程序的 id 一起传递。 跑步者的名字是“


在 Jenkins 管道中使用“docker buildx build”时出现“未知标志:--platform”

我使用的是RedHat-7系统。我希望通过 Jenkins Pipeline 来实施 DevOps。 但是当我使用 docker buildx 构建功能时,Jenkins 说“未知标志:--platform”。 我运行我的詹金斯......


Jenkins 中缺少配置全局安全性

我是 Jenkins 管理员,但是,我找不到配置全局安全性。 我尝试将 Jenkins 更新到最新版本但无济于事。我在网上搜索解决方案但找不到任何解决方案......


Jenkins 正在删除代理上的工作区

Jenkins 将在 30 天或每月 30 天后删除代理/节点上的工作区。查看位于以下位置的詹金斯文件夹后 /var/lib/jenkins/日志/任务 我在这里找到了名为 Workspace\ c...


清理用作 Jenkins 代理的 docker 镜像?

我在 Jenkins 中使用以下声明性管道: 管道{ 代理任何 阶段{ 阶段('构建图像'){ 脚步 { sh“docker build -t my_tag ${


Php 邮件程序类无法在 Ubuntu 数字海洋服务器上运行

Php 邮件程序类的状态为 true,但未在 Ubuntu 数字海洋服务器上发送电子邮件。 我正在使用 php 版本 7.4 和 php mailer 类版本 5.1 $email_body = "请验证您的帐户...


Prometheus 目标返回 http 状态 404 未找到

我想将 Jenkins 与 Prometheus 集成,并在 Jenkins 上安装 Prometheus 插件,并在 Prometheus 中设置以下配置。 Prometheus 上的目标显示“服务器重新...


当位于公司代理后面时,Jenkins 插件存储库作为代理存储库

有没有一种方法或工具可以让我将 jenkins 插件站点设置为代理存储库,以便在 Jenkins 中我可以从代理存储库而不是原始站点获取插件更新? 问题


通过 github 操作创建 EC2 AMI 时出现错误:exec: "session-manager-plugin": $PATH 中找不到可执行文件

==> learn-packer.amazon-ebs.ubuntu:exec:“session-manager-plugin”:在 $PATH 中找不到可执行文件 learn-packer.amazon-ebs.ubuntu:启动 portForwarding 会话“Amy-


Maven-shade-plugin 检测到某些类文件存在于两个或多个 JAR 中

我正在尝试使用 maven-shade-plugin,但收到警告: javafx-controls-18.0.1-win.jar,javafx-graphics-18.0.1-win.jar, javafx-media-18.0.1-win.jar、javafx-web-18.0.1-win.jar 定义 1 覆盖...


检查 Jenkins 节点是否在线,否则发送电子邮件警报

将 Jenkins 作业专用于特殊节点,如果作业因节点离线而无法运行,我希望收到通知。可以设置这个功能吗? 换句话说,


Jenkins 身份文件无法访问

我对 Jenkins 和 DevOps 总体来说是新手。我正在尝试学习将 war 文件部署到在亚马逊 EC2 实例上运行的 Tomcat 9.xx 上。可以通过浏览器访问Tomcat 我有以下


使用 -u 1000:1000 选项进行 docker run 时,Jenkins docker sudo 错误

我有一个 docker 映像,可以在使用以下 DockerFile 创建的 Jenkins 管道中使用: # 根据 来自 ros:noetic # 用户 工作目录/home/用户 运行 useradd --create-home --shell /bin/bash 用户 \ &a...


使用终端和集成终端(IntelliJ IDE CE)安装jenkins有什么区别?

我一直在努力了解这个 Jenkins 开源。我以前从未使用过詹金斯。使用 IntelliJ IDE 安装它后,我意识到在安装它之前,您需要 ins...


jenkins 构建报告成功,但无法访问该站点

这些是我的 jenkins 执行 shell 命令来构建 nextjs hello world 应用程序并部署在本地计算机的不同目录中。 詹金斯外壳命令 这是控制台输出 这是


多次`maven-jar-plugin`执行导致编译问题

我有一个多模块Maven项目: 项目根目录 模块:主应用程序 模块:附加模块 - 取决于主应用程序 我正在使用 maven-jar-plugin 来编译额外的 JAR 文件


在 Jenkins 中部署 Angular 应用程序

我已经在 Jenkins 中为 Angular 应用程序创建了构建阶段,该阶段是成功的。我的要求是我需要将它部署到我随身携带的 Linux 服务器上,并且应用程序应该得到


如何强制 Jenkins 的 Maven 在缓存错误后更新 Maven 依赖项

我遇到了一个问题,我尝试在 Jenkins 上运行 Maven 作业,但在执行过程中,防火墙阻止了对 mvn 存储库的访问;这导致 Maven 更新时出现错误


Jenkinsfile / recordIssues 从文件创建“过滤器”数组

我们使用“Warnings Next Generation Plugin”中的 recordIssues 来可视化 Trivy-Dockerimage-Scanner“aquasec/trivy”生成的结果。这个工具可以...


未找到巢/招摇

错误“@nestjs/swagger/plugin”找不到插件! 启动我的 Nestjs 项目时出现此错误。我不知道出了什么问题。 Nestjs/swagger 包已安装。


Docker:如何提取特定的构建 ID?

我希望始终提取特定版本,而不仅仅是最新版本。 一个随机示例:https://registry.hub.docker.com/u/aespinosa/jenkins/builds_history/9511/ 我这样做是因为我...


使用 Jenkins 时 AWS CLI 无法加载凭证

我有 EC2,我已使用 xxxjenkins 用户安装了 AWS CLI。以下是我安装 awscli 所遵循的步骤: 卷曲“https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip”-o“awscliv2.z...


如何解决Eslint插件歧义?

我有一个 eslint 配置,它扩展了其他一些配置。这些包依赖于“@typescript/eslint-plugin”,但它们使用不同的版本。 扩展:['airbnb', 'airbnb-typescript', '@some-p...


无法在jenkins中保存系统文件

每当我保存系统文件(在管理詹金斯下)时,我都会遇到此错误。日志中是这么说的。 2024 年 1 月 5 日上午 6:49:08 警告 hudson.init.impl.InstallUncaughtExceptionHandler


如何停止maven输出“[警告]配置选项'appendAssemblyId'设置为false。”?

我有一个生成jar的maven项目,但没有附加maven-assemble-plugin的appendAssemblyId。 如何让 Maven 停止发出警告:“配置选项‘appendAssemblyId’已设置...


Laravel 10 Vite“npm run build”创建空文件

由于某种原因,运行该命令时,某些脚本会编译,而某些脚本的内容会被“删除”。这是我的 vite.config.js 文件: 从“laravel-vite-plugin”导入 laravel; 导入vu...


从共享库jenkins调用函数

我正在实现一个共享库项目(a),我想从另一个共享库项目调用函数(b)。 首先我想测试一下是否可以这样做。这就是为什么我添加了...


Maven:无法找到或加载主类

我制作了第一个 Spring 应用程序,现在我需要将其打包到 jar 文件中进行部署。在 pom.xml 中,我指定了 maven-jar-plugin 以便自动创建清单文件......


Kotlin/Spring Boot 应用程序无法使用 Docker 在 Maven 中构建

我正在尝试为 Kotlin/Spring Boot 应用程序构建一个映像。但是当我运行 docker build 时出现以下错误: [错误] 无法执行目标 org.jetbrains.kotlin:kotlin-maven-plugin:1.7.20:


即使我添加 UTF-8,Jenkins 控制台与 Postman 的编码问题

詹金斯控制台1 当我尝试在詹金斯上使用 newman 执行邮递员集合时,控制台输出不可读。我做了一些研究,发现我应该在


如何修复“在索引 0 处找到带有非文字参数的 fs.readFile”?

我正在尝试在 TypeScript 项目中添加 eslint-plugin-security。然而,对于这些代码 从 'fs' 导入 { Promise as fsp }; 从 'fs' 导入 fs; 从“路径”导入路径; 常量索引=等待...


如何从容器内部获取环境变量作为 Jenkinsfile 变量?

我们有多个 Jenkins ssh 代理、多个具有不同 jdk 版本的构建容器,并且容器使用 java 将内容(声纳结果等)发布到其他服务器。 容器需要真正...


添加plugin:@typescript-eslint/recommended-requiring-type-checking后,提示tsconfig中未包含该文件

我用 npx create-react-app my-app --template typescript 创建一个项目,然后我向其中添加打字稿类型检查,但我的 App.tsx 报告以下错误: 解析错误:ESLint 已配置...


如何在堆叠条上同时显示数据标签和总和

我尝试在堆叠条形图中同时显示数据标签和总和。 我使用 Chartjs-plugin-datalabels.js 来显示数据标签或总和。 上面只是带有数据标签: 以上只是机智...


无法解析 org.apache.maven.plugins 的插件描述符:maven-resources-plugin:2.4.3.. 打开 zip 文件时出错

我正在使用maven构建和编译一个spring项目,这是我收到的错误“打开zip文件时出错”。我在此处附加了 settings.xml 以表明我配置了 p...


有时候,embedded-redis(lettuce)在测试中不断尝试重新连接

我已经用嵌入式redis编写了redis测试用例,并且在本地运行良好,没有任何问题。但是当我使用 jenkins 或 gitlab 迁移到 CI / CD 管道时。有时,我面临连接问题...


警告:尝试在已经呈现的 <UINavigationController> 上呈现 <RNNSideMenuController> <RCTModalHostViewController>

我正在使用应用内支付-react-native-plugin插件将Square支付方法集成到react native中。在 iOS 中,如果在添加新卡反应本机 p 上打开卡输入模型,则会产生问题...


如何使用webpack 5向脚本标签添加nonce属性

我使用 webpack 5 和 HtmlWebpackPlugin 来构建我的前端 SPA。 我需要向 添加随机数属性 <question vote="0"> <p>我正在使用 webpack 5 和 <pre><code>HtmlWebpackPlugin</code></pre> 来构建我的前端 SPA。</p> <p>我需要将 <pre><code>nonce</code></pre> 属性添加到 <pre><code>&lt;script ...</code></pre> 注入的 <pre><code>HtmlWebpackPlugin</code></pre> 标签中。</p> <p>我该怎么做?</p> <p>额外问题:之后我在服务之前使用此页面作为 Thymeleaf 模板。如何注入<pre><code>nonce</code></pre>值?</p> </question> <answer tick="false" vote="0"> <p>如果您使用的是 webpack 4,海里有很多鱼——只需使用任何注入属性的插件,例如 <a href="https://github.com/numical/script-ext-html-webpack-plugin" rel="nofollow noreferrer">script-ext-html-webpack-plugin</a> 或 <a href="https://github.com/dyw934854565/html-webpack-inject-attributes-plugin" rel="nofollow noreferrer">html-webpack-inject-attributes-plugin</a> </p> <p>但是,上面提到的大多数插件都不适用于 webpack 5。解决方法是使用 <pre><code>HtmlWebpackPlugin</code></pre> <a href="https://github.com/jantimon/html-webpack-plugin#writing-your-own-templates" rel="nofollow noreferrer">templates</a>。</p> <ol> <li>将<pre><code>inject</code></pre>中指定的<pre><code>false</code></pre>选项中的<pre><code>HtmlWebpackPlugin</code></pre>设置为<pre><code>webpack.config</code></pre>。</li> <li>在模板中添加以下代码,将所有生成的脚本插入到结果文件中:</li> </ol> <pre><code> &lt;% for (key in htmlWebpackPlugin.files.js) { %&gt; &lt;script type=&#34;text/javascript&#34; defer=&#34;defer&#34; src=&#34;&lt;%= htmlWebpackPlugin.files.js[key] %&gt;&#34;&gt;&lt;/script&gt; &lt;% } %&gt; </code></pre> <ol start="3"> <li>在 <pre><code>script</code></pre> 中添加所有必要的属性。百里香示例:</li> </ol> <pre><code> &lt;% for (key in htmlWebpackPlugin.files.js) { %&gt; &lt;script type=&#34;text/javascript&#34; defer=&#34;defer&#34; th:attr=&#34;nonce=${cspNonce}&#34; src=&#34;&lt;%= htmlWebpackPlugin.files.js[key] %&gt;&#34;&gt;&lt;/script&gt; &lt;% } %&gt; </code></pre> <p>基于 <a href="https://github.com/jantimon/html-webpack-plugin/issues/538#issuecomment-270340587" rel="nofollow noreferrer">github 帖子</a></p>的答案 </answer> </body></html>


“Pinia”类型的参数不可分配给“Plugin<[]>”类型的参数

我不知道 VueJS 想要从我这里得到什么。我在项目中使用打字稿。 我正在尝试将 Pinia 连接到 VueJS 项目。打字稿发誓。 我尝试为该应用程序制作一个插件,但没有成功


为什么每次我尝试将应用程序从 Anypoint Studio 部署到 CloudHub 时,我的 pom.xml 文件都会更新?

我的 pom.xml 文件中有以下部分用于我正在执行的虚拟项目: org.mule.tools.maven mule-maven-插件 我正在做的一个虚拟项目的 pom.xml 文件中有以下部分: <plugin> <groupId>org.mule.tools.maven</groupId> <artifactId>mule-maven-plugin</artifactId> <version>${mule.maven.plugin.version}</version> <extensions>true</extensions> <configuration> <classifier>mule-application</classifier> </configuration> </plugin> 每当我尝试直接从 Studio 将应用程序部署到 CloudHub 时,上面的部分就会更改为以下部分: <plugin> <groupId>org.mule.tools.maven</groupId> <artifactId>mule-maven-plugin</artifactId> <version>${mule.maven.plugin.version}</version> <extensions>true</extensions> <configuration> <classifier>---- select project type ----</classifier> </configuration> </plugin> 然后部署失败并出现以下错误: Publication status: error [INFO] ------------------------------------------------------------ [INFO] Steps: [INFO] - Description: Publishing asset [INFO] - Status: error [INFO] - Errors: [The asset is invalid, Error while trying to set type: app. Expected type is: rest-api.] [INFO] ......................................... [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 02:33 min [INFO] Finished at: 2024-01-08T14:11:31+05:30 [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.mule.tools.maven:exchange-mule-maven-plugin:0.0.17:exchange-deploy (default-exchange-deploy) on project super-biodata-sapi: Exchange publication failed: Publication ended with errors: [The asset is invalid, Error while trying to set type: app. Expected type is: rest-api.] -> [Help 1] 这可能是什么原因? 以下是一些细节: Anypoint Studio版本:7.16.0 Maven版本:3.8.8 Mule 运行时版本:4.4.0 Mule Maven 插件版本:3.8.0/4.0.0(两者都尝试过) Java版本:OpenJDK 11.0.9 我以前使用过 Anypoint Studio 7.15,在那里完全相同的项目没有任何问题。但更新后,我遇到了很多问题。 我还尝试使用“rest-api”而不是“mule-application”。然后,首先在部署开始时,“rest-api”更改为“mule-application”,然后再次更改为“----选择项目类型----”,最后失败。 我怀疑存在混乱。您提到您正在尝试将 Mule 4 应用程序部署到 CloudHub,但对资产的引用和错误消息与将资产发布到 Any point Exchange 相关。 CloudHub是一个部署和执行Mule应用程序的云平台。 Anypoint Exchange 是资产存储库,包括 REST API 的定义,但不包括 Mule 4 应用程序,也不用于执行任何操作。有关有效资产的详细信息,请参阅文档。 由于 mule-application 不是发布到 Exchange 的有效资产类型(对于 Mule 4),那么 Studio 似乎试图让您更改为有效的资产类型。 如果您尝试部署到 CloudHub,请参阅文档了解不同的方法。


Vue3 Vite 应用:无法解析源以进行导入分析,因为内容包含无效的 JS 语法

我得到了一个使用Vite作为构建工具的Vue3应用程序。当我尝试构建应用程序时出现此错误: 但是,我确实安装了 @vitejs/plugin-vue,如我的 package.json 中所示,我相信......


在发布为 npm 包之前使用 npm 链接测试组件时出现重复的 ReactJS 导入问题

我有一个像这样的简单组件。 从'react'导入React,{useState}; 函数 MyComponentWithState(props) { const [值,setValue] = useState(0); 返回 ( 我的价值... 我有一个像这样的简单组件。 import React, {useState} from 'react'; function MyComponentWithState(props) { const [value, setValue] = useState(0); return ( <p>My value is: {value}</p> ) } export default MyComponentWithState; 我想将它作为单独的包发布在 NPM 上。因此,为此我准备了 package.json 和 webpack.config.js,如下所示。 package.json: { "name": "try-to-publish", "version": "0.0.1", "description": "Just a test", "main": "build/index.js", "scripts": { "start": "webpack --watch", "build": "webpack" }, "author": { "name": "Behnam Azimi" }, "license": "ISC", "peerDependencies": { "react": "16.9.0", "react-dom": "16.9.0" }, "dependencies": { "react": "16.9.0", "react-dom": "16.9.0", "prop-types": "15.7.2", "react-scripts": "3.1.1", "webpack": "4.39.3" }, "devDependencies": { "@babel/core": "7.6.0", "@babel/plugin-proposal-class-properties": "7.5.5", "@babel/preset-env": "7.6.0", "@babel/preset-react": "7.0.0", "babel-loader": "8.0.6", "babel-plugin-transform-object-rest-spread": "6.26.0", "babel-plugin-transform-react-jsx": "6.24.1", "css-loader": "3.2.0", "node-sass": "4.12.0", "sass-loader": "8.0.0", "style-loader": "1.0.0", "webpack-cli": "3.3.8", "webpack-external-react": "^1.1.2" } } webpack.config.json: const path = require('path'); module.exports = { entry: './src/index.js', output: { path: path.resolve(__dirname, 'build'), filename: 'index.js', libraryTarget: 'commonjs2' }, module: { rules: [ { test: /\.(js|jsx)$/, exclude: /node_modules/, include: path.resolve(__dirname, 'src'), use: { loader: "babel-loader" } }, ] }, resolve: { alias: { 'react': path.resolve(__dirname, 'node_modules/react'), 'react-dom': path.resolve(__dirname, 'node_modules/react-dom'), } }, externals: { 'react': "commonjs react", 'react-dom': "commonjs react-dom" }, }; 这是我的 .babelrc: { "presets": [ "@babel/preset-env", "@babel/preset-react" ], "plugins": ["@babel/plugin-proposal-class-properties"] } 当我将组件发布到 NPM 并使用 `npm install 将其安装到我的另一个 ReactJs 项目中时,这些配置就像魅力一样,但我的观点是本地测试! 我想在发布之前测试这个组件/库。为此,我使用 npm link 功能将我的组件与我的主 ReactJS 项目链接起来。 正如您在上面看到的,我的组件是功能性的,我也使用了钩子。因此,当我将本地链接的库注入到我的主 ReactJs 项目中时,会遇到此错误, 无效的挂钩调用。钩子只能在函数组件的主体内部调用。发生这种情况可能是由于以下原因之一: 1.您的React和渲染器版本可能不匹配(例如React DOM) 2. 你可能违反了 Hooks 规则 3. 您可能在同一个应用程序中拥有多个 React 副本 我的问题与第三个原因有关。我的项目使用 ReactJs 并导入一次,我的组件也会导入 React!我的意思是在一个项目中两次 React 导入!. 我的 Webpack 配置中还有关于 react 和 react-dom 的 externals 配置。 我应该怎么做才能解决这个问题?我的错误在哪里? 更新: 我也尝试过 @sung-m-kim 和 @eddie-cooro 所说的,但没有成功!意思是,我更改了 package.json 并从 react 中删除了 react-dom 和 dependencies 并将它们添加到 devDpendencies。 我终于通过这些步骤解决了这个问题。 运行npm链接里面 <your-library-package>/node_modules/react 还有 运行npm链接里面 <your-library-package>/node_modules/react-dom 然后在 应用程序根目录中运行 npm link react 和 npm link react-dom 并且不要忘记将 React 和 React-dom 作为库中的外部对象保留 // webpack.config.js const externals = { "react": "react", "react-dom": "react-dom", } module.exports = { . . . externals } 我解决了我的问题。我使用 RollupJS 而不是 Webpack 作为捆绑工具进行捆绑。 这是我的rollup.config.js: import {uglify} from 'rollup-plugin-uglify' import babel from 'rollup-plugin-babel' export default { input: "./src/index.js", external: ['react', 'react-dom'], output: { name: 'test-lib', format: "cjs", }, plugins: [ babel({ exclude: "node_modules/**" }), uglify(), ], }; 和我的package.json: { "name": "test-lib", "version": "1.0.0", "main": "dist/test-lib.min.js", "scripts": { "build": "rollup -c -o dist/test-lib.min.js" }, "author": "Behnam Azimi", "license": "ISC", "peerDependencies": { "react": "^16.9.0", "react-dom": "^16.9.0" }, "devDependencies": { "@babel/core": "^7.6.0", "@babel/preset-env": "^7.6.0", "@babel/preset-react": "^7.0.0", "rollup": "^1.21.4", "rollup-plugin-babel": "^4.3.3", "rollup-plugin-commonjs": "^10.1.0", "rollup-plugin-uglify": "^6.0.3" } } 经过这些更改,npm link在我的ReactJS(Hooks)项目中真正发挥了作用。 请注意,这只是一个简单的 Rollup 配置来展示我的解决方案,您可以在配置中添加多种内容,例如热重载、样式加载器和许多其他插件。 仅在 package.json 的 react 部分(而不是 react-native)内设置 peerDependencies 和 dependencies 包。另外,对于本地开发(当您的包未包含在任何其他 React 项目中并且您想在本地运行它时),您可以使用 devDependencies 字段。 我在打字稿反应项目中解决了这个问题。 可能,当使用 npm link 时,请使用主应用程序项目和组件项目中的 react。 因此,在您的 package.json 中从 react 和/或 dependencies 中删除 devDependencies 检查答案:https://stackoverflow.com/a/62807950/5183591 我也有同样的问题。 就我而言,我开发了一些 UI 组件作为包,其中有一个包含 React 应用程序的示例文件夹,用于创建 React 应用程序。 问题是,当我使用 npm i ../ 将包安装到示例应用程序中时,它会将包中的所有文件安装到示例应用程序中,包括 node_modules 文件夹。由于我已经安装了 react 和 react-dom 作为对等依赖项,示例应用程序现在有两个不同的 React 副本。 从包中删除 node_module 文件夹并重新安装包再次解决了我的问题。


在具有 Open Liberty Dev 模式的 Maven 项目中使用本地库

我有一个 Maven 项目,它构建了一个部署到 Open Liberty 的战争。我正在使用 Liberty maven 插件: io.openliberty.tools 我有一个 Maven 项目,它构建了一个部署到 Open Liberty 的战争。我正在使用 Liberty maven 插件: <plugin> <groupId>io.openliberty.tools</groupId> <artifactId>liberty-maven-plugin</artifactId> <version>3.9</version> <!-- Specify configuration, executions for liberty-maven-plugin --> </plugin> 我正在利用开发模式并且它运行良好。但是,我想在 Dev 模式下使用本地 jar 文件库。 我期望我能够将 jar 文件放置在项目中的特定位置,并且 Liberty 开发模式会自动拾取它们 - 类似于自动拾取 server.xml 的方式src/main/liberty/config。我的 server.xml 设置为在此处查找库:${shared.config.dir}/lib/global,因此我尝试将罐子放入 src/main/liberty/shared/config/lib/global 中,但这不起作用。 我看到的另一种选择是使用 Libity 插件的 copyDependencies 配置。 有一些推荐的方法可以实现我想做的事情吗?理想情况下,我想要最简单的解决方案,既适用于 liberty dev 模式,也适用于 vanilla maven 构建 (mvn package)。 这里的类似问题利用了 copyDependencies 配置,但具体来说,我正在寻找本地 jar 的最佳解决方案(是的,我可以使用系统范围的 Maven 坐标或在本地安装 jar) 如何在 Maven 构建期间将外部依赖项复制到 Open Liberty 谢谢 好问题,稍微概括一下问题,您可能可以使用三种方法: 1.使用资源插件 <build> <resources> <!-- Explicitly configure the default too --> <resource> <directory>${project.basedir}/src/main/resources</directory> </resource> <!-- Custom library --> <resource> <directory>${project.basedir}/mylib</directory> <targetPath>${project.build.directory}/liberty/wlp/usr/shared/lib/global</targetPath> <!-- Default, but just emphasizing the point --> <filtering>false</filtering> </resource> </resources> 由于开发模式在其“生命周期”中调用 resources:resources 目标,因此可以在没有任何插件配置的情况下进行配置(使用“/project/build/resources”(在 XPath 术语中)元素),并使用您的 <targetPath>可以复制到任何位置。 2.添加到config目录(src/main/liberty/config) 除了src/main/liberty/config/server.xml处的主服务器XML配置文件之外,您还可以将其他文件和目录放在那里,所有文件和目录都将通过开发模式复制过来。 所以你可以创建,例如src/main/liberty/config/mylib/my.jar,它会被复制到target/liberty/wlp/usr/servers/defaultServer/mylib/my.jar。然后,您可以从 server.xml 将此位置引用为相对于服务器配置目录的 "mylib/my.jar"。 (这不太适合要求复制到“.../shared/lib/global”的原始用例,但可能适合其他查看此问题的人)。 3.添加系统范围的依赖项 这在原来的问题中已经提到过。我不太喜欢这个解决方案。为了完整起见,我会提及它,但请您自行查找详细信息。 这可能会很有趣。


表单响应:“无法处理请求 HTTP ERROR 500”。我做错了什么?

我尝试在网站上编写 php 表单,但收到错误 500。我无法弄清楚我做错了什么。你能看一下代码看看我做错了什么吗? PHP: 我尝试在网站上编写 php 表单,但收到错误 500。我无法弄清楚我做错了什么。你能看一下代码看看我做错了什么吗? PHP: <?php // define variables and set to empty values $name = $email = $phone = $enquiry = ""; if ( $_SERVER[ "REQUEST_METHOD" ] == "POST" ) { if ( empty( $_POST[ "name" ] ) ) { $nameErr = "Name is required"; } else { $name = test_input( $_POST[ "name" ] ); // check if name only contains letters and whitespace if ( !preg_match( "/^[a-zA-Z-' ]*$/", $name ) ) { $nameErr = "Only letters and white space allowed"; } } if ( empty( $_POST[ "email" ] ) ) { $emailErr = "Email is required"; } else { $email = test_input( $_POST[ "email" ] ); // check if e-mail address is well-formed if ( !filter_var( $email, FILTER_VALIDATE_EMAIL ) ) { $emailErr = "Invalid email format"; } } if ( empty( $_POST[ "phone" ] ) ) { $comment = ""; } else { $comment = test_input( $_POST[ "phone" ] ); } if ( empty( $_POST[ "enquiry" ] ) ) { $comment = ""; } else { $comment = test_input( $_POST[ "enquiry" ] ); } } // Create the email and send the message $destination = "[email protected]"; $subject = "Website Contact Form Enquiry: $name"; $body = "You have received a new message from your website contact form.\\n\\n"."Here are the details:\\n\\nName: $name\\n\\nEmail: $email\\n\\nPhone: $phone\\n\\nEnquiry:\\n$enquiry"; $header = "From: [email protected]\\n"; $headers = array(); $headers[] = "MIME-Version: 1.0"; $headers[] = "Content-type: text/plain; charset=iso-8859-1"; $headers[] = "From: " . $fromAddress; $headers[] = "Subject: " . $subject; $headers[] = "X-Mailer: PHP/".phpversion(); mail($destination, $subject, $message, implode("\r\n", $headers)); // mail($to,$subject,$msg,$headers); echo "Email successfully sent."; ?> HTML 格式: <form id="contact-form" method="post" action="/contact.php" role="form"> <div class="messages"></div> <div class="controls"> <div class="row"> <div class="col-md-10"> <div class="form-group"> <input id="form_name" type="text" name="name" class="form-control" placeholder="Name*" required="required" data-error="Your name is required." > <div class="help-block with-errors"></div> </div> </div> <div class="col-md-10"> <div class="form-group"> <input id="form_email" type="email" name="email" class="form-control" placeholder="Email*" required="required" data-error="Valid email is required." > <div class="help-block with-errors"></div> </div> </div> <div class="col-md-10"> <div class="form-group"> <input id="form_phone" type="text" name="phone" class="form-control" placeholder="Phone" > <div class="help-block with-errors"></div> </div> </div> </div> <div class="row"> <div class="col-md-10"> <div class="form-group"> <textarea id="form_enquiry" name="enquiry" class="form-control" placeholder="Enquiry*" rows="6" required="required" data-error="Please, leave us a message."></textarea> <div class="help-block with-errors"></div> </div> </div> <div class="col-md-12"> <input class="btn btn-large btn-primary centre mt-10" type="submit" value="Submit" > </div> </div> </div> </form> 我已按照其他人的指示使表单正常工作,但所做的更改仍然会出现错误。 这是一个简单的形式,但我似乎对我做错了什么缺乏了解。 请帮助我。 如果您查看发送邮件的行,这是一个硬行结尾,将 $headers 推到新行上吗?这将调用 500 错误。 查看 /var/log/apache2/error.log(如果您使用的是 Debian)或 /var/log/httpd/error.log(如果使用的是 RHEL 或类似系统)。 您的代码存在许多问题,但首先关注快乐的道路,然后让事情正常运行。


Apache POI 与 Apache Felix 的使用

我正在尝试将 Apache POI 导入 Atlassian Jira 插件以读取 excel 文件。 一开始,我开始只是添加 org.apache.poi 我正在尝试将 Apache POI 导入 Atlassian Jira 插件以读取 excel 文件。 一开始,我只是添加了 <dependency> <groupId>org.apache.poi</groupId> <artifactId>poi</artifactId> <version>${poi.version}</version> </dependency> <dependency> <groupId>org.apache.poi</groupId> <artifactId>poi-ooxml-schemas</artifactId> <version>${poi.version}</version> </dependency> <dependency> <groupId>org.apache.poi</groupId> <artifactId>poi-ooxml</artifactId> <version>${poi.version}</version> </dependency> poi.版本是3.14 然后当我启动插件时它给出了 Unresolved constraint in bundle com.tezExtensions [165]: Unable to resolve 165.0: missing requirement [165.0] osgi.wiring.package; (osgi.wiring.package=com.sun.javadoc) 然后我用一些指令编辑了 pom,这些指令是我在另一个 StackOverflow 问题中找到的 Pax Exam 问题与 Apache POI 包装的捆绑包 <instructions> <Atlassian-Plugin-Key>${atlassian.plugin.key}</Atlassian-Plugin-Key> <!-- Add package to export here --> <Export-Package>com.sony.poc.api,</Export-Package> <_exportcontents> org.apache.poi.*;version=${poi.version}, org.openxmlformats.schemas.*;version=${poi.schema.version}, schemasMicrosoftComOfficeExcel.*;version=${poi.schema.version}, schemasMicrosoftComOfficeOffice.*;version=${poi.schema.version}, schemasMicrosoftComOfficePowerpoint.*;version=${poi.schema.version}, schemasMicrosoftComVml.*;version=${poi.schema.version}, org.etsi.uri.*;version=${poi.security.version} </_exportcontents> <!-- Add package import here --> <Import-Package> com.sun.javadoc;resolution:=optional, com.sun.tools.javadoc;resolution:=optional, org.apache.crimson.jaxp;resolution:=optional, org.apache.tools.ant;resolution:=optional, org.apache.tools.ant.taskdefs;resolution:=optional, org.apache.tools.ant.types;resolution:=optional, junit.framework.*;resolution:=optional, junit.textui.*;resolution:=optional, org.junit.*;resolution:=optional, org.apache.xml.security.*;resolution:=optional, org.apache.jcp.xml.dsig.internal.dom.*;resolution:=optional, org.springframework.osgi.*;resolution:="optional", org.eclipse.gemini.blueprint.*;resolution:="optional", *</Import-Package> <DynamicImport-Package> org.apache.xmlbeans.*, schemaorg_apache_xmlbeans.* </DynamicImport-Package> 使用此配置,我收到此错误; Unable to resolve 165.0: missing requirement [165.0] osgi.wiring.package; (osgi.wiring.package=org.apache.xml.resolver) 有人有想法吗? 终于找到解决办法了。 我已将它们添加为依赖项 <dependency> <groupId>org.apache.poi</groupId> <artifactId>poi</artifactId> <version>${poi.version}</version> </dependency> <dependency> <groupId>org.apache.poi</groupId> <artifactId>poi-scratchpad</artifactId> <version>${poi.version}</version> </dependency> <dependency> <groupId>org.apache.poi</groupId> <artifactId>poi-ooxml</artifactId> <version>${poi.version}</version> <exclusions> <exclusion> <groupId>stax</groupId> <artifactId>stax-api</artifactId> </exclusion> <exclusion> <groupId>xml-apis</groupId> <artifactId>xml-apis</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.codehaus.woodstox</groupId> <artifactId>woodstox-core-asl</artifactId> <version>4.4.1</version> </dependency> 还将这些添加到 Import-Package 标签内部 *;resolution:=optional, com.ctc.wstx.stax.* 仅此而已。 我应该将 Atlassian Jira 的 pom.xml 放在哪里?


Spring boot + slf4j + log4j + 类 org.apache.logging.slf4j.SLF4JLoggerContext 无法转换为类

我有Spring boot 2.3.1 pom.xml 我有Spring boot 2.3.1 pom.xml <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.3.1.RELEASE</version> <relativePath/> <!-- lookup parent from repository --> </parent> <groupId>logger</groupId> <artifactId>logger</artifactId> <version>0.0.1-SNAPSHOT</version> <name>logger</name> <description>Demo project for Spring Boot</description> <properties> <java.version>11</java.version> <lombok.version>1.18.12</lombok.version> <log4j.version>1.2.17</log4j.version> <slf4j.version>1.7.30</slf4j.version> </properties> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> <exclusions> <exclusion> <artifactId>logback-classic</artifactId> <groupId>ch.qos.logback</groupId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> <version>${lombok.version}</version> <scope>provided</scope> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-log4j12</artifactId> <version>${slf4j.version}</version> </dependency> <dependency> <groupId>log4j</groupId> <artifactId>log4j</artifactId> <version>${log4j.version}</version> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> </plugins> </build> </project> 班级 @Slf4j @SpringBootApplication public class LoggerApplication { public static void main(String[] args) { log.info("++++++++++++++++++++++++TEST+++++++++++++++++++++++++++++"); SpringApplication.run(LoggerApplication.class, args); } } 应用程序.属性 logging.config=classpath:log4j.properties log4j.properties log4j.rootLogger=INFO, console log4j.appender.console=org.apache.log4j.ConsoleAppender log4j.appender.console.Target=System.out log4j.appender.console.layout=org.apache.log4j.PatternLayout log4j.appender.console.layout.conversionPattern=%d{yyyy-MM-dd HH:mm:ss,SSS} %-5p - %m%n 我尝试寻找解决方案,查看论坛上的类似主题,尝试各种排除依赖项的选项。 线程“main”中的异常 java.lang.ClassCastException:类 org.apache.logging.slf4j.SLF4JLoggerContext 无法转换为类 org.apache.logging.log4j.core.LoggerContext (org.apache.logging.slf4j.SLF4JLoggerContext 和 org.apache.logging.log4j.core.LoggerContext 位于未命名模块中 加载器“应用程序”)位于 我还尝试排除一些依赖项 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> <exclusions> <exclusion> <artifactId>logback-classic</artifactId> <groupId>ch.qos.logback</groupId> </exclusion> <exclusion> <groupId>log4j</groupId> <artifactId>*</artifactId> </exclusion> <exclusion> <groupId>org.slf4j</groupId> <artifactId>*</artifactId> </exclusion> <exclusion> <groupId>org.apache.logging.log4j</groupId> <artifactId>*</artifactId> </exclusion> </exclusions> </dependency> 但又出现错误,但现在无法再格式化日志了。 2021-01-13 19:12:15,881 信息 - ++++++++++++++++++++++++测试+++++++++++++++++++++++++++++++ 错误 StatusLogger 无法识别的格式说明符 [d] 错误 StatusLogger 无法识别的转换说明符 [d] 从转换模式中的位置 16 开始。 错误 StatusLogger 无法识别的格式说明符 [线程] 错误 StatusLogger 无法识别的转换说明符 [线程] 从转换模式中的位置 25 开始。 错误 StatusLogger 无法识别的格式说明符 [级别] 错误 StatusLogger 无法识别的转换说明符 [level] 从转换模式中的位置 35 开始。 ... 错误 StatusLogger 无法识别的格式说明符 [n] 错误 StatusLogger 无法识别的转换说明符 [n] 从转换模式中的位置 56 开始。 警告:不支持 sun.reflect.Reflection.getCallerClass。这会影响性能。 任何人都可以有任何想法如何解决它吗? 我找到了解决这个问题的方法。事实证明,问题出在其中一个私有库(elastik 的附加程序)的冲突上。 我执行了命令: mvn dependency:tree 然后找到传递依赖项,并将它们排除在所有类的路径上,以排除日志记录所需的库冲突。 pom.xml <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> <exclusions> <exclusion> <artifactId>logback-classic</artifactId> <groupId>ch.qos.logback</groupId> </exclusion> <exclusion> <artifactId>log4j-to-slf4j</artifactId> <groupId>org.apache.logging.log4j</groupId> </exclusion> </exclusions> </dependency> <dependency> <artifactId>springfox-boot-starter</artifactId> <groupId>io.springfox</groupId> <version>3.0.0</version> <exclusions> <exclusion> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> <version>${lombok.version}</version> <scope>provided</scope> </dependency> <dependency> <groupId>log4j</groupId> <artifactId>log4j</artifactId> <version>${log4j.version}</version> </dependency> <dependency> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j-core</artifactId> <version>${version.log4j.core}</version> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-log4j12</artifactId> <version>${slf4j.version}</version> </dependency>


© www.soinside.com 2019 - 2024. All rights reserved.