当前位置: 首页 > news >正文

Nexus私有仓库+IDEA配置远程推送

目录

一、docker安装nexus本地私服,Idea通过maven配置deploy本地jar包(简单)

二、docker push镜像到第三方nexus远程私服(shell命令操作)

三、springboot通过maven插件自动生成docker镜像并push到nexus私服(难)


代码有代码的管理平台,比如GitHub、GitLab、码云等。镜像也有镜像的管理平台,比如DockerHub,以及本文中的nexus。 Nexus是当前最流行的Maven仓库管理软件。本文讲解使用nexus作为docker镜像仓库。

在这里插入图片描述

SNAPSHOT
快照版本,在 maven 中 SNAPSHOT 版本代表正式发布(release)的版本之前的开发版本,在 pom 中用 x.y-SNAPSHOT 表示。

RELEASE
发布版本,稳定版本,在 maven 中 RELEASE 代表着稳定的版本,unchange,不可改变的,在 maven 中 SNAPSHOT 与 RELEASE 版本在策略上是完全不同的方式,SNAPSHOT 会根据你的配置不同,频繁的从远程仓库更新到本地仓库;而 RELEASE 则只会在第一次下载到本地仓库,以后则会先直接从本地仓库中寻找。


一、docker安装nexus本地私服,Idea通过maven配置deploy本地jar包(简单)


使用docker将nexus拉取到本地,启动nexus容器,即可本地访问(注意初始登录密码在容器的哪个位置)。然后在Idea中进行settings.xml文件和pom.xml文件的配置。

1. 拉取nexus镜像

docker pull sonatype/nexus3

2. 启动容器

docker run -tid -p 8081:8081 -p 8082:8082 -p 8083:8083 -p 8084:8084 --privileged=true --name nexus3 -v /docker/nexus/nexus-data:/var/nexus-data --restart=always docker.io/sonatype/nexus3
-tid  :创建守护式容器 。
-p 8081:8081 :宿主机端口(对外访问端口):容器映射端口。这2个端口可不一样。浏览器访问URL用前面个端口 。8082~8084是仓库端口,如果不配置,后面访问不了
--privileged=true :容器访问宿主机的多级目录时可能会权限不足,故给 root 权限 。
--name nexus3 :给容器取名,可任意设定。
-v $PWD/nexus-data:/var/nexus-data :把容器中的 nexus-data 目录挂载到宿主机当前路径下的 nexus-data 下。方便以后查看相关数据。$PWD :取当前路径。此处可以写死为某个完整的确定的目录。 挂载格式为: -v  宿主机目录 :容器目录 。         
--restart=always :服务挂后,自动重启 。
docker.io/sonatype/nexus3 :镜像名 。

3. 通过启动日志查看启动是否成功

docker logs -f nexus3

4. 本地访问并登陆(初始密码在容器的etc文件下,登录账户为admin)一定要先登录

http://ip:8081

5. 在idea的运行使用的settings文件上进行私服配置

<?xml version="1.0" encoding="UTF-8"?><settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd"><localRepository>D:\software\apache-maven-3.8.1\repository</localRepository><pluginGroups></pluginGroups><proxies></proxies><servers><server><id>jy-releases</id><username>admin</username><password>admin123</password></server><server><id>jy-snapshots</id><username>admin</username><password>admin123</password></server></servers><mirrors><mirror>  <id>alimaven</id>  <name>aliyun maven</name>  <url>http://maven.aliyun.com/nexus/content/groups/public/</url>  <mirrorOf>central</mirrorOf>          </mirror></mirrors><profiles><profile><id>jy</id><activation><activeByDefault>false</activeByDefault></activation><!-- 私有库地址--><repositories><repository><id>jy</id><url>http://119.29.244.118:8081/repository/maven-public/</url><releases><enabled>true</enabled></releases><snapshots><enabled>true</enabled></snapshots></repository></repositories><!--插件库地址--><pluginRepositories><pluginRepository><id>jy</id><url>http://119.29.244.118:8081/repository/maven-public/</url><releases><enabled>true</enabled></releases><snapshots><enabled>true</enabled></snapshots></pluginRepository></pluginRepositories></profile><profile>    <id>jdk-1.8</id>    <activation>    <activeByDefault>true</activeByDefault>    <jdk>1.8</jdk>    </activation>    <properties>    <maven.compiler.source>1.8</maven.compiler.source>    <maven.compiler.target>1.8</maven.compiler.target>    <maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion>    </properties>    </profile> </profiles><!--    与上面的<profile><id>lee</id>相同--><activeProfiles><activeProfile>jy</activeProfile></activeProfiles></settings>

