Skip to content

Documentation on Options #9

Open

Description

@email2vimalraj

Need more documentation on options. The issue is we have our own maven repository and we are not supposed to use the http://central.maven.org/maven2/.

Our repository and authentication of repository details are present in settings.xml under .m2 directory. The mvn command automatically pulls the artifacts from our repository as per defined in settings.xml.

Whereas, when I run through the node-java-maven, it always trying to fetch from http://central.maven.org/maven2/.

Activity

  1. joeferner commented on Dec 2, 2015

    @joeferner
    Owner

    Are you doing something like this in your settings.xml or is it more complex?

    <settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
                          http://maven.apache.org/xsd/settings-1.0.0.xsd">
      ...
      <mirrors>
        <mirror>
          <id>planetmirror.com</id>
          <name>PlanetMirror Australia</name>
          <url>http://downloads.planetmirror.com/pub/maven2</url>
          <mirrorOf>central</mirrorOf>
        </mirror>
      </mirrors>
      ...
    </settings>
  2. email2vimalraj commented on Jan 6, 2016

    @email2vimalraj
    Author

    Sorry for delay in response. My settings.xml look like this:

    <?xml version="1.0" encoding="UTF-8"?>
    <settings xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd" xmlns="http://maven.apache.org/SETTINGS/1.1.0"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <servers>
        <server>
          <username>myusername</username>
          <password>encrypted password</password>
          <id>central</id>
        </server>
        <server>
          <username>myusername</username>
          <password>encrypted password</password>
          <id>snapshots</id>
        </server>
      </servers>
      <profiles>
        <profile>
          <repositories>
            <repository>
              <snapshots>
                <enabled>false</enabled>
              </snapshots>
              <id>central</id>
              <name>repo</name>
              <url>http://mymvnartifactory.com/repo</url>
            </repository>
            <repository>
              <snapshots />
              <id>snapshots</id>
              <name>repo</name>
              <url>http://mymvnartifactory.com/repo</url>
            </repository>
          </repositories>
          <pluginRepositories>
            <pluginRepository>
              <snapshots>
                <enabled>false</enabled>
              </snapshots>
              <id>central</id>
              <name>repo</name>
              <url>http://mymvnartifactory.com/repo</url>
            </pluginRepository>
            <pluginRepository>
              <snapshots />
              <id>snapshots</id>
              <name>repo</name>
              <url>http://mymvnartifactory.com/repo</url>
            </pluginRepository>
          </pluginRepositories>
          <id>artifactory</id>
        </profile>
      </profiles>
      <activeProfiles>
        <activeProfile>artifactory</activeProfile>
      </activeProfiles>
    </settings>
  3. email2vimalraj commented on Mar 7, 2016

    @email2vimalraj
    Author

    Any updates on this?

  4. joeferner commented on Mar 7, 2016

    @joeferner
    Owner

    Sorry, I haven't had a chance to look into this issue.

  5. pratikdmehta commented on May 16, 2016

    @pratikdmehta

    @email2vimalraj Just use:

    var opts = { 
    repositories: [
       {
          id: "<id></id>",
          url: "<url>Modified ! See below</url>"
       }
    ]};
    mvn(opts, function(err, mvnResults) { 
      //Callback after fetching from the protected repo.
    });
    

    For HTTP Authentication modify the url as ^^ https://user:pass@mymvnartifactory.com/repo

    But this issue can't be closed yet, as we still need complete documentation. :)

    Being dumb, burnt time looking at alternate solutions for resolving dependencies thinking that I would need to do a hack. Some good time with the code and documentation of the modules it uses, was easy to figure out. I would be happy to do some documentation as I find time...

  6. hyperlink commented on Aug 12, 2016

    @hyperlink

    @pratikdmehta don't forget to add a trailing slash to the url. It doesn't call join to combine the paths.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions