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

Add npm-login goal to authenticate in private npm repository #1021

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

koden8
Copy link

@koden8 koden8 commented Jan 26, 2022

Hello. In our organization, we use Nexus as a private npm registry and maven repository. To simplify the initial project setup and to store the authentication settings in one place (~/.m2/settings.xml), we developed the "npm-login" goal, which is identical to the npm login command - getting an authentication token and writing it to ~/.npmrc

Running Npm Login

<execution>
    <id>npm login</id>
    <goals>
        <goal>npm-login</goal>
    </goals>

    <!-- optional: the default phase is "generate-resources" -->
    <phase>generate-resources</phase>

    <configuration>
       <npmRegistryURL>https://npm-registry.com</npmRegistryURL>
       <npmRegistryServerId>npm-registry</npmRegistryServerId>
    </configuration>
</execution>

and server section in ~/.m2/settings.xml

<?xml version="1.0"?>
<settings>
  ... 
  <servers>
    <server>
      <id>npm-registry</id>
        <username>username</username>
        <password>password</password>
    </server>
  </servers>
  ...

@nlahiry
Copy link

nlahiry commented Feb 22, 2024

i need this same thing , but what i want , is to use authtoken or username/password stored in my azure build servers when i run the pipeline

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

Successfully merging this pull request may close these issues.

None yet

2 participants