私服地址自己查看

为了速度更快,这里设置阿里云的镜像仓库而不是中央仓库 

http://maven.aliyun.com/nexus/content/groups/public/

 

6. 在项目的pom.xml文件中配置推送url地址

<distributionManagement><repository><id>jy-releases</id><url>http://119.29.244.118:8081/repository/maven-releases/</url></repository><snapshotRepository><id>jy-snapshots</id><url>http://119.29.244.118:8081/repository/maven-snapshots/</url></snapshotRepository></distributionManagement>

7. 执行命令,推送 jar 到私服

 mvn  clean  deploy -Dmaven.test.skip=true 

maven和nexus私服的简单说明

 

二、docker push镜像到第三方nexus远程私服(shell命令操作)

这里的nexus私服是公司配的,用于组内项目的jar包、镜像管理仓库。

   step1: 本地登录nexus(输入用户名和密码)

docker login 119.29.244.118:8012

说明:8081是nexus的访问地址,8012端口是在nexus上设置的推送地址,也可用于登录。

   step2:查看本地镜像(以镜像openjdk:8-jdk-alpine为例)

   step3:tag镜像

  • docker tag openjdk:8-jdk-alpine 119.29.244.118:8012/ddpt/openjdk:8-jdk-alpine
    

    step4:push镜像

  • docker push 119.29.244.118:8012/ddpt/openjdk:8-jdk-alpine
    

    三、springboot通过maven插件自动生成docker镜像并push到nexus私服(难)

          需求:在Springboot项目中通过maven配置+Dockerfile文件+setting文件配置,实现Springboot项目的自动打包镜像,自动推送到远程nexus私服。

step1:Dockerfile文件编写。

FROM openjdk:8-jdk-alpine
VOLUME /tmp
#把当前项目下web-app-template-1.0.0.jar 改名为web-app-template.jar添加到镜像中
ADD web-app-template-1.0.0.jar web-app-template.jar
#指定端口,最好写与项目配置的端口
EXPOSE 8081
#在镜像中运行/web-app-template.jar包,这样在运行镜像的时候就可以启动好web-app-template.jar
#-Djava.security.egd=file:/dev/./urandom 是一个启动参数的优化,用于解决应用可能(在需要大量使用随机数的情况下)启动慢的问题
#(应用的sessionID是通过该参数的配置快速产生的随机数)
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/web-app-template.jar"]

step2:settings.xml文件中配置用户名、密码和邮箱

 <server><id>docker-nexus</id><username>p****DockerUser</username><password>l****pB</password><configuration><email>liu****@***.***.com</email></configuration></server>

step3:pom.xml文件配置

  <properties><docker.repo>nexus.****.com:8012</docker.repo><docker.repository>webapptemplate</docker.repository><skipTests>true</skipTests></properties><!-- The configuration of maven-assembly-plugin --><plugin><groupId>com.spotify</groupId><artifactId>docker-maven-plugin</artifactId><version>0.4.13</version><configuration><imageName>${docker.repository}/${project.artifactId}:${project.version}_SNAPSHOT</imageName><!--指定dockerFile的路径 --><dockerDirectory>${project.basedir}/src/main/docker</dockerDirectory><!--docker server地址 docker服务端地址,即Docker安装地址,并开启2375端口(也可以安装在本地并开启2375端口)--><dockerHost>http://10.154.7.202:2375</dockerHost><serverId>docker-nexus</serverId><registryUrl>http://nexus.cmss.com:8082/webapptemplate/</registryUrl><resources><resource><targetPath>/</targetPath><directory>${project.build.directory}</directory><include>${project.build.finalName}.jar</include></resource></resources></configuration><executions><!--绑定Docker build镜像 命令到 Maven 的package阶段--><execution><id>build-image</id><phase>package</phase><goals><goal>build</goal></goals></execution><!--绑定Docker tag镜像 命令到 Maven 的package阶段--><execution><id>tag-image</id><phase>package</phase><goals><goal>tag</goal></goals><configuration><!--镜像名称--> <image>${docker.repository}/${project.artifactId}:${project.version}_SNAPSHOT</image><!--镜像Tag名称--> <newName>${docker.repo}/${docker.repository}/${project.artifactId}:${project.version}_SNAPSHOT</newName><forceTags>true</forceTags></configuration></execution><!--绑定Docker push镜像 命令到 Maven 的package阶段--><execution><id>push-image</id><phase>package</phase><goals><goal>push</goal></goals><configuration><imageName>${docker.repo}/${docker.repository}/${project.artifactId}:${project.version}_SNAPSHOT</imageName></configuration></execution></executions></plugin>

