eirslett / frontend-maven-plugin

"Maven-node-grunt-gulp-npm-node-plugin to end all maven-node-grunt-gulp-npm-plugins." A Maven plugin that downloads/installs Node and NPM locally, runs NPM install, Grunt, Gulp and/or Karma.
Apache License 2.0
4.24k stars 870 forks source link

serverId with username and password as variables gives 401 authentication error #1064

Closed visa2learn closed 1 year ago

visa2learn commented 1 year ago

I am using version frontend-maven-plugin 1.10.0

I have the below server tag in my settings.xml

<server>
  <username>${MY_USER}</username>
  <password>${MY_PASSWORD}</password>
  <id>server001</id>
</server>

For the plugin, I am using below configuration to use the serverId from settings.xml

<plugin>
  <executions>
   <execution>
    <id>install node and yarn</id>
    <goals>
       <goal>install-node-and-yarn</goal>
    </goals>
    <configuration>      
        <nodeDownloadRoot>http://myproxy.example.org/nodejs/</nodeDownloadRoot>
        <serverId>server001</serverId>
        <npmDownloadRoot>https://myproxy.example.org/npm/</npmDownloadRoot>
    </configuration>
</plugin>

When the plugin executes, it uses the username as a string literal ${MY_USER} instead of the actual value for the variable MY_USER and the authentication fails with the private artifactory.

LOGS: com.github.eirslett.maven.plugins.frontend.lib.FileDownloader - Using credentials (${MY_USER}) from settings.xml Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.10.0:install-node-and-yarn (install node and yarn) on project my-project: Could not download Node.js from: https://myproxy.example.org/npm/: Got error code 401 from the server.

Is this a bug or am I missing any configuration?

visa2learn commented 1 year ago

It was a mistake from my end. The variable was not set. After setting it, the plugin works correctly. Closing the issue.