编译环境1
new vm(vbox)同时连通本机和外网-(两张网卡nat + hostonly)
添加新NAT网络
ip addr
修改ip: vi /etc/sysconfig/network-scripts/ifcfg-enp0s3
GATEWAY=10.0.2.1
IPADDR=10.0.2.100
NETMASK=255.255.255.0
重启systemctl restart network
install: jdk,maven https://maven.apache.org/download.cgi
set maven mirror:
只有一张网卡工作时 修改配置后应用变更
ifconfig -a
sudo netplan apply
root@kali:# ifconfig enp0s17 up //启用网卡 root@kali:# ifconfig -a //查看IP root@kali:~# dhclient enp0s17 // 分配IP
1 2 3 4 5 6 7 8 9 cat /etc/netplan/00-installer-config.yaml # This is the network config written by 'subiquity' network: ethernets: enp0s3: dhcp4: true enp0s8: dhcp4: true version: 2
1 2 3 4 5 6 <mirror> <id>aliyunmaven</id> <mirrorOf>*</mirrorOf> <name>阿里云公共仓库</name> <url>https://maven.aliyun.com/repository/public</url> </mirror>
编译环境2
安装multipass
挂载目录
multipass set local.privileged-mounts=true
multipass exec primary mkdir /mnt/e
multipass mount E:\ primary:/mnt/e
修改系统更新源
安装mvn
sudo apt-get install maven
修改仓库源
vi /usr/share/maven/conf/settings.xml
问题
空间不足,需要挂载
挂载后无法管理权限,脚本无法直接执行
1 2 3 4 5 <mirror > <id > huaweicloud</id > <mirrorOf > *</mirrorOf > <url > https://repo.huaweicloud.com/repository/maven/</url > </mirror >
编译操作
Vagrant with VirtualBox (vmware/hyper-v also supported) https://zhuanlan.zhihu.com/p/259833884