step4:打包并自动推送镜像

mvn clean deploy -Dmaven.test.skip=true

成功运行日志

"D:\Program Files\Java\jdk1.8.0_191\bin\java.exe" -Dmaven.multiModuleProjectDirectory=D:\CMSSGitLab\dig-common\template\web-app-template "-Dmaven.home=C:\IntelliJ IDEA 2020.1\plugins\maven\lib\maven3" "-Dclassworlds.conf=C:\IntelliJ IDEA 2020.1\plugins\maven\lib\maven3\bin\m2.conf" "-Dmaven.ext.class.path=C:\IntelliJ IDEA 2020.1\plugins\maven\lib\maven-event-listener.jar" "-javaagent:C:\IntelliJ IDEA 2020.1\lib\idea_rt.jar=12520:C:\IntelliJ IDEA 2020.1\bin" -Dfile.encoding=UTF-8 -classpath "C:\IntelliJ IDEA 2020.1\plugins\maven\lib\maven3\boot\plexus-classworlds-2.6.0.jar" org.codehaus.classworlds.Launcher -Didea.version2020.1 --update-snapshots -s C:\Users\Administrator\.m2\settings.xml package -P dev
[INFO] Scanning for projects...
[WARNING] 
[WARNING] Some problems were encountered while building the effective model for com.chinamobile.cmss.dig:web-app-template:jar:1.0.0
[WARNING] 'build.plugins.plugin.(groupId:artifactId)' must be unique but found duplicate declaration of plugin org.springframework.boot:spring-boot-maven-plugin @ line 279, column 21
[WARNING] 
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING] 
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING] 
[INFO] 
[INFO] -------------< com.chinamobile.cmss.dig:web-app-template >--------------
[INFO] Building web-app-template 1.0.0
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- maven-resources-plugin:3.1.0:resources (default-resources) @ web-app-template ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] Copying 6 resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ web-app-template ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 25 source files to D:\CMSSGitLab\dig-common\template\web-app-template\target\classes
[INFO] /D:/CMSSGitLab/dig-common/template/web-app-template/src/main/java/com/chinamobile/cmss/dig/interceptor/HttpResponseInterceptor.java: D:\CMSSGitLab\dig-common\template\web-app-template\src\main\java\com\chinamobile\cmss\dig\interceptor\HttpResponseInterceptor.java使用了未经检查或不安全的操作。
[INFO] /D:/CMSSGitLab/dig-common/template/web-app-template/src/main/java/com/chinamobile/cmss/dig/interceptor/HttpResponseInterceptor.java: 有关详细信息, 请使用 -Xlint:unchecked 重新编译。
[INFO] 
[INFO] --- maven-resources-plugin:3.1.0:testResources (default-testResources) @ web-app-template ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 4 resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.8.1:testCompile (default-testCompile) @ web-app-template ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 5 source files to D:\CMSSGitLab\dig-common\template\web-app-template\target\test-classes
[INFO] 
[INFO] --- maven-surefire-plugin:2.18.1:test (default-test) @ web-app-template ---
[INFO] Tests are skipped.
[INFO] 
[INFO] --- maven-jar-plugin:3.2.0:jar (default-jar) @ web-app-template ---
[INFO] Building jar: D:\CMSSGitLab\dig-common\template\web-app-template\target\web-app-template-1.0.0.jar
[INFO] 
[INFO] --- spring-boot-maven-plugin:2.3.1.RELEASE:repackage (repackage) @ web-app-template ---
[INFO] Replacing main artifact with repackaged archive
[INFO] 
[INFO] --- spring-boot-maven-plugin:2.3.1.RELEASE:repackage (default) @ web-app-template ---
[INFO] Replacing main artifact with repackaged archive
[INFO] 
[INFO] --- maven-assembly-plugin:3.3.0:single (make-assembly) @ web-app-template ---
[INFO] Reading assembly descriptor: profile/dev/package.xml
[INFO] Building tar: D:\CMSSGitLab\dig-common\template\web-app-template\target\web-app-template-1.0.0-server.tar.gz
[INFO] 
[INFO] --- docker-maven-plugin:0.4.13:build (build-image) @ web-app-template ---
[INFO] Copying D:\CMSSGitLab\dig-common\template\web-app-template\target\web-app-template-1.0.0.jar -> D:\CMSSGitLab\dig-common\template\web-app-template\target\docker\web-app-template-1.0.0.jar
[INFO] Copying D:\CMSSGitLab\dig-common\template\web-app-template\src\main\docker\Dockerfile -> D:\CMSSGitLab\dig-common\template\web-app-template\target\docker\Dockerfile
[INFO] Building image webapptemplate/web-app-template:1.0.0_SNAPSHOT
Step 1/5 : FROM openjdk:8-jdk-alpine---> a3562aa0b991
Step 2/5 : VOLUME /tmp---> Using cache---> 3a9992956a89
Step 3/5 : ADD web-app-template-1.0.0.jar web-app-template.jar---> 30b7fcaf08ed
Removing intermediate container c555a3b04b5a
Step 4/5 : EXPOSE 8081---> Running in d15cfd67a278---> 5d6a58f1218c
Removing intermediate container d15cfd67a278
Step 5/5 : ENTRYPOINT java -Djava.security.egd=file:/dev/./urandom -jar /web-app-template.jar---> Running in 2fbb8ceefe70---> c8cb14dd046c
Removing intermediate container 2fbb8ceefe70
Successfully built c8cb14dd046c
[INFO] Built webapptemplate/web-app-template:1.0.0_SNAPSHOT
[INFO] 
[INFO] --- docker-maven-plugin:0.4.13:tag (tag-image) @ web-app-template ---
[INFO] Creating tag nexus.cmss.com:8012/webapptemplate/web-app-template:1.0.0_SNAPSHOT from webapptemplate/web-app-template:1.0.0_SNAPSHOT
[INFO] 
[INFO] --- docker-maven-plugin:0.4.13:push (push-image) @ web-app-template ---
[INFO] Pushing nexus.cmss.com:8012/webapptemplate/web-app-template:1.0.0_SNAPSHOT
The push refers to a repository [nexus.cmss.com:8012/webapptemplate/web-app-template]
107680152efb: Preparing 
ceaf9e1ebef5: Preparing 
9b9b7f3d56a0: Preparing 
f1b5933fe4b5: Preparing 
ceaf9e1ebef5: Layer already exists 
9b9b7f3d56a0: Layer already exists 
f1b5933fe4b5: Layer already exists 
107680152efb: Pushing [>                                                  ] 524.8 kB/58.48 MB
107680152efb: Pushing [=>                                                 ] 2.196 MB/58.48 MB
107680152efb: Pushing [===>                                               ] 3.867 MB/58.48 MB
107680152efb: Pushing [====>                                              ] 5.538 MB/58.48 MB
107680152efb: Pushing [======>                                            ] 7.209 MB/58.48 MB
107680152efb: Pushing [========>                                          ] 9.438 MB/58.48 MB
107680152efb: Pushing [=========>                                         ] 11.11 MB/58.48 MB
107680152efb: Pushing [===========>                                       ] 13.34 MB/58.48 MB
107680152efb: Pushing [=============>                                     ] 15.57 MB/58.48 MB
107680152efb: Pushing [==============>                                    ] 17.24 MB/58.48 MB
107680152efb: Pushing [================>                                  ] 19.46 MB/58.48 MB
107680152efb: Pushing [==================>                                ] 21.69 MB/58.48 MB
107680152efb: Pushing [====================>                              ] 23.92 MB/58.48 MB
107680152efb: Pushing [======================>                            ] 26.15 MB/58.48 MB
107680152efb: Pushing [========================>                          ] 28.38 MB/58.48 MB
107680152efb: Pushing [==========================>                        ] 30.61 MB/58.48 MB
107680152efb: Pushing [============================>                      ] 32.83 MB/58.48 MB
107680152efb: Pushing [=============================>                     ] 35.06 MB/58.48 MB
107680152efb: Pushing [===============================>                   ] 37.29 MB/58.48 MB
107680152efb: Pushing [=================================>                 ] 39.52 MB/58.48 MB
107680152efb: Pushing [===================================>               ] 41.75 MB/58.48 MB
107680152efb: Pushing [=====================================>             ] 43.98 MB/58.48 MB
107680152efb: Pushing [=======================================>           ]  46.2 MB/58.48 MB
107680152efb: Pushing [========================================>          ] 47.87 MB/58.48 MB
107680152efb: Pushing [==========================================>        ]  50.1 MB/58.48 MB
107680152efb: Pushing [============================================>      ] 52.33 MB/58.48 MB
107680152efb: Pushing [==============================================>    ] 54.56 MB/58.48 MB
107680152efb: Pushing [================================================>  ] 56.23 MB/58.48 MB
107680152efb: Pushing [=================================================> ] 58.46 MB/58.48 MB
107680152efb: Pushing [==================================================>] 58.48 MB
107680152efb: Pushed 
1.0.0_SNAPSHOT: digest: sha256:769e960e2d4981611f4312cfa1da2f752829a7d799e63bee0d7d4d139ca5fec2 size: 1159
null: null 
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  48.692 s
[INFO] Finished at: 2020-07-09T10:14:03+08:00
[INFO] ------------------------------------------------------------------------

