Sonatype Nexus Repository Windows 版本目录包含在 Windows 上运行 Nexus Repository 所需的脚本和可执行文件。在 Windows 上将 Nexus Repository 安装为服务nexus.exe文件是 Apache Commons Daemon 的 procrun 工具的副本。该可执行文件封装了运行 Nexus Repository 作为 Windows 服务所需的 Java 调用。以管理员身份打开命令提示符运行以下命令install-nexus-service.bat此命令将使用默认设置安装 SonatypeNexusRepository 作为 Windows 服务sonatype-work 目录将是分发包中包含的目录位于此脚本的相对路径下。Nexus Repository 将使用捆绑的 JDK 21 运行时。自定义 sonatype-work 目录路径如果要使用不同的 sonatype-work 目录请提供绝对路径作为参数install-nexus-service.bat C:\my-sonatype-work自定义 Java 运行时如果要使用不同的 JDK有两种选择将环境变量INSTALL4J_JAVA_HOME_OVERRIDE设置为要使用的 JDK 的绝对路径。修改 nexus.rc 文本文件并在app_java_home变量中指定要使用的 JDK 的绝对路径。将 Nexus Repository 作为 Windows 服务启动安装服务后可以使用 Windows 服务控制面板启动和停止它。如果需要从命令行停止服务可以运行命令nexus.exe stop SonatypeNexusRepository要从命令行启动服务请运行命令nexus.exe start SonatypeNexusRepository要卸载服务请运行命令sc delete SonatypeNexusRepository从命令行启动 Nexus Repository如果要将 Nexus Repository 作为控制台应用程序而不是服务运行在安装服务后可以运行命令nexus.exe run SonatypeNexusRepository这将在前台启动 Nexus Repository 应用程序可以通过按CtrlD和CtrlC停止它。可能需要尝试几次才能停止。这对于调试很有用但不建议在生产环境中使用。如果在服务运行时尝试使用此命令将会收到类似以下的错误C:\nexus\nexus-3.79.1\binnexus.exe run SonatypeNexusRepository [2025-04-09 21:51:04] [info] ( prunsrv.c:2084) [ 7340] Apache Commons Daemon procrun (1.4.1.0 64-bit) started. [2025-04-09 21:51:04] [info] ( prunsrv.c:1911) [ 7340] Debugging SonatypeNexusRepository service... [2025-04-09 21:51:04] [debug] ( prunsrv.c:1681) [ 7340] Inside serviceMain()... [2025-04-09 21:51:04] [debug] ( prunsrv.c:1127) [ 7340] reportServiceStatusE: dwCurrentState 2 (SERVICE_START_PENDING), dwWin32ExitCode 0, dwWaitHint 3000 milliseconds, dwServiceSpecificExitCode 0. [2025-04-09 21:51:04] [info] ( prunsrv.c:1426) [ 7340] Starting service... [2025-04-09 21:51:04] [error] ( prunsrv.c:1438) [ 7340] Pid file C:\nexus-again\nexus-3.80.0-SNAPSHOT-win-x86_64\sonatype-work\nexus3\log\nexus.pid exists. [2025-04-09 21:51:04] [error] ( prunsrv.c:1438) [ 7340] The process cannot access the file because it is being used by another process. [2025-04-09 21:51:04] [error] ( prunsrv.c:1862) [ 7340] ServiceStart returned 1. [2025-04-09 21:51:04] [error] ( prunsrv.c:1862) [ 7340] The process cannot access the file because it is being used by another process. [2025-04-09 21:51:04] [debug] ( prunsrv.c:1127) [ 7340] reportServiceStatusE: dwCurrentState 1 (SERVICE_STOPPED), dwWin32ExitCode 1066, dwWaitHint 0 milliseconds, dwServiceSpecificExitCode 1. [2025-04-09 21:51:04] [info] ( prunsrv.c:1913) [ 7340] Debug service finished with exit code 1. [2025-04-09 21:51:04] [error] ( prunsrv.c:2181) [ 7340] Apache Commons Daemon procrun failed with exit value: 3 (failed to run service as console application). [2025-04-09 21:51:04] [error] ( prunsrv.c:2181) [ 7340] The process cannot access the file because it is being used by another process. The process cannot access the file because it is being used by another process. Failed to run service as console application. C:\nexus\nexus-3.79.1\bin
【2026最新】nexus3.90.x安装文件说明
Sonatype Nexus Repository Windows 版本目录包含在 Windows 上运行 Nexus Repository 所需的脚本和可执行文件。在 Windows 上将 Nexus Repository 安装为服务nexus.exe文件是 Apache Commons Daemon 的 procrun 工具的副本。该可执行文件封装了运行 Nexus Repository 作为 Windows 服务所需的 Java 调用。以管理员身份打开命令提示符运行以下命令install-nexus-service.bat此命令将使用默认设置安装 SonatypeNexusRepository 作为 Windows 服务sonatype-work 目录将是分发包中包含的目录位于此脚本的相对路径下。Nexus Repository 将使用捆绑的 JDK 21 运行时。自定义 sonatype-work 目录路径如果要使用不同的 sonatype-work 目录请提供绝对路径作为参数install-nexus-service.bat C:\my-sonatype-work自定义 Java 运行时如果要使用不同的 JDK有两种选择将环境变量INSTALL4J_JAVA_HOME_OVERRIDE设置为要使用的 JDK 的绝对路径。修改 nexus.rc 文本文件并在app_java_home变量中指定要使用的 JDK 的绝对路径。将 Nexus Repository 作为 Windows 服务启动安装服务后可以使用 Windows 服务控制面板启动和停止它。如果需要从命令行停止服务可以运行命令nexus.exe stop SonatypeNexusRepository要从命令行启动服务请运行命令nexus.exe start SonatypeNexusRepository要卸载服务请运行命令sc delete SonatypeNexusRepository从命令行启动 Nexus Repository如果要将 Nexus Repository 作为控制台应用程序而不是服务运行在安装服务后可以运行命令nexus.exe run SonatypeNexusRepository这将在前台启动 Nexus Repository 应用程序可以通过按CtrlD和CtrlC停止它。可能需要尝试几次才能停止。这对于调试很有用但不建议在生产环境中使用。如果在服务运行时尝试使用此命令将会收到类似以下的错误C:\nexus\nexus-3.79.1\binnexus.exe run SonatypeNexusRepository [2025-04-09 21:51:04] [info] ( prunsrv.c:2084) [ 7340] Apache Commons Daemon procrun (1.4.1.0 64-bit) started. [2025-04-09 21:51:04] [info] ( prunsrv.c:1911) [ 7340] Debugging SonatypeNexusRepository service... [2025-04-09 21:51:04] [debug] ( prunsrv.c:1681) [ 7340] Inside serviceMain()... [2025-04-09 21:51:04] [debug] ( prunsrv.c:1127) [ 7340] reportServiceStatusE: dwCurrentState 2 (SERVICE_START_PENDING), dwWin32ExitCode 0, dwWaitHint 3000 milliseconds, dwServiceSpecificExitCode 0. [2025-04-09 21:51:04] [info] ( prunsrv.c:1426) [ 7340] Starting service... [2025-04-09 21:51:04] [error] ( prunsrv.c:1438) [ 7340] Pid file C:\nexus-again\nexus-3.80.0-SNAPSHOT-win-x86_64\sonatype-work\nexus3\log\nexus.pid exists. [2025-04-09 21:51:04] [error] ( prunsrv.c:1438) [ 7340] The process cannot access the file because it is being used by another process. [2025-04-09 21:51:04] [error] ( prunsrv.c:1862) [ 7340] ServiceStart returned 1. [2025-04-09 21:51:04] [error] ( prunsrv.c:1862) [ 7340] The process cannot access the file because it is being used by another process. [2025-04-09 21:51:04] [debug] ( prunsrv.c:1127) [ 7340] reportServiceStatusE: dwCurrentState 1 (SERVICE_STOPPED), dwWin32ExitCode 1066, dwWaitHint 0 milliseconds, dwServiceSpecificExitCode 1. [2025-04-09 21:51:04] [info] ( prunsrv.c:1913) [ 7340] Debug service finished with exit code 1. [2025-04-09 21:51:04] [error] ( prunsrv.c:2181) [ 7340] Apache Commons Daemon procrun failed with exit value: 3 (failed to run service as console application). [2025-04-09 21:51:04] [error] ( prunsrv.c:2181) [ 7340] The process cannot access the file because it is being used by another process. The process cannot access the file because it is being used by another process. Failed to run service as console application. C:\nexus\nexus-3.79.1\bin