Version 1.15.1
If the same workspace is mounted from different locations (e.g. two different docker images that share a host-based code repositoy but mount it at different paths) then:
|
private void linkExecutable() throws InstallationException{ |
pnpmExecutable.exists() returns false, because although the symbolic link already exists it points at a non-existent location (the location resolves in the other Docker container, not the current one)
!pnpmJsExecutable.exists() returns false, because the file we are trying to link to does exist.
Files.createSymbolicLink(pnpmExecutable.toPath(), pnpmJsExecutable.toPath()); gets invoked but throws java.nio.file.FileAlreadyExistsException because the symbolic link already exists.
This is a combination of user error (the repository should be bound to a consitent path across containers) and a bug (the code assumes that the symbolic link does not exist when it does).
Suggested fix: If the symbolic link exists but is pointing at a non-existant path, delete and then replace it. Yes, the symbolic link will keep on getting recreated as users shift from one docker container to another but this is mostly harmless (fast) and the build will pass.
Version 1.15.1
If the same workspace is mounted from different locations (e.g. two different docker images that share a host-based code repositoy but mount it at different paths) then:
frontend-maven-plugin/frontend-plugin-core/src/main/java/com/github/eirslett/maven/plugins/frontend/lib/PnpmInstaller.java
Line 184 in b7b060f
pnpmExecutable.exists()returns false, because although the symbolic link already exists it points at a non-existent location (the location resolves in the other Docker container, not the current one)!pnpmJsExecutable.exists()returns false, because the file we are trying to link to does exist.Files.createSymbolicLink(pnpmExecutable.toPath(), pnpmJsExecutable.toPath());gets invoked but throwsjava.nio.file.FileAlreadyExistsExceptionbecause the symbolic link already exists.This is a combination of user error (the repository should be bound to a consitent path across containers) and a bug (the code assumes that the symbolic link does not exist when it does).
Suggested fix: If the symbolic link exists but is pointing at a non-existant path, delete and then replace it. Yes, the symbolic link will keep on getting recreated as users shift from one docker container to another but this is mostly harmless (fast) and the build will pass.