相关文章:

Nexus私有仓库+IDEA配置远程推送

目录 一、docker安装nexus本地私服&#xff0c;Idea通过maven配置deploy本地jar包&#xff08;简单&#xff09; 二、docker push镜像到第三方nexus远程私服&#xff08;shell命令操作&#xff09; 三、springboot通过maven插件自动生成docker镜像并push到nexus私服&#xf…...

idea2023项目上传到gitee

1、按照gitee插件 File——>Settings plugins——>Marketplace下面搜索gitee,然后按照gitee插件 2、上传项目 VCS_——>Share Project on Gitee 如果第一次没登录的需要先登录&#xff0c;登录完后就可以上传了...

【golang】派生数据类型---指针 标识符、关键字等

1、指针 对比C/C中的指针&#xff0c;go语言中的指针显得极为简洁&#xff0c;只是简单的获取某个空间的地址 或者 根据指针变量中的内容 获取对应存储空间的内容等操作。 具体示例如下&#xff1a; go中使用指针需要注意的点&#xff1a; 可以通过指针改变它所指向的内存空…...

深度学习技术

深度学习是什么&#xff1f; 深度学习&#xff0c;英文名为Deep Learning&#xff0c;其实就是机器学习的一种高级形式。它的灵感来源于人脑神经网络的工作方式&#xff0c;是一种让机器可以自主地从数据中学习和提取特征的技术。你可以把它想象成一位小侦探&#xff0c;通过不…...

