抱歉,您的浏览器无法访问本站
本页面需要浏览器支持(启用)JavaScript
了解详情 >

插件的groupdId和artifactId

1
2
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>

介绍

Resources插件负责处理项目资源文件并拷贝到输出目录。Maven将main resources和test resources分开,一般main resources关联main source code,而test resources关联test source code。

Resources插件目标有三个:

  1. resources:resources,拷贝main resources到main output directory。它绑定了process-resources生命周期阶段,当执行Compiler:compile插件目标前就会执行此阶段。
  2. resources:testResources,拷贝test resources到test output directory。它绑定了process-test-resources生命周期阶段,当执行surefire:test插件目标前就会执行此阶段。
  3. resources:copy-resources,手动拷贝资源到输出目录

可以指定resources插件读取和写入文件的字符编码,比如ASCII,UTF-8或UTF-16。也可以指定${project.build.sourceEncoding}属性。

1
2
3
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

查看ip地址

通过查看详细的json配置,里面写着容器的ip地址,docker inspect 会返回一个 JSON 文件记录着 Docker 容器的配置和状态信息

script
1
2
3
4
5
6
7
8
docker inspect NAMES 
# 查看容器所有状态信息;

docker inspect --format='{{.NetworkSettings.IPAddress}}' ID/NAMES
# 查看 容器ip 地址

docker inspect --format '{{.Name}} {{.State.Running}}' NAMES
# 容器运行状态

参考来源

https://www.cnblogs.com/sharesdk/p/10185931.html

/etc/vsftpd/vsftpd.conf

1
2
3
4
## Enable active mode
port_enable=YES
connect_from_port_20=YES
ftp_data_port=20

通过自定义异常拦截器,讲程序异常,转化为 org.springframework.http.ResponseEntity.ResponseEntity,这个类允许自定义任意的状态码和错误数据。

代码

1
2
3
4
5
6
7
8
9
public void save(BusUser busUser) {
BusUser.checkAccountAndPasswordNotNull(busUser);
if (busUserRepository.findByAccount(busUser.getAccount()).size() != 0) {
throw new ApiException(ErrorType.SAVE_EXIST, "账号已经存在!");
}
// 存储的时候,服务器应该再次进行一次 hash,双重哈希,避免数据库泄漏,密码被人拿去登陆 todo
busUserRepository.save(busUser);
log.info("增加了一个用户:" + busUser.getAccount());
}

GlobalExceptionHandler.class

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package pri.anarckk.common;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler;
import pri.anarckk.common.entity.ErrorEntity;
import pri.anarckk.common.exception.ApiException;

/**
* Created by zzanar on 2019/6/1
* 全局异常事件处理类
*/
@ControllerAdvice
public class GlobalExceptionHandler extends ResponseEntityExceptionHandler {
private final Logger logger = LoggerFactory.getLogger(GlobalExceptionHandler.class);

@ResponseBody
@ExceptionHandler
public ResponseEntity<ErrorEntity> handleException(Exception e) {
if (e instanceof ApiException) {
ApiException apiException = (ApiException) e;
ErrorType code = apiException.getCode();
apiException.error(logger);
return new ResponseEntity<>(new ErrorEntity(code.code(), apiException.getMessage()), code.httpStatus());
} else {
logger.error(e.getMessage(), e);
return new ResponseEntity<>(new ErrorEntity(ErrorType.UN_KNOW.code(), ErrorType.UN_KNOW.message()), ErrorType.UN_KNOW.httpStatus());
}
}
}

https://www.cnblogs.com/badtree/articles/9145493.html

创建容器的时候报错WARNING: IPv4 forwarding is disabled. Networking will not work.

script
1
2
docker run -p 3000:3000 liyasthomas/postwoman:latest
WARNING: IPv4 forwarding is disabled. Networking will not work.

解决方法

script
1
vim  /usr/lib/sysctl.d/00-system.conf

添加如下代码:

script
1
net.ipv4.ip_forward=1

重启network服务

script
1
systemctl restart network

完成以后,删除错误的容器,再次创建新容器,就不再报错了。

查看IP

script
1
ip addr

查看路由

script
1
ip route

查看DNS

script
1
cat /etc/resolv.conf

查看主机名

script
1
hostname

查看网关

script
1
netstat -rn

  1. 指定cmd窗口运行时名称

  1)直接执行命令:title 窗口名称 

  2)bat文件中直接加上命令:title 窗口名称

例子:

script
1
2
title test_ v1
java -jar -Dfile.encoding=utf-8 test-1.0.1.jar

iis 的 default web site 默认的本地网站路径

%SystemDrive%\inetpub\wwwroot

一切得先从我的操作说起。

在集成mybatis-plus过程中,我将 pagehelper-spring-boot-starter 拆成两个依赖包

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<!-- 分页插件 -->
<!-- <dependency>-->
<!-- <groupId>com.github.pagehelper</groupId>-->
<!-- <artifactId>pagehelper-spring-boot-starter</artifactId>-->
<!-- <version>1.2.5</version>-->
<!-- </dependency>-->
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper</artifactId>
<version>5.1.4</version>
</dependency>
<!-- pagehelper 依赖 -->
<dependency>
<groupId>com.github.jsqlparser</groupId>
<artifactId>jsqlparser</artifactId>
<version>1.0</version>
</dependency>