Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Package installing to a wrong workingDirectory. #1166

Open
cladwen opened this issue Oct 31, 2024 · 1 comment
Open

Package installing to a wrong workingDirectory. #1166

cladwen opened this issue Oct 31, 2024 · 1 comment

Comments

@cladwen
Copy link

cladwen commented Oct 31, 2024

I have encountered the following issue installing packages with the frontend-maven-plugin. WorkingDirectory configuration is lost in the installation phase of the package when maven is run from a Jenkins job.

The plugin configuration is as follows:

        <plugin>
            <groupId>com.github.eirslett</groupId>
            <artifactId>frontend-maven-plugin</artifactId>
            <version>1.15.1</version>

            <configuration>
                <installDirectory>${node.install.directory}</installDirectory>
                <workingDirectory>${webapp.source.directory}</workingDirectory>
            </configuration>

            <executions>
                <execution>
                    <id>install node and npm</id>
                    <goals>
                        <goal>install-node-and-npm</goal>
                    </goals>
                    <configuration>
                        <nodeVersion>v4.2.2</nodeVersion>
                        <npmVersion>2.14.7</npmVersion>
                    </configuration>
                </execution>

                <execution>
                    <id>npm install</id>
                    <goals>
                        <goal>npm</goal>
                    </goals>
                    <configuration>
                        <arguments>install -d aifmd-client@${aifmd-client.version}</arguments>
                    </configuration>
                </execution>
            </executions>
        </plugin>

In the log we can see how the workingDirectory is read correctly but finally the installation is performed in another directory:

[INFO] --- frontend-maven-plugin:1.15.1:npm (npm install) @ aifmd-webapp ---
[INFO] Running 'npm install -d [email protected]' in /var/jenkins_home/workspace/AIFMD-SNAPSHOT/aifmd-webapp/src/main/webapp
[INFO] npm info it worked if it ends with ok
[INFO] npm info using [email protected]
[INFO] npm info using [email protected]
[INFO] npm verb config Skipping project config: /var/jenkins_home/.npmrc. (matches userconfig)
[INFO] npm WARN package.json @ No description
[INFO] npm WARN package.json @ No repository field.
[INFO] npm WARN package.json @ No README data
[INFO] npm WARN package.json @ No license field.
[INFO] npm info package.json [email protected] No repository field.
[INFO] npm info package.json [email protected] No license field.
[INFO] npm info package.json [email protected] No README data
...
[INFO] npm info package.json [email protected] No license field.
[INFO] npm info package.json [email protected] string_decoder is also the name of a node core module.
[INFO] npm info package.json [email protected] No license field.
[INFO] npm info package.json [email protected] url is also the name of a node core module.
[INFO] npm info package.json [email protected] util is also the name of a node core module.
[INFO] npm info package.json [email protected] No license field.
[INFO] npm info package.json [email protected] No repository field.
[INFO] npm info package.json [email protected] No license field.
[INFO] npm info package.json [email protected] No license field.
[INFO] npm info package.json [email protected] No license field.
[INFO] npm info package.json [email protected] No repository field.
[INFO] npm info package.json [email protected] No README data
[INFO] npm info package.json [email protected] No license field.
[INFO] npm info attempt registry request try #1 at 4:14:32 PM
[INFO] npm http request GET http://xxxxx.into/repository/aifmd-js/aifmd-client
[INFO] npm http 200 http://xxxxx.into/repository/aifmd-js/aifmd-client
[INFO] npm info retry fetch attempt 1 at 4:14:32 PM
[INFO] npm info attempt registry request try #1 at 4:14:32 PM
[INFO] npm http fetch GET http://xxxxx.into/repository/aifmd-js/aifmd-client/-/aifmd-client-1.10.0-SNAPSHOT.tgz
[INFO] npm http fetch 200 http://xxxxx.into/repository/aifmd-js/aifmd-client/-/aifmd-client-1.10.0-SNAPSHOT.tgz
[INFO] npm info install [email protected] into /var/jenkins_home
[INFO] npm info installOne [email protected]
[INFO] npm info preuninstall [email protected]
[INFO] npm info uninstall [email protected]
[INFO] npm info postuninstall [email protected]
[INFO] npm info preinstall [email protected]
[INFO] npm info build /var/jenkins_home/node_modules/aifmd-client
[INFO] npm info linkStuff [email protected]
[INFO] npm info install [email protected]
[INFO] npm info postinstall [email protected]

[INFO] [email protected] ../../../../../../node_modules/aifmd-client
[INFO] npm info ok 

In the second line the correct working directory is shown but the package ends up being installed in another directory:

[INFO] npm info install [email protected] into /var/jenkins_home

Is any special configuration required to run the plugin from a Jenkins job?

Thank you so much

@arisjramos
Copy link

When using de npm goal try to make a npm install it does not take into account the workingDirectory property. the yarn goal works well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants