Maven Dependency Plugin
  1. Maven Dependency Plugin
  2. MDEP-82

go-offline / resolve-plugins does not resolve all plugin dependencies

    Details

    • Type: Bug Bug
    • Status: Open Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 2.0-alpha-4
    • Fix Version/s: None
    • Component/s: go-offline, resolve-plugins
    • Labels:
      None
    • Environment:
      Maven 2.0.6
    • Testcase included:
      yes
    • Number of attachments :
      2

      Description

      The attached pom.xml is a very simple JAR project, without any direct dependencies or plugin dependencies.

      Start with an empty local repository, and run mvn dependency:go-offline on it. Some files get downloaded, but not everything that is needed for the build. If you run "mvn -o package" afterwards, you end up with the following error:

      [ERROR] BUILD ERROR
      [INFO] ------------------------------------------------------------------------
      [INFO] The plugin 'org.apache.maven.plugins:maven-resources-plugin' does not exist or no valid version could be found

      Afterwards, even "mvn package" without the "-o" parameter does not work any longer.

      1. maven-dependency-plugin-2.3.patch
        5 kB
        Paul Warren
      2. pom.xml
        0.4 kB
        Arne Degenring

        Activity

        Hide
        Brian Fox added a comment -

        The problem is that the project isn't injected with the plugins from the standard lifecycle. I may have to hard code the standard ones (site,clean,default) until I can figure out how to get at the list directly.

        Show
        Brian Fox added a comment - The problem is that the project isn't injected with the plugins from the standard lifecycle. I may have to hard code the standard ones (site,clean,default) until I can figure out how to get at the list directly.
        Hide
        Harold Shinsato added a comment -

        Being able to go offline so all needed dependencies (including plugin dependencies) will work is something we have a requirement to do for our builds or it will be hard for us to get to use maven. Is there a workaround for this issue that would not require writing custom code?

        Show
        Harold Shinsato added a comment - Being able to go offline so all needed dependencies (including plugin dependencies) will work is something we have a requirement to do for our builds or it will be hard for us to get to use maven. Is there a workaround for this issue that would not require writing custom code?
        Hide
        Derek Lewis added a comment -

        This issue has been open with no comment for a long time. Is there really no fix or workaround with the problem? I'm required to package a zip of the ~/.m2/repository directory with our software, including all dependencies needed to build from behind a strict corporate firewall. This bug is causing a great deal of grief for me. Is this fixed in maven 3?

        Show
        Derek Lewis added a comment - This issue has been open with no comment for a long time. Is there really no fix or workaround with the problem? I'm required to package a zip of the ~/.m2/repository directory with our software, including all dependencies needed to build from behind a strict corporate firewall. This bug is causing a great deal of grief for me. Is this fixed in maven 3?
        Hide
        Devin Reid added a comment -

        A workaround I have found for this issue is to run a build with the property 'maven.repo.local' set to a directory in the project base directory and run a build to the install phase. One can then archive the resulting project and move it to environments that have no network access and be able to build successfully with the '-o' option.

        I've tested this successfully with Maven 2.2.1 and Maven 3.0.3.

        First run:
        mvn -Dmaven.repo.local=lib clean install

        Now the following command will work just fine.
        mvn -Dmaven.repo.local=lib -o clean install

        Show
        Devin Reid added a comment - A workaround I have found for this issue is to run a build with the property 'maven.repo.local' set to a directory in the project base directory and run a build to the install phase. One can then archive the resulting project and move it to environments that have no network access and be able to build successfully with the '-o' option. I've tested this successfully with Maven 2.2.1 and Maven 3.0.3. First run: mvn -Dmaven.repo.local=lib clean install Now the following command will work just fine. mvn -Dmaven.repo.local=lib -o clean install
        Hide
        Derek Lewis added a comment -

        Devin, I've used a similar situation to work around the problem. However, it means having to build everything, which is time consuming, and also means that commands you haven't run (like mvn deploy) won't work, because the deploy plugin wasn't downloaded.

        Show
        Derek Lewis added a comment - Devin, I've used a similar situation to work around the problem. However, it means having to build everything, which is time consuming, and also means that commands you haven't run (like mvn deploy) won't work, because the deploy plugin wasn't downloaded.
        Hide
        Paul Warren added a comment -

        Hi Folks,

        Ability (or inability) to go-offline is a showstopper for us. We have very large customers who state they have to have offline development.

        So naturally this was the goal I looked at first. One problem I have with it is the fact that it resolves top level dependencies only. It doesnt recursively descend through all subsequent transtive dependencies. I am new to maven but as that stands I don't see how it is adequate to actually solve the problem. But maybe I missed some fundamental concept. Anyway, I had a fiddle with the code and made is descend and resolve all transaitive dependencies and this was sufficient for my use case. I was then able to go-offline. I am going to attach the patch in case it helps others or you would like to fold it into the source.

        Show
        Paul Warren added a comment - Hi Folks, Ability (or inability) to go-offline is a showstopper for us. We have very large customers who state they have to have offline development. So naturally this was the goal I looked at first. One problem I have with it is the fact that it resolves top level dependencies only. It doesnt recursively descend through all subsequent transtive dependencies. I am new to maven but as that stands I don't see how it is adequate to actually solve the problem. But maybe I missed some fundamental concept. Anyway, I had a fiddle with the code and made is descend and resolve all transaitive dependencies and this was sufficient for my use case. I was then able to go-offline. I am going to attach the patch in case it helps others or you would like to fold it into the source.
        Hide
        Paul Warren added a comment -

        The recursive descent patch as promised.

        Show
        Paul Warren added a comment - The recursive descent patch as promised.
        Hide
        Mark added a comment -

        This issue is even more annoying for proper two-phase deployments where packages are built on bare build systems without network access and where testing is done after the build on the target platform: it absolutely makes no sense to execute the tests just to prepare the package sources, but the tests won't have all dependencies later on when I don't execute the tests...

        Try:

        git clone https://github.com/cometd/cometd.git
        cd cometd
        git checkout 2.4.0
        mvn -Dmaven.repo.local=/tmp/maven-repo dependency:go-offline
        mvn -Dmaven.repo.local=/tmp/maven-repo -o install

        Show
        Mark added a comment - This issue is even more annoying for proper two-phase deployments where packages are built on bare build systems without network access and where testing is done after the build on the target platform: it absolutely makes no sense to execute the tests just to prepare the package sources, but the tests won't have all dependencies later on when I don't execute the tests... Try: git clone https://github.com/cometd/cometd.git cd cometd git checkout 2.4.0 mvn -Dmaven.repo.local=/tmp/maven-repo dependency:go-offline mvn -Dmaven.repo.local=/tmp/maven-repo -o install

          People

          • Assignee:
            Unassigned
            Reporter:
            Arne Degenring
          • Votes:
            11 Vote for this issue
            Watchers:
            14 Start watching this issue

            Dates

            • Created:
              Updated: