顿搜
飞过闲红千叶,夕岸在哪
类目归类
pkg install openjdk8wget https://www.sonatype.com/oss-thank-you-tar.gzvim etc/nexus-default.propertiesvim bin/nexus.rcvim bin/nexus.jvmoptionsbin/nexus start (stop/restart...)pkg install nginxvim /usr/local/etc/nginx/nginx.confserver {
listen 80;
server_name [你的域名];
charset utf-8;
access_log logs/nexus_access.log main;
include proxy.conf;
location / {
proxy_pass http://127.0.0.1:8081;
}
location ~ ^/(WEB-INF)/ {
deny all;
}
location ~ \.(php|asp|aspx) {
deny all;
}
}其中proxy.conf的内容为
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header RealIP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
client_max_body_size 100m;
proxy_connect_timeout 3s;
proxy_send_timeout 1m;
proxy_read_timeout 1m;
proxy_temp_file_write_size 1024m;
proxy_buffer_size 32k;
proxy_buffers 4 32k;
proxy_busy_buffers_size 64k;
proxy_ignore_client_abort on;
proxy_next_upstream error timeout invalid_header http_503;启动 nginx
service nginx start访问 nexus, 登录 admin, 密码在sonatype-work中
只开放
nx-repository-view-maven2-maven-releases-*
nx-repository-view-maven2-maven-snapshots-*Roles 包含 nx-anonymous
绑定 role,同时加上nx-anonymous
增加maven发布插件
plugins {
id 'maven-publish'
}配置好仓库
repositories {
maven {
url 'https://maven.aliyun.com/repository/public/'
}
mavenLocal()
mavenCentral()
maven {
url 'http://[你的域名]/repository/maven-releases/'
credentials {
username = '[您的用户名]'
password = '[您的密码]'
}
}
maven {
url 'http://[你的域名]/repository/maven-snapshots/'
credentials {
username = '[您的用户名]'
password = '[您的密码]'
}
}
}