Skip to content

Commit

Permalink
upstream: b=main,r=b02607d632761319a510375c56abac8806719f08,t=2024-11…
Browse files Browse the repository at this point in the history
…-08-1342-51824
  • Loading branch information
sonatype-zion committed Nov 8, 2024
1 parent e4622a7 commit 4820a1e
Show file tree
Hide file tree
Showing 814 changed files with 27,859 additions and 7,567 deletions.
18 changes: 5 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,15 @@ Sonatype Nexus Repository Pro customers can use https://support.sonatype.com/.

## Build Requirements

Builds use Apache Maven and require Java 8. Apache Maven wrapper scripts are included in the source tree.

All release versioned dependencies should be available from the [Central](https://repo1.maven.org/maven2/) repository.

For SNAPSHOT sources, SNAPSHOT versioned dependencies may only be available from https://repository.sonatype.org/content/groups/sonatype-public-grid repository.
Builds use Apache Maven and require Java 17. Apache Maven wrapper scripts are included in the source tree.

### Configuring Maven for SNAPSHOT Dependencies

Following best practices, the nexus-public POM does not include any root `<repositories>` elements.

Instead you are advised to [configure Apache Maven to point at single repository mirror URL](https://maven.apache.org/guides/mini/guide-mirror-settings.html#using-a-single-repository) that is a group repository containing both Central proxy repository with Release version policy and sonatype-public-grid with a SNAPSHOT version policy. You can use a [repository manager](https://www.sonatype.org/nexus/go/) to set up a group repository that contains both of these remotes.

Alternately, [add a custom profile to a settings.xml](https://maven.apache.org/guides/mini/guide-multiple-repositories.html) for repository manager development that includes both repositories.

## Building From Source

Released versions are tagged and branched using a name of the form `release-{version}`. For example: `release-3.29.2-02`
Released versions are tagged and branched using a name of the form `release-{version}`. For example: `release-3.72.0-04`

To build a tagged release, first fetch all tags:

Expand All @@ -53,16 +45,16 @@ git fetch --tags
Then checkout the remote branch you want. For example:

```shell
git checkout -b release-3.29.2-02 origin/release-3.29.2-02 --
git checkout -b release-3.72.0-04 origin/release-3.72.0-04 --
```

Then build using the included Maven wrapper script. For example:

```shell
./mvnw clean install
./mvnw clean install -Dpublic
```

For building SNAPSHOT versions, follow the same process, except your build may require access to [Sonatype Public Grid](https://repository.sonatype.org/content/groups/sonatype-public-grid) to successfully resolve dependencies.
The `public` property is required outside of Sonatype's internal infrastructure.

## Running

Expand Down
2 changes: 1 addition & 1 deletion assemblies/nexus-base-feature/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<parent>
<groupId>org.sonatype.nexus.assemblies</groupId>
<artifactId>nexus-assemblies</artifactId>
<version>3.72.0-SNAPSHOT</version>
<version>3.75.0-SNAPSHOT</version>
</parent>

<artifactId>nexus-base-feature</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion assemblies/nexus-base-overlay/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<groupId>org.sonatype.nexus.assemblies</groupId>
<artifactId>nexus-assemblies</artifactId>
<version>3.72.0-SNAPSHOT</version>
<version>3.75.0-SNAPSHOT</version>
</parent>

<artifactId>nexus-base-overlay</artifactId>
Expand Down
90 changes: 37 additions & 53 deletions assemblies/nexus-base-overlay/src/main/resources/overlay/bin/nexus
Original file line number Diff line number Diff line change
Expand Up @@ -278,9 +278,9 @@ checkJvmVersion() {

VERSION=`"${JAVA}" -version 2>&1 | ${AWK} -F '"' '/version/ {print $2}' | sed -e 's/_.*//g; s/^1\.//g; s/\..*//g; s/-.*//g;'`

# java must be at least version 8
if [ "${VERSION}" -lt "8" ]; then
die "JVM must be greater than 1.8"
# java must be at least version 17
if [ "${VERSION}" -lt "17" ]; then
die "JVM must be greater than 17"
fi
}

Expand Down Expand Up @@ -563,56 +563,40 @@ run() {
mkdir -p "${KARAF_DATA}/tmp"
fi

if [ "${VERSION}" -gt "8" ]; then
launch "${JAVA}" ${JAVA_OPTS} \
--add-reads=java.xml=java.logging \
--add-exports=java.base/org.apache.karaf.specs.locator=java.xml,ALL-UNNAMED \
--patch-module java.base=${KARAF_HOME}/lib/endorsed/org.apache.karaf.specs.locator-4.3.9.jar \
--patch-module java.xml=${KARAF_HOME}/lib/endorsed/org.apache.karaf.specs.java.xml-4.3.9.jar \
--add-opens java.base/java.security=ALL-UNNAMED \
--add-opens java.base/java.net=ALL-UNNAMED \
--add-opens java.base/java.lang=ALL-UNNAMED \
--add-opens java.base/java.util=ALL-UNNAMED \
--add-opens java.naming/javax.naming.spi=ALL-UNNAMED \
--add-opens java.rmi/sun.rmi.transport.tcp=ALL-UNNAMED \
--add-exports=java.base/sun.net.www.protocol.http=ALL-UNNAMED \
--add-exports=java.base/sun.net.www.protocol.https=ALL-UNNAMED \
--add-exports=java.base/sun.net.www.protocol.jar=ALL-UNNAMED \
--add-exports=jdk.xml.dom/org.w3c.dom.html=ALL-UNNAMED \
--add-exports=jdk.naming.rmi/com.sun.jndi.url.rmi=ALL-UNNAMED \
--add-exports java.security.sasl/com.sun.security.sasl=ALL-UNNAMED \
-Dkaraf.instances="${KARAF_HOME}/instances" \
-Dkaraf.home="${KARAF_HOME}" \
-Dkaraf.base="${KARAF_BASE}" \
-Dkaraf.data="${KARAF_DATA}" \
-Dkaraf.etc="${KARAF_ETC}" \
-Dkaraf.log="${KARAF_LOG}" \
-Dkaraf.restart.jvm.supported=true \
-Djava.io.tmpdir="${KARAF_DATA}/tmp" \
-Djava.util.logging.config.file="${KARAF_BASE}/etc/java.util.logging.properties" \
${KARAF_SYSTEM_OPTS} \
${KARAF_OPTS} \
${OPTS} \
-classpath "${CLASSPATH}" \
${MAIN} "$@"
else
launch "${JAVA}" ${JAVA_OPTS} \
-Djava.endorsed.dirs="${JAVA_ENDORSED_DIRS}" \
-Dkaraf.instances="${KARAF_HOME}/instances" \
-Dkaraf.home="${KARAF_HOME}" \
-Dkaraf.base="${KARAF_BASE}" \
-Dkaraf.data="${KARAF_DATA}" \
-Dkaraf.etc="${KARAF_ETC}" \
-Dkaraf.log="${KARAF_LOG}" \
-Dkaraf.restart.jvm.supported=true \
-Djava.io.tmpdir="${KARAF_DATA}/tmp" \
-Djava.util.logging.config.file="${KARAF_BASE}/etc/java.util.logging.properties" \
${KARAF_SYSTEM_OPTS} \
${KARAF_OPTS} \
${OPTS} \
-classpath "${CLASSPATH}" \
${MAIN} "$@"
fi
launch "${JAVA}" ${JAVA_OPTS} \
--add-reads=java.xml=java.logging \
--add-exports=java.base/org.apache.karaf.specs.locator=java.xml,ALL-UNNAMED \
--patch-module java.base=${KARAF_HOME}/lib/endorsed/org.apache.karaf.specs.locator-4.3.9.jar \
--patch-module java.xml=${KARAF_HOME}/lib/endorsed/org.apache.karaf.specs.java.xml-4.3.9.jar \
--add-opens java.base/java.security=ALL-UNNAMED \
--add-opens java.base/java.net=ALL-UNNAMED \
--add-opens java.base/java.lang=ALL-UNNAMED \
--add-opens java.base/java.util=ALL-UNNAMED \
--add-opens java.naming/javax.naming.spi=ALL-UNNAMED \
--add-opens java.rmi/sun.rmi.transport.tcp=ALL-UNNAMED \
--add-exports=java.base/sun.net.www.protocol.http=ALL-UNNAMED \
--add-exports=java.base/sun.net.www.protocol.https=ALL-UNNAMED \
--add-exports=java.base/sun.net.www.protocol.jar=ALL-UNNAMED \
--add-exports=jdk.xml.dom/org.w3c.dom.html=ALL-UNNAMED \
--add-exports=jdk.naming.rmi/com.sun.jndi.url.rmi=ALL-UNNAMED \
--add-exports java.security.sasl/com.sun.security.sasl=ALL-UNNAMED \
--add-exports=java.base/sun.security.x509=ALL-UNNAMED \
--add-exports=java.base/sun.security.rsa=ALL-UNNAMED \
--add-exports=java.base/sun.security.pkcs=ALL-UNNAMED \
-Dkaraf.instances="${KARAF_HOME}/instances" \
-Dkaraf.home="${KARAF_HOME}" \
-Dkaraf.base="${KARAF_BASE}" \
-Dkaraf.data="${KARAF_DATA}" \
-Dkaraf.etc="${KARAF_ETC}" \
-Dkaraf.log="${KARAF_LOG}" \
-Dkaraf.restart.jvm.supported=true \
-Djava.io.tmpdir="${KARAF_DATA}/tmp" \
-Djava.util.logging.config.file="${KARAF_BASE}/etc/java.util.logging.properties" \
${KARAF_SYSTEM_OPTS} \
${KARAF_OPTS} \
${OPTS} \
-classpath "${CLASSPATH}" \
${MAIN} "$@"

KARAF_RC=$?
if [ ${KARAF_DAEMON} ] ; then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -357,52 +357,37 @@ if "%KARAF_PROFILER%" == "" goto :RUN
popd
)

rem If major version is greater than 1 (meaning Java 9 or 10), we don't use endorsed lib but module
rem If major version is 1 (meaning Java 1.6, 1.7, 1.8), we use endorsed lib
if %JAVA_VERSION% GTR 8 (
"%JAVA%" %JAVA_OPTS% %OPTS% ^
--add-reads=java.xml=java.logging ^
--add-exports=java.base/org.apache.karaf.specs.locator=java.xml,ALL-UNNAMED ^
--patch-module java.base=%KARAF_HOME%\lib\endorsed\org.apache.karaf.specs.locator-4.3.9.jar ^
--patch-module java.xml=%KARAF_HOME%\lib\endorsed\org.apache.karaf.specs.java.xml-4.3.9.jar ^
--add-opens java.base/java.security=ALL-UNNAMED ^
--add-opens java.base/java.net=ALL-UNNAMED ^
--add-opens java.base/java.lang=ALL-UNNAMED ^
--add-opens java.base/java.util=ALL-UNNAMED ^
--add-opens java.naming/javax.naming.spi=ALL-UNNAMED ^
--add-opens java.rmi/sun.rmi.transport.tcp=ALL-UNNAMED ^
--add-exports=java.base/sun.net.www.protocol.http=ALL-UNNAMED ^
--add-exports=java.base/sun.net.www.protocol.https=ALL-UNNAMED ^
--add-exports=java.base/sun.net.www.protocol.jar=ALL-UNNAMED ^
--add-exports=jdk.xml.dom/org.w3c.dom.html=ALL-UNNAMED ^
--add-exports=jdk.naming.rmi/com.sun.jndi.url.rmi=ALL-UNNAMED ^
--add-exports java.security.sasl/com.sun.security.sasl=ALL-UNNAMED ^
-classpath "%CLASSPATH%" ^
-Dkaraf.instances="%KARAF_HOME%\instances" ^
-Dkaraf.home="%KARAF_HOME%" ^
-Dkaraf.base="%KARAF_BASE%" ^
-Dkaraf.etc="%KARAF_ETC%" ^
-Dkaraf.log="%KARAF_LOG%" ^
-Dkaraf.restart.jvm.supported=true ^
-Djava.io.tmpdir="%KARAF_DATA%\tmp" ^
-Dkaraf.data="%KARAF_DATA%" ^
-Djava.util.logging.config.file="%KARAF_BASE%\etc\java.util.logging.properties" ^
%KARAF_SYSTEM_OPTS% %KARAF_OPTS% %MAIN% %ARGS%
) else (
"%JAVA%" %JAVA_OPTS% %OPTS% ^
-classpath "%CLASSPATH%" ^
-Djava.endorsed.dirs="%JAVA_HOME%\jre\lib\endorsed;%JAVA_HOME%\lib\endorsed;%KARAF_HOME%\lib\endorsed" ^
-Dkaraf.instances="%KARAF_HOME%\instances" ^
-Dkaraf.home="%KARAF_HOME%" ^
-Dkaraf.base="%KARAF_BASE%" ^
-Dkaraf.etc="%KARAF_ETC%" ^
-Dkaraf.log="%KARAF_LOG%" ^
-Dkaraf.restart.jvm.supported=true ^
-Djava.io.tmpdir="%KARAF_DATA%\tmp" ^
-Dkaraf.data="%KARAF_DATA%" ^
-Djava.util.logging.config.file="%KARAF_BASE%\etc\java.util.logging.properties" ^
%KARAF_SYSTEM_OPTS% %KARAF_OPTS% %MAIN% %ARGS%
)
"%JAVA%" %JAVA_OPTS% %OPTS% ^
--add-reads=java.xml=java.logging ^
--add-exports=java.base/org.apache.karaf.specs.locator=java.xml,ALL-UNNAMED ^
--patch-module java.base=%KARAF_HOME%\lib\endorsed\org.apache.karaf.specs.locator-4.3.9.jar ^
--patch-module java.xml=%KARAF_HOME%\lib\endorsed\org.apache.karaf.specs.java.xml-4.3.9.jar ^
--add-opens java.base/java.security=ALL-UNNAMED ^
--add-opens java.base/java.net=ALL-UNNAMED ^
--add-opens java.base/java.lang=ALL-UNNAMED ^
--add-opens java.base/java.util=ALL-UNNAMED ^
--add-opens java.naming/javax.naming.spi=ALL-UNNAMED ^
--add-opens java.rmi/sun.rmi.transport.tcp=ALL-UNNAMED ^
--add-exports=java.base/sun.net.www.protocol.http=ALL-UNNAMED ^
--add-exports=java.base/sun.net.www.protocol.https=ALL-UNNAMED ^
--add-exports=java.base/sun.net.www.protocol.jar=ALL-UNNAMED ^
--add-exports=jdk.xml.dom/org.w3c.dom.html=ALL-UNNAMED ^
--add-exports=jdk.naming.rmi/com.sun.jndi.url.rmi=ALL-UNNAMED ^
--add-exports java.security.sasl/com.sun.security.sasl=ALL-UNNAMED ^
--add-exports=java.base/sun.security.x509=ALL-UNNAMED ^
--add-exports=java.base/sun.security.rsa=ALL-UNNAMED ^
--add-exports=java.base/sun.security.pkcs=ALL-UNNAMED ^
-classpath "%CLASSPATH%" ^
-Dkaraf.instances="%KARAF_HOME%\instances" ^
-Dkaraf.home="%KARAF_HOME%" ^
-Dkaraf.base="%KARAF_BASE%" ^
-Dkaraf.etc="%KARAF_ETC%" ^
-Dkaraf.log="%KARAF_LOG%" ^
-Dkaraf.restart.jvm.supported=true ^
-Djava.io.tmpdir="%KARAF_DATA%\tmp" ^
-Dkaraf.data="%KARAF_DATA%" ^
-Djava.util.logging.config.file="%KARAF_BASE%\etc\java.util.logging.properties" ^
%KARAF_SYSTEM_OPTS% %KARAF_OPTS% %MAIN% %ARGS%

rem If KARAF_DAEMON is defined, auto-restart is bypassed and control given
rem back to the operating system
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,9 @@
<logger name="org.apache.felix" level="WARN"/>
<logger name="org.apache.karaf" level="WARN"/>

<logger name="com.amazonaws.internal.InstanceMetadataServiceResourceFetcher" level="ERROR"/>
<logger name="com.amazonaws.util.EC2MetadataUtils" level="ERROR"/>

<include file="${karaf.data}/etc/logback/logback-tasklogfile-appender-override.xml" optional="true"/>

<root level="${root.level:-INFO}">
Expand Down
2 changes: 1 addition & 1 deletion assemblies/nexus-base-template/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<groupId>org.sonatype.nexus.assemblies</groupId>
<artifactId>nexus-assemblies</artifactId>
<version>3.72.0-SNAPSHOT</version>
<version>3.75.0-SNAPSHOT</version>
</parent>

<artifactId>nexus-base-template</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion assemblies/nexus-boot-feature/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<parent>
<groupId>org.sonatype.nexus.assemblies</groupId>
<artifactId>nexus-assemblies</artifactId>
<version>3.72.0-SNAPSHOT</version>
<version>3.75.0-SNAPSHOT</version>
</parent>

<artifactId>nexus-boot-feature</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion assemblies/nexus-core-feature/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<parent>
<groupId>org.sonatype.nexus.assemblies</groupId>
<artifactId>nexus-assemblies</artifactId>
<version>3.72.0-SNAPSHOT</version>
<version>3.75.0-SNAPSHOT</version>
</parent>

<artifactId>nexus-core-feature</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion assemblies/nexus-startup-feature/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<parent>
<groupId>org.sonatype.nexus.assemblies</groupId>
<artifactId>nexus-assemblies</artifactId>
<version>3.72.0-SNAPSHOT</version>
<version>3.75.0-SNAPSHOT</version>
</parent>

<artifactId>nexus-startup-feature</artifactId>
Expand Down
6 changes: 3 additions & 3 deletions assemblies/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<groupId>org.sonatype.nexus</groupId>
<artifactId>nexus-parent</artifactId>
<version>3.72.0-SNAPSHOT</version>
<version>3.75.0-SNAPSHOT</version>
</parent>

<groupId>org.sonatype.nexus.assemblies</groupId>
Expand All @@ -46,15 +46,15 @@
<groupId>org.sonatype.nexus</groupId>
<artifactId>nexus-components</artifactId>
<type>pom</type>
<version>3.72.0-SNAPSHOT</version>
<version>3.75.0-SNAPSHOT</version>
<scope>import</scope>
</dependency>

<dependency>
<groupId>org.sonatype.nexus.plugins</groupId>
<artifactId>nexus-plugins</artifactId>
<type>pom</type>
<version>3.72.0-SNAPSHOT</version>
<version>3.75.0-SNAPSHOT</version>
<scope>import</scope>
</dependency>

Expand Down
Loading

0 comments on commit 4820a1e

Please sign in to comment.