e-gineering / gitflow-helper-maven-plugin

An extension and plugin that teaches Maven to work well with gitflow projects and CI servers.
Apache License 2.0
76 stars 21 forks source link

Repository not found in v3.0.0 #119

Open ivarkol opened 4 years ago

ivarkol commented 4 years ago

I have error No Repository with id stage is defined. with plugin v3.0.0, but this error don't reproduce in plugin v2.2.0. my pom.xml:


...
     <repositories>
        <repository>
            <id>snapshots</id>
            <url>http://nexus/repository/snapshots/</url>
            <snapshots><enabled>true</enabled></snapshots>
            <releases><enabled>false</enabled></releases>
        </repository>
        <repository>
            <id>stage</id>
            <url>http://nexus/repository/stage/</url>
            <snapshots><enabled>false</enabled></snapshots>
            <releases><enabled>true</enabled></releases>
        </repository>
        <repository>
            <id>releases</id>
            <url>http://nexus/repository/releases/</url>
            <snapshots><enabled>false</enabled></snapshots>
            <releases><enabled>true</enabled></releases>
        </repository>
      </repositories>

      <build>
        <plugins>
            <plugin>
                <groupId>com.e-gineering</groupId>
                <artifactId>gitflow-helper-maven-plugin</artifactId>
                <version>3.0.0</version>
                <configuration>
                    <releaseDeploymentRepository>releases</releaseDeploymentRepository>
                    <stageDeploymentRepository>stage</stageDeploymentRepository>
                    <snapshotDeploymentRepository>snapshots</snapshotDeploymentRepository>
                </configuration>
                <extensions>true</extensions>
                <executions>
                    <execution>
                        <goals>
                            <goal>enforce-versions</goal>
                            <goal>retarget-deploy</goal>
                            <goal>tag-master</goal>
                            <goal>promote-master</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
...
rhierlmeier commented 1 year ago

I run into the same problem. In my environment I have a mirror defined in ~/.m2/settings.xml

    <mirrors>
        <mirror>
          <id>localMirror</id>
          <name>localMirror</name>
          <url>https://localMirror/repository/MavenPublic/</url>
          <mirrorOf>*</mirrorOf>
        </mirror>
    </mirrors>

In the resolved Maven project this only this mirror is in the remote repositories.

rhierlmeier commented 1 year ago

The problem should be with fixed with #132. We can close this issue.

Any plans for a release?

bvarner commented 1 year ago

I plan to work on that this week.

rhierlmeier commented 1 year ago

Great, thank you.

rhierlmeier commented 1 year ago

I introduced a bug with PR#132. The mirrored repositories have not authentication object. I am preparing a new PR.

rhierlmeier commented 1 year ago

Problem fixed with PR #138. It tested the fix in my environment (happens only with proxies). IMHO the issue can be closed.

rhierlmeier commented 1 year ago

Today I testet 3.1.0-SNAPSHOT in all branch types. In the master branch build I got this exception:

[ERROR] Failed to execute goal com.e-gineering:gitflow-helper-maven-plugin:3.1.0-SNAPSHOT:promote-master (default) on project 9999_998-TEST_GitFlowDocker: Cannot resolve artifacts from 'null' repository if the local repository is also disabled. -> [Help 1]
 org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.e-gineering:gitflow-helper-maven-plugin:3.1.0-DEPATCH3:promote-master (default) on project 9999_998-TEST_GitFlowDocker: Cannot resolve artifacts from 'null' repository if the local repository is also disabled.
     at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:375)
     at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:351)
     at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
     at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:171)
     at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:163)
     at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
     at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
     at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
     at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
     at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:294)
     at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
     at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
     at org.apache.maven.cli.MavenCli.execute (MavenCli.java:960)
     at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
     at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
     at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
     at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
     at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
     at java.lang.reflect.Method.invoke (Method.java:498)
     at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
     at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
     at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
     at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
 Caused by: org.apache.maven.plugin.MojoExecutionException: Cannot resolve artifacts from 'null' repository if the local repository is also disabled.
     at com.e_gineering.maven.gitflowhelper.AbstractGitflowBasedRepositoryMojo.attachExistingArtifacts (AbstractGitflowBasedRepositoryMojo.java:221)
     at com.e_gineering.maven.gitflowhelper.PromoteMasterMojo.execute (PromoteMasterMojo.java:55)
     at com.e_gineering.maven.gitflowhelper.AbstractGitflowBranchMojo.execute (AbstractGitflowBranchMojo.java:92)
     at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
     at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:370)
     at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:351)
     at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
     at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:171)
     at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:163)
     at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
     at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
     at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
     at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
     at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:294)
     at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
     at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
     at org.apache.maven.cli.MavenCli.execute (MavenCli.java:960)
     at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
     at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
     at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
     at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
     at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
     at java.lang.reflect.Method.invoke (Method.java:498)
     at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
     at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
     at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
     at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)

I am searching for a fix

rhierlmeier commented 1 year ago

PR #140 fixes this NPE.