TCP/IP网络江湖——物理层护江山:网络安全的铁壁防线(物理层下篇:物理层与网络安全)

TCP/IP网络江湖——物理层护江山:网络安全的铁壁防线(物理层下篇:物理层与网络安全) 〇、引言一、物理层的隐私与保密1.1 加密技术的护盾1.2 安全传输协议的密约1.3 物理层的安全控制1.4 面对未知威胁的准备二、电磁干扰与抵御2.1 电磁干扰的威胁2.2 抗干扰技术的应用2.3 屏…...

python-数据可视化-使用API

使用Web应用程序编程接口 &#xff08;API&#xff09;自动请求网站的特定信息而不是整个网页&#xff0c;再对这些信息进行可视化 使用Web API Web API是网站的一部分&#xff0c;用于与使用具体URL请求特定信息的程序交互。这种请求称为API调用 。请求的数据将以易于处理的…...

窗口看门狗

从下往上看: 1. 时钟设置 RCC_APB1PeriphClockCmd(RCC_APB1Periph_WWDG,ENABLE);//使能独立看门狗时钟 WWDG_SetPrescaler(WWDG_Prescaler_8);//看门狗预分频器WWDG counter clock (PCLK1/4096)/8 2.设置窗口值 实际就是设置WWDG_CR的低七位值, 但是这个值要大于0x40(也就是…...

开发新能源的好处

风能无论是总装机容量还是新增装机容量&#xff0c;全球都保持着较快的发展速度&#xff0c;风能将迎来发展高峰。风电上网电价高于火电&#xff0c;期待价格理顺促进发展。生物质能有望在农业资源丰富的热带和亚热带普及&#xff0c;主要问题是降低制造成本&#xff0c;生物乙…...

