Uploaded image for project: 'Maven'
  1. Maven
  2. MNG-3099

Profiles ignored when working with non-projects (such as archetype:create)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • None
    • 2.0.9
    • None
    • None

    Description

      Several conditions have to be met to show this bug.

      1) Be in an environment that does not have access to repo1.maven.org, (such as a corporate environment)
      2) Have no content in your local repository (a fresh install of maven 2.0.4)
      3) Attempt to use a plugin that has no project requirement (such as archetype:create)

      The plugin fails because access to repo1.maven.org cannot be accessed.

      Recommended solution:
      Create a settings.xml profile that changes the location of the 'central' repository to point to an internal resource (such as a maven-proxy installation).

      <settings>
      <profiles>
      <profile>
      <id>use_internal</id>
      <repositories>
      <repository>
      <id>central</id>
      <name>Internal Central Repository</name>
      <url>http://repo.internal.com/maven2</url>
      <releases>
      <enabled>true</enabled>
      </releases>
      <snapshots>
      <enabled>true</enabled>
      </snapshots>
      </repository>
      </repositories>
      <pluginRepositories>
      <pluginRepository>
      <id>central</id>
      <name>Internal Central Repository</name>
      <url>http://repo.internal.com/maven2</url>
      <releases>
      <enabled>true</enabled>
      </releases>
      <snapshots>
      <enabled>true</enabled>
      </snapshots>
      </pluginRepository>
      </pluginRepositories>
      </profile>
      </profiles>

      <activeProfiles>
      <activeProfile>use_internal</activeProfile>
      </activeProfiles>
      </settings>

      Try again.
      Still fails.

      The reason is that the default behaviour for non-project execution is to use the maven super pom, however there is a bug with that flow that does not allow for the merging of the settings.xml profiles.

      Attachments

        1. MNG-2261.patch
          5 kB
          Joakim Erdfelt
        2. MNG-2261-2.patch
          8 kB
          Carlos Sanchez Gonzalez
        3. Plugin-showing-MNG3099.zip
          16 kB

        Issue Links

          Activity

            People

              jdcasey John Dennis Casey
              joakime Joakim Erdfelt
              Votes:
              27 Vote for this issue
              Watchers:
              20 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: