Missining npm dependency while building release-3.68.1-02
- What problem are you trying to solve? Building release-3.68.1-02 on WSL/Ubuntu 22.04.4 LTS and openjdk version "1.8.0_412".
- Do you have a workaround you are using at present? No workaround at present.
- What feature or behavior is this required for?
- How could we solve this issue? (Not knowing is okay!)
- Tell us about your Nexus Repository deployment: what version, operating system, and database are you using? Cloned source code and switch to release-3.68.1-02
- Anything else? Switched to release-3.68.1-02 cause release-3.69.0-02 first fails on unit tests
[INFO] error Couldn't find package "@sonatype/nexus-ui-plugin@workspace:*" required by "@sonatype/[email protected]" on the "npm" registry. [INFO] error Couldn't find package "@sonatype/nexus-ui-plugin@workspace:*" required by "@sonatype/[email protected]" on the "npm" registry.info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command. [INFO] Error: Couldn't find package "@sonatype/nexus-ui-plugin@workspace:*" required by "@sonatype/[email protected]" on the "npm" registry.
I'm having the same issue in release-3.71.0-06 too.
kindly ping @nblair, if this is something you could help with, is it flake or something?
I am encountering the same issue in release-3.73.0-12 as well.
I am encountering the same issue in release-3.71.0-06 as well.
Same goes for https://github.com/sonatype/nexus-public/releases/tag/release-3.75.1-01
We also encounter the same issue when trying to bring the nexus Homebrew formula up to date.
do you solve it?
To even get the build to the point to trigger to the @sonatype/nexus-ui-plugin@workspace:* error described in this issue, I had to modify the root project pom.xml to include the profile described in https://github.com/sonatype/nexus-public/issues/525, otherwise I was hitting the following test failure:
ERROR] Tests run: 7, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.099 s <<< FAILURE! -- in org.sonatype.nexus.internal.log.LastShutdownTimeServiceImplTest
[ERROR] org.sonatype.nexus.internal.log.LastShutdownTimeServiceImplTest.handleMissingStartMarker -- Time elapsed: 0.004 s <<< ERROR!
java.lang.NullPointerException: Cannot invoke "java.net.URL.toURI()" because the return value of "java.lang.Class.getResource(String)" is null
at org.sonatype.nexus.internal.log.LastShutdownTimeServiceImplTest.handleMissingStartMarker(LastShutdownTimeServiceImplTest.java:161)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:569)
...
Using Temurin 17 with release-3.77.1-01 in a clean environment (empty maven cache, first time trying to build this repo), I was able to move past the @sonatype/nexus-ui-plugin@workspace:* error by following the instructions in this comment:
https://github.com/sonatype/nexus-public/issues/248#issue-1899790290
However, I hit failures during testing. For example:
[INFO] --- frontend:1.11.3:yarn (js-unit-test) @ nexus-coreui-plugin ---
[INFO] Running 'yarn test --reporters=jest-junit --reporters=default' in /Users/sarms/dev/repos/nexus-public/plugins/nexus-coreui-plugin
[INFO] yarn run v1.22.19
[INFO] $ jest --config src/frontend/jest.config.js --reporters=jest-junit --reporters=default
[INFO] FAIL src/frontend/src/components/pages/admin/Repositories/RepositoriesForm.test.jsx
[INFO] ● Test suite failed to run
[INFO]
[INFO] Jest encountered an unexpected token
[INFO]
[INFO] Jest failed to parse a file. This happens e.g. when your code or its dependencies use non-standard JavaScript syntax, or when Jest is not configured to support such syntax.
[INFO]
[INFO] Out of the box Jest supports Babel, which will be used to transform your files into valid JS based on your Babel configuration.
[INFO]
[INFO] By default "node_modules" folder is ignored by transformers.
[INFO]
[INFO] Here's what you can do:
[INFO] • If you are trying to use ECMAScript Modules, see https://jestjs.io/docs/ecmascript-modules for how to enable it.
[INFO] • If you are trying to use TypeScript, see https://jestjs.io/docs/getting-started#using-typescript
[INFO] • To have some of your "node_modules" files transformed, you can specify a custom "transformIgnorePatterns" in your config.
[INFO] • If you need a custom transformation specify a "transform" option in your config.
[INFO] • If you simply want to mock your non-JS modules (e.g. binary assets) you can stub them out with the "moduleNameMapper" config option.
[INFO]
[INFO] You'll find more details and examples of these config options in the docs:
[INFO] https://jestjs.io/docs/configuration
[INFO] For information about custom transformations, see:
[INFO] https://jestjs.io/docs/code-transformation
[INFO]
[INFO] Details:
[INFO]
[INFO] /Users/sarms/dev/repos/nexus-public/plugins/nexus-coreui-plugin/node_modules/@sonatype/nexus-ui-plugin/src/frontend/src/interface/TestUtils.js:17
[INFO] import {fireEvent, render, screen, waitFor, within, waitForElementToBeRemoved} from '@testing-library/react';
[INFO] ^^^^^^
[INFO]
[INFO] SyntaxError: Cannot use import statement outside a module
[INFO]
[INFO] 30 |
[INFO] 31 | import {ExtAPIUtils, APIConstants, ExtJS} from '@sonatype/nexus-ui-plugin';
[INFO] > 32 | import TestUtils from '@sonatype/nexus-ui-plugin/src/frontend/src/interface/TestUtils';
[INFO] | ^
[INFO] 33 | import UIStrings from '../../../../constants/UIStrings';
[INFO] 34 |
[INFO] 35 | import RepositoriesForm from './RepositoriesForm';
[INFO]
[INFO] at Runtime.createScriptFromCode (../../../../node_modules/jest-runtime/build/index.js:1505:14)
[INFO] at Object.require (src/components/pages/admin/Repositories/RepositoriesForm.test.jsx:32:1)
[INFO]
If I skip tests using ./mvnw clean install -Dpublic -DskipTests, I then get the following error:
[ERROR] Failed to execute goal on project nexus-content-suite: Could not resolve dependencies for project org.sonatype.nexus.testsuite:nexus-content-suite:jar:3.77.1-01: The following artifacts could not be resolved: org.sonatype.nexus.testsuite:nexus-repository-content-testsupport:jar:3.77.1-01 (absent): org.sonatype.nexus.testsuite:nexus-repository-content-testsupport:jar:3.77.1-01 was not found in https://repo.maven.apache.org/maven2 during a previous attempt. This failure was cached in the local repository
The build is looking for version 3.77.1-01 of org.sonatype.nexus.testsuite:nexus-repository-content-testsupport, but the latest on maven central is 3.76.1-01.
Dependency is not missing. Somebody started to use newer version of yarn (as seen in package.json - packageManager is [email protected] and they use workspaces)
So.. weird combination that works:
- install node via nvm
- navigate into nexus-public
- enable corepack:
corepack enable - check yarn is 3.23:
yarn --version - setup yarn config to use node_modules:
yarn config set nodeLinker node-modules - apply patch...
- run build:
./mvnw -DskipTests -Dpublic package
patch:
Index: pom.xml
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/pom.xml b/pom.xml
--- a/pom.xml (revision 1771231bbe5e305837bfdaa73ae5289c100c9417)
+++ b/pom.xml (date 1741280281110)
@@ -71,7 +71,7 @@
<!-- Define the node and yarn versions used by the frontend-maven-plugin -->
<node.version>v18.17.1</node.version>
- <yarn.version>v1.22.19</yarn.version>
+ <yarn.version>v4.7.0</yarn.version>
<npm.install>install --immutable</npm.install>
<npm.skipTests>false</npm.skipTests>
<npm.build>build-all</npm.build>
@@ -811,7 +811,7 @@
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
- <version>1.11.3</version>
+ <version>1.15.1</version>
<configuration>
<nodeVersion>${node.version}</nodeVersion>
@@ -825,41 +825,48 @@
</configuration>
<executions>
+<!-- <execution>-->
+<!-- <id>install node and yarn</id>-->
+<!-- <goals>-->
+<!-- <goal>install-node-and-yarn</goal>-->
+<!-- </goals>-->
+<!-- <phase>generate-resources</phase>-->
+<!-- </execution>-->
<execution>
- <id>install node and yarn</id>
+ <id>install node</id>
<goals>
- <goal>install-node-and-yarn</goal>
+ <goal>install-node-and-npm</goal>
</goals>
<phase>generate-resources</phase>
</execution>
<execution>
<id>yarn cache clean</id>
<goals>
- <goal>yarn</goal>
+ <goal>corepack</goal>
</goals>
<phase>generate-resources</phase>
<configuration>
- <arguments>cache clean</arguments>
+ <arguments>yarn cache clean</arguments>
</configuration>
</execution>
<execution>
<id>yarn install</id>
<goals>
- <goal>yarn</goal>
+ <goal>corepack</goal>
</goals>
<phase>generate-resources</phase>
<configuration>
- <arguments>${npm.install}</arguments>
+ <arguments>yarn ${npm.install}</arguments>
</configuration>
</execution>
<execution>
<id>yarn run build</id>
<goals>
- <goal>yarn</goal>
+ <goal>corepack</goal>
</goals>
<phase>compile</phase>
<configuration>
- <arguments>${npm.build}</arguments>
+ <arguments>yarn ${npm.build}</arguments>
</configuration>
</execution>
</executions>
@@ -1906,7 +1913,7 @@
<artifactId>frontend-maven-plugin</artifactId>
<versionRange>[0.7,)</versionRange>
<goals>
- <goal>install-node-and-yarn</goal>
+ <goal>install-node-and-npm</goal>
<goal>yarn</goal>
</goals>
</pluginExecutionFilter>
Index: .gitignore
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/.gitignore b/.gitignore
--- a/.gitignore (revision 1771231bbe5e305837bfdaa73ae5289c100c9417)
+++ b/.gitignore (date 1741280427772)
@@ -24,4 +24,8 @@
# Zion
.zion/
-variables.properties
\ No newline at end of file
+variables.properties
+
+#
+.yarn
+node_modules
\ No newline at end of file
Index: plugins/nexus-coreui-plugin/pom.xml
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/plugins/nexus-coreui-plugin/pom.xml b/plugins/nexus-coreui-plugin/pom.xml
--- a/plugins/nexus-coreui-plugin/pom.xml (revision 1771231bbe5e305837bfdaa73ae5289c100c9417)
+++ b/plugins/nexus-coreui-plugin/pom.xml (date 1741280281105)
@@ -153,42 +153,49 @@
<artifactId>frontend-maven-plugin</artifactId>
<executions>
+<!-- <execution>-->
+<!-- <id>install node and yarn</id>-->
+<!-- <goals>-->
+<!-- <goal>install-node-and-yarn</goal>-->
+<!-- </goals>-->
+<!-- <phase>generate-resources</phase>-->
+<!-- </execution>-->
<execution>
- <id>install node and yarn</id>
+ <id>install node and npm</id>
<goals>
- <goal>install-node-and-yarn</goal>
+ <goal>install-node-and-npm</goal>
</goals>
<phase>generate-resources</phase>
</execution>
<execution>
<id>yarn install</id>
<goals>
- <goal>yarn</goal>
+ <goal>corepack</goal>
</goals>
<phase>generate-resources</phase>
<configuration>
- <arguments>${npm.install}</arguments>
+ <arguments>yarn ${npm.install}</arguments>
</configuration>
</execution>
<execution>
<id>yarn build</id>
<goals>
- <goal>yarn</goal>
+ <goal>corepack</goal>
</goals>
<phase>compile</phase>
<configuration>
- <arguments>${npm.build}</arguments>
+ <arguments>yarn ${npm.build}</arguments>
</configuration>
</execution>
<execution>
<id>js-unit-test</id>
<goals>
- <goal>yarn</goal>
+ <goal>corepack</goal>
</goals>
<phase>test</phase>
<configuration>
- <arguments>test --reporters=jest-junit --reporters=default</arguments>
+ <arguments>yarn test --reporters=jest-junit --reporters=default</arguments>
<skip>${npm.skipTests}</skip>
</configuration>
</execution>
great
The solution from @ilx worked for me when building release-3.78.1-02 but not for 3.77.2-02 :( I still get the same failure @lesserwhirls reported on nexus-content-suite:
[ERROR] Failed to execute goal on project nexus-content-suite: Could not resolve dependencies for project org.sonatype.nexus.testsuite:nexus-content-suite:jar:3.77.2-02: The following artifacts could not be resolved: org.sonatype.nexus.testsuite:nexus-repository-content-testsupport:jar:3.77.2-02 (absent): org.sonatype.nexus.testsuite:nexus-repository-content-testsupport:jar:3.77.2-02 was not found in https://repo.maven.apache.org/maven2 during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of central has elapsed or updates are forced -> [Help 1]
Any suggestions? I'm very new to this. I followed the exact steps from above and have node 16.x and yarn 3.2.3. Just need to build 3.77.x for the moment.
Thanks for the patch, @ilx!
With a modification to your patch, I managed to create a Dockerfile that builds a working installation of the EPL-licensed nexus-public version 3.79.1-04. Sharing the files and Docker build instructions here for others:
nexus-fix.patch:
diff --git a/.gitignore b/.gitignore
index 9c4e3db..4fa50ba 100644
--- a/.gitignore
+++ b/.gitignore
@@ -24,4 +24,8 @@ out
# Zion
.zion/
-variables.properties
\ No newline at end of file
+variables.properties
+
+#
+.yarn
+node_modules
\ No newline at end of file
diff --git a/plugins/nexus-coreui-plugin/pom.xml b/plugins/nexus-coreui-plugin/pom.xml
index 8242dd7..f49ff2c 100644
--- a/plugins/nexus-coreui-plugin/pom.xml
+++ b/plugins/nexus-coreui-plugin/pom.xml
@@ -156,11 +156,11 @@
<execution>
<id>js-unit-test</id>
<goals>
- <goal>yarn</goal>
+ <goal>corepack</goal>
</goals>
<phase>test</phase>
<configuration>
- <arguments>test --reporters=jest-junit --reporters=default</arguments>
+ <arguments>yarn test --reporters=jest-junit --reporters=default</arguments>
<skip>${npm.skipTests}</skip>
</configuration>
</execution>
diff --git a/pom.xml b/pom.xml
index 6c657fd..901a4a0 100644
--- a/pom.xml
+++ b/pom.xml
@@ -69,7 +69,7 @@
<!-- Define the node and yarn versions used by the frontend-maven-plugin -->
<node.version>v18.17.1</node.version>
- <yarn.version>v1.22.19</yarn.version>
+ <yarn.version>v4.7.0</yarn.version>
<npm.install>install --immutable</npm.install>
<npm.skipTests>false</npm.skipTests>
<npm.build>build-all</npm.build>
@@ -746,7 +746,7 @@
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
- <version>1.11.3</version>
+ <version>1.15.1</version>
<configuration>
<nodeVersion>${node.version}</nodeVersion>
@@ -760,41 +760,48 @@
</configuration>
<executions>
+<!-- <execution>-->
+<!-- <id>install node and yarn</id>-->
+<!-- <goals>-->
+<!-- <goal>install-node-and-yarn</goal>-->
+<!-- </goals>-->
+<!-- <phase>generate-resources</phase>-->
+<!-- </execution>-->
<execution>
- <id>install node and yarn</id>
+ <id>install node</id>
<goals>
- <goal>install-node-and-yarn</goal>
+ <goal>install-node-and-npm</goal>
</goals>
<phase>generate-resources</phase>
</execution>
<execution>
<id>yarn cache clean</id>
<goals>
- <goal>yarn</goal>
+ <goal>corepack</goal>
</goals>
<phase>generate-resources</phase>
<configuration>
- <arguments>cache clean</arguments>
+ <arguments>yarn cache clean</arguments>
</configuration>
</execution>
<execution>
<id>yarn install</id>
<goals>
- <goal>yarn</goal>
+ <goal>corepack</goal>
</goals>
<phase>generate-resources</phase>
<configuration>
- <arguments>${npm.install}</arguments>
+ <arguments>yarn ${npm.install}</arguments>
</configuration>
</execution>
<execution>
<id>yarn run build</id>
<goals>
- <goal>yarn</goal>
+ <goal>corepack</goal>
</goals>
<phase>compile</phase>
<configuration>
- <arguments>${npm.build}</arguments>
+ <arguments>yarn ${npm.build}</arguments>
</configuration>
</execution>
</executions>
@@ -1892,7 +1899,7 @@
<artifactId>frontend-maven-plugin</artifactId>
<versionRange>[0.7,)</versionRange>
<goals>
- <goal>install-node-and-yarn</goal>
+ <goal>install-node-and-npm</goal>
<goal>yarn</goal>
</goals>
</pluginExecutionFilter>
Dockerfile:
ARG NEXUS_PUBLIC_VERSION=3.79.1-04
FROM eclipse-temurin:17.0.14_7-jdk-noble AS builder
ARG NEXUS_PUBLIC_VERSION
ARG NEXUS_PUBLIC_DOWNLOAD_LINK=https://github.com/sonatype/nexus-public/archive/refs/tags/release-${NEXUS_PUBLIC_VERSION}.tar.gz
ARG NEXUS_PUBLIC_SHA256=b36f10edc20b2c68c63e1c24c0bd1f9f28cc66baf8be24d2cfa1934111ec66ea
ARG NEXUS_PUBLIC_TARGET_PATH=/Downloads/nexus-public-release-${NEXUS_PUBLIC_VERSION}.tar.gz
ARG NODE_VERSION=18
ENV NVM_DIR=/root/.nvm
ARG EXPECTED_YARN_VERSION=3.2.3
ADD --checksum=sha256:$NEXUS_PUBLIC_SHA256 $NEXUS_PUBLIC_DOWNLOAD_LINK $NEXUS_PUBLIC_TARGET_PATH
WORKDIR /src/nexus-public
# Using workarounds documented at https://github.com/sonatype/nexus-public/issues/417#issuecomment-2704934715
COPY nexus-fix.patch /tmp/
# setuptools is needed to get the Python module `distutils`, which is needed for the build to succeed.
# build-essential is apparently also needed, since gyp will otherwise complain about not finding `make`.
RUN apt -y update \
&& tar xf "$NEXUS_PUBLIC_TARGET_PATH" --strip-components=1 \
&& apt -y install build-essential curl git python3 python3-setuptools \
&& apt clean \
&& git apply /tmp/nexus-fix.patch \
&& curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash \
&& bash -c "source $NVM_DIR/nvm.sh && nvm install $NODE_VERSION" \
&& . "$NVM_DIR/nvm.sh" \
&& corepack enable \
&& yarn config set nodeLinker node-modules \
&& yarn --version | grep -q "$EXPECTED_YARN_VERSION" \
&& git init \
&& ./mvnw -DskipTests -Dpublic package
FROM eclipse-temurin:17.0.14_7-jdk-noble
ARG NEXUS_PUBLIC_VERSION
COPY --from=builder /src/nexus-public/assemblies/nexus-repository-core/target/assembly /opt/nexus-public
WORKDIR /opt/nexus-public
RUN cat NOTICE.txt \
&& echo "#!/bin/sh" > ./launch-nexus.sh \
&& echo "java -jar bin/nexus-repository-core-$NEXUS_PUBLIC_VERSION.jar" >> ./launch-nexus.sh \
&& chmod +x ./launch-nexus.sh
# Upon initial launch of container, the temp initial admin password will be in /opt/sonatype-work/nexus3/admin.password
EXPOSE 8081
ENTRYPOINT [ "./launch-nexus.sh" ]
To build, make sure you have Docker running, have both the above files (nexus-fix.patch and Dockerfile) in the same folder and have that folder as your current directory, and then run the following command:
docker build . --progress=plain -t nexus-public:0.1
To launch it:
docker run -d -p 8081:8081 nexus-public:0.1
Allow it a few minutes to start up, and then use the following command to get the initial admin password:
docker exec -it [CONTAINER_ID] cat /opt/sonatype-work/nexus3/admin.password
In the command above, you need to replace the placeholder [CONTAINER_ID] with the ID of the running container. You can find it by running docker ps.
At this point, you should be able to access Nexus with your browser at http://localhost:8081.
You'll see a No action registered as 'outreach_Outreach' error on the landing page, which is a known issue (#618 ). But other than that, everything appears to work work well, at least from a first glance. With the temporary password you retrieved with the last command above, you should be able to log in as admin, and you will then be prompted to change your password.
I hope others find this useful!
My 5 cents to the issue - the patch to build latest (3.80) version, which seem to have new interface and there's no 'outreach_Outreach' error
nexus-fix.patch:
diff --git a/.gitignore b/.gitignore
index 9c4e3db3e4..4fa50baf07 100644
--- a/.gitignore
+++ b/.gitignore
@@ -24,4 +24,8 @@ out
# Zion
.zion/
-variables.properties
\ No newline at end of file
+variables.properties
+
+#
+.yarn
+node_modules
\ No newline at end of file
diff --git a/plugins/nexus-coreui-plugin/pom.xml b/plugins/nexus-coreui-plugin/pom.xml
index 8eba2ba617..6cb2ae46a3 100644
--- a/plugins/nexus-coreui-plugin/pom.xml
+++ b/plugins/nexus-coreui-plugin/pom.xml
@@ -146,11 +146,11 @@
<execution>
<id>js-unit-test</id>
<goals>
- <goal>yarn</goal>
+ <goal>corepack</goal>
</goals>
<phase>test</phase>
<configuration>
- <arguments>test --reporters=jest-junit --reporters=default</arguments>
+ <arguments>yarn test --reporters=jest-junit --reporters=default</arguments>
<skip>${npm.skipTests}</skip>
</configuration>
</execution>
diff --git a/pom.xml b/pom.xml
index aaa8182482..f970a8927b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -69,7 +69,7 @@
<!-- Define the node and yarn versions used by the frontend-maven-plugin -->
<node.version>v18.17.1</node.version>
- <yarn.version>v1.22.19</yarn.version>
+ <yarn.version>v4.7.0</yarn.version>
<npm.install>install --immutable</npm.install>
<npm.skipTests>false</npm.skipTests>
<npm.build>build-all</npm.build>
@@ -702,45 +702,51 @@
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
- <version>1.11.3</version>
+ <version>1.15.1</version>
<configuration>
<nodeVersion>${node.version}</nodeVersion>
<yarnVersion>${yarn.version}</yarnVersion>
- <workingDirectory>${project.basedir}</workingDirectory>
- <installDirectory>${project.build.directory}</installDirectory>
- <environmentVariables>
- <JEST_SUITE_NAME>React-Tests</JEST_SUITE_NAME>
- <CI>true</CI>
- </environmentVariables>
+ <workingDirectory>.</workingDirectory>
+ <installDirectory>target</installDirectory>
</configuration>
<executions>
<execution>
- <id>install node and yarn</id>
+ <id>install node</id>
<goals>
- <goal>install-node-and-yarn</goal>
+ <goal>install-node-and-npm</goal>
</goals>
<phase>generate-resources</phase>
</execution>
+ <execution>
+ <id>yarn cache clean</id>
+ <goals>
+ <goal>corepack</goal>
+ </goals>
+ <phase>generate-resources</phase>
+ <configuration>
+ <arguments>yarn cache clean</arguments>
+ </configuration>
+ </execution>
<execution>
<id>yarn install</id>
<goals>
- <goal>yarn</goal>
+ <goal>corepack</goal>
</goals>
<phase>generate-resources</phase>
<configuration>
- <arguments>${npm.install}</arguments>
+ <arguments>yarn ${npm.install}</arguments>
</configuration>
</execution>
<execution>
<id>yarn run build</id>
<goals>
- <goal>yarn</goal>
+ <goal>corepack</goal>
</goals>
<phase>compile</phase>
<configuration>
- <arguments>${npm.build}</arguments>
+ <arguments>yarn ${npm.build}</arguments>
</configuration>
</execution>
</executions>
@@ -1868,7 +1874,7 @@
<artifactId>frontend-maven-plugin</artifactId>
<versionRange>[0.7,)</versionRange>
<goals>
- <goal>install-node-and-yarn</goal>
+ <goal>install-node-and-npm</goal>
<goal>yarn</goal>
</goals>
</pluginExecutionFilter>
Thanks for sharing, @SergeiHanus.
However, I had to add a newline at the end of your nexus-fix.patch file above. Otherwise the build would fail, complaining about a "corrupt patch at line 120".
Perhaps it helps if we share these files as attachments, instead of in-line copy/paste snippets.
I just noticed a UI error in nexus-oss, after having built it using the instructions shared in this thread.
Can any of you reproduce it? The steps to reproduce are the following:
- Log in as
admin - Go to
SettingsRepository->Repositories - Click on any repository, e.g.
maven-releases
When. I do this, I get an error popup with a message like this:
TypeError: undefined is not an object (evaluating 'NX.direct.firewall_RepositoryStatus.readCapabilitiesStatus') (http://localhost:8081/static/rapture/nexus-coreui-plugin-prod.js?_v=3.80.0-06&_e=CORE&_c=2025-05-28-1418-03942:1)
At that point, the Repositories view is broken until I refresh the page.
I'm getting this error with all the browsers I've tried so far: Firefox, Safari and Chromium.
So far I've tried (and encountered) this with releases 3.79.1-04 and 3.80.0-06 of Nexus OSS (nexus-public).
Note that this only happens in the repositories under Settings. The repository views under Browse work fine.
I'm also attaching a video recording of it.
https://github.com/user-attachments/assets/08a3744e-2036-40e1-8b31-8e1d8e5c2974
Dependency is not missing. Somebody started to use newer version of yarn (as seen in
package.json-packageManageris[email protected]and they use workspaces)So.. weird combination that works:
- install node via nvm
- navigate into nexus-public
- enable corepack:
corepack enable- check yarn is 3.23:
yarn --version- setup yarn config to use node_modules:
yarn config set nodeLinker node-modules- apply patch...
- run build:
./mvnw -DskipTests -Dpublic packagepatch:
......
thanks for your suggestion/contribution @ilx !
I applied this patch and at first it did not work, kept getting the following error:
[ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.15.1:corepack (yarn cache clean) on project nexus-ui-plugin: Failed to run task: 'corepack yarn cache clean' failed. org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1) -> [Help 1]
As a result, I checked the node and version used in the pom against the yarn version I was using on my machine, changed the pom to match the version that matched my machine, and voilà, the issue was resolved.
I am using the following version:
node --version
v20.19.2
yarn --version
3.2.3
thanks again 🙏
I'm attaching an updated version of the patch file that works with the Dockerfile I shared further above, and includes the additional fix by @ftclausen for the JavaScript UI errors I reported in #653.
Thanks, @ftclausen! 🙏🏽