error: can‘t find Rust compiler

操作系统 win11 pip install -r requirements.txt 报错如下 Using cached https://pypi.tuna.tsinghua.edu.cn/packages/56/fc/a3c13ded7b3057680c8ae95a9b6cc83e63657c38e0005c400a5d018a33a7/pyreadline3-3.4.1-py3-none-any.whl (95 kB) Building wheels for collected p…...

全面解析MES系统中的车间退料管理

一、车间退料管理的定义&#xff1a; 车间退料是指在生产过程中&#xff0c;将不合格或多余的物料、半成品或成品从车间环节返还到供应链的过程。车间退料管理则是指对这一退料过程进行规范化、系统化的管理和跟踪。 二、车间退料管理的流程&#xff1a; 1. 退料申请&#xf…...

探究finally代码块是否执行

情况一&#xff1a;try代码块正常执行&#xff0c;无异常&#xff0c;finally代码块无retrun&#xff1b; 代码演示 public class Test38 {public static void main(String[] args) {int foo foo();System.out.println("foo:" foo);}public static int foo() {tr…...

leetcode刷题(字符串相加、包含每个查询的最小区间、模拟行走机器人、环形子数组的最大和、满足不等式的最大值、四数之和、树中距离之和)

目录 1、字符串相加 2、包含每个查询的最小区间 3、模拟行走机器人 4、环形子数组的最大和 5、满足不等式的最大值 6、四数之和 7、 树中距离之和 1、字符串相加 class Solution:def addStrings(self, num1: str, num2: str) -> str:i len(num1) - 1 # num1的末…...

Grafana reporter定时报表踩坑记录

前言:本以为测试grafana reporter功能能很顺利,但按照网上大佬分享的记录进行操作,屡屡报错,不知是因为我的grafana部署在k8s中之前由低版本升级到高版本导致的,还是其他原因,在grafana中安装Grafana Image Renderer 一直报错。 Github地址:https://github.com/IzakMar…...

Flutter 状态管理引子

1、为了更好地了解状态管理&#xff0c;先看看什么是状态。 在类似Flutter这样的响应式编程框架中&#xff0c;我们可以认为U相关的开发就是对数据进行封装&#xff0c;将之转换为具体的U1布局或者组件。借用Flutter官网的一张图&#xff0c;可以把我们在第二部分做的所有开发…...

CFC编程入门_【10分钟学会】

什么是CFC&#xff1a; 【差不多10分钟全学会】 CFC是图形化编程&#xff0c; 跟单片机的连线一样&#xff0c; 唯一的区别&#xff1a;功能块右侧是【只能输出】引脚。 只有左侧引脚可以输入输出。 有哪些控件&#xff1a; 指针&#xff1a;用于拖动功能块。 控制点&#xf…...

golang无需创建新切片

在 Go 语言中&#xff0c;append(b, 0)[:len(b)] 是一种常见的用法&#xff0c;用于在切片 b 后追加一个元素&#xff0c;并返回旧切片的前 len(b) 个元素。 这种用法的目的是将一个新元素追加到切片中&#xff0c;并确保切片的长度保持不变。具体步骤如下&#xff1a; 1. ap…...

Django基础5——ORM中间程序

文章目录 一、基本了解二、ORM基本操作2.1 连接数据库2.1.1 使用sqlite数据库2.1.2 使用MySQL数据库 2.2 对数据库操作2.2.1 增&#xff08;前端数据——>数据库&#xff09;2.2.2 查&#xff08;数据库——>前端展示&#xff09;2.2.3 改&#xff08;修改数据&#xff0…...

SpringAOP详解(上)

当需要在方法前后做一些操作就需要借助动态代理来实现 一、动态代理实现方法 1、jdk自带实现方式 jdk实现代理是被代理类实现接口的方式 public interface UserInterface {void test(); }public class UserService implements UserInterface {public void test() {System.o…...

C++ 存储类

存储类定义 C 程序中变量/函数的范围&#xff08;可见性&#xff09;和生命周期。这些说明符放置在它们所修饰的类型之前。下面列出 C 程序中可用的存储类&#xff1a; autoregisterstaticexternmutablethread_local (C11) 从 C 17 开始&#xff0c;auto 关键字不再是 C 存储…...

【教程分享】Docker搭建Zipkin,实现数据持久化到MySQL、ES

1 拉取镜像 指定版本&#xff0c;在git查看相应版本&#xff0c;参考&#xff1a; https://github.com/openzipkin/zipkin 如2.21.7 docker pull openzipkin/zipkin:2.21.7 2 启动 Zipkin默认端口为9411。启动时通过-e server.portxxxx设置指定端口 docker run --name zi…...

使用VSCode开发Django指南

使用VSCode开发Django指南 一、概述 Django 是一个高级 Python 框架&#xff0c;专为快速、安全和可扩展的 Web 开发而设计。Django 包含对 URL 路由、页面模板和数据处理的丰富支持。 本文将创建一个简单的 Django 应用&#xff0c;其中包含三个使用通用基本模板的页面。在此…...

Cesium1.95中高性能加载1500个点

一、基本方式&#xff1a; 图标使用.png比.svg性能要好 <template><div id"cesiumContainer"></div><div class"toolbar"><button id"resetButton">重新生成点</button><span id"countDisplay&qu…...

【SpringBoot】100、SpringBoot中使用自定义注解+AOP实现参数自动解密

在实际项目中,用户注册、登录、修改密码等操作,都涉及到参数传输安全问题。所以我们需要在前端对账户、密码等敏感信息加密传输,在后端接收到数据后能自动解密。 1、引入依赖 <dependency><groupId>org.springframework.boot</groupId><artifactId...

【磁盘】每天掌握一个Linux命令 - iostat

目录 【磁盘】每天掌握一个Linux命令 - iostat工具概述安装方式核心功能基础用法进阶操作实战案例面试题场景生产场景 注意事项 【磁盘】每天掌握一个Linux命令 - iostat 工具概述 iostat&#xff08;I/O Statistics&#xff09;是Linux系统下用于监视系统输入输出设备和CPU使…...

MySQL用户和授权

开放MySQL白名单 可以通过iptables-save命令确认对应客户端ip是否可以访问MySQL服务&#xff1a; test: # iptables-save | grep 3306 -A mp_srv_whitelist -s 172.16.14.102/32 -p tcp -m tcp --dport 3306 -j ACCEPT -A mp_srv_whitelist -s 172.16.4.16/32 -p tcp -m tcp -…...

使用 SymPy 进行向量和矩阵的高级操作

在科学计算和工程领域&#xff0c;向量和矩阵操作是解决问题的核心技能之一。Python 的 SymPy 库提供了强大的符号计算功能&#xff0c;能够高效地处理向量和矩阵的各种操作。本文将深入探讨如何使用 SymPy 进行向量和矩阵的创建、合并以及维度拓展等操作&#xff0c;并通过具体…...

佰力博科技与您探讨热释电测量的几种方法

热释电的测量主要涉及热释电系数的测定&#xff0c;这是表征热释电材料性能的重要参数。热释电系数的测量方法主要包括静态法、动态法和积分电荷法。其中&#xff0c;积分电荷法最为常用&#xff0c;其原理是通过测量在电容器上积累的热释电电荷&#xff0c;从而确定热释电系数…...

Yolov8 目标检测蒸馏学习记录

yolov8系列模型蒸馏基本流程&#xff0c;代码下载&#xff1a;这里本人提交了一个demo:djdll/Yolov8_Distillation: Yolov8轻量化_蒸馏代码实现 在轻量化模型设计中&#xff0c;**知识蒸馏&#xff08;Knowledge Distillation&#xff09;**被广泛应用&#xff0c;作为提升模型…...

【C++特殊工具与技术】优化内存分配(一):C++中的内存分配

目录 一、C 内存的基本概念​ 1.1 内存的物理与逻辑结构​ 1.2 C 程序的内存区域划分​ 二、栈内存分配​ 2.1 栈内存的特点​ 2.2 栈内存分配示例​ 三、堆内存分配​ 3.1 new和delete操作符​ 4.2 内存泄漏与悬空指针问题​ 4.3 new和delete的重载​ 四、智能指针…...

uniapp 开发ios, xcode 提交app store connect 和 testflight内测

uniapp 中配置 配置manifest 文档&#xff1a;manifest.json 应用配置 | uni-app官网 hbuilderx中本地打包 下载IOS最新SDK 开发环境 | uni小程序SDK hbulderx 版本号&#xff1a;4.66 对应的sdk版本 4.66 两者必须一致 本地打包的资源导入到SDK 导入资源 | uni小程序SDK …...