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

mvn clean fails in a multi-module project. #90

Closed
sankala-dremio opened this issue Jul 3, 2021 · 5 comments · Fixed by #91
Closed

mvn clean fails in a multi-module project. #90

sankala-dremio opened this issue Jul 3, 2021 · 5 comments · Fixed by #91
Assignees
Labels

Comments

@sankala-dremio
Copy link
Contributor

Hi, When using mvn-golang-wrapper, mvn clean fails when there are dependencies on other modules in a multi-module project. This is happening even in the examples in this repo.

The actual issue is due to the fact that dependent artifacts are not available.

The root cause seems to be due to the issue that com.igormaznitsa.mvngolang.GolangCleanMojo declares requiresDependencyResolution = ResolutionScope.COMPILE.

@raydac
Copy link
Owner

raydac commented Jul 3, 2021

which GoSDK allows reproduce such situation? I am trying to reproduce locally and can't, which GoSDK and OS?

@sankala-dremio
Copy link
Contributor Author

Actually, its not really golang issue, but more of maven and dependency management problem.

Attached an example repro.

running mvn clean in the parent project throws the error.

[ERROR] Failed to execute goal on project mvn-go-test-mix-app: Could not resolve dependencies for project com.igormaznitsa:mvn-go-test-mix-app:mvn-golang:1.0.0-SNAPSHOT: The following artifacts could not be resolved: com.igormaznitsa:mvn-go-test-mix-terminal:zip:1.0.0-SNAPSHOT, com.igormaznitsa:mvn-go-test-mix-proxy:zip:1.0.0-SNAPSHOT: Could not find artifact com.igormaznitsa:mvn-go-test-mix-terminal:zip:1.0.0-SNAPSHOT -> [Help 1]

repro.tar.gz

@raydac raydac self-assigned this Jul 3, 2021
@raydac raydac added the bug label Jul 3, 2021
@raydac
Copy link
Owner

raydac commented Jul 3, 2021

great! you are right! if start cleaning when artifacts not presented in local repository then it fails. but the problem is deeper than maven and projects are red even with your change, it needs changes in processing of dependencies on level of plugin, I will investigate today

@raydac
Copy link
Owner

raydac commented Jul 3, 2021

you can try snapshot

@sankala-dremio
Copy link
Contributor Author

Thank you very much! Really appreciate!.

By the way, the other error is simple to overcome via configuration. Hence didn't suggest a fix for that.

<build>
   <pluginManagement>
     <plugins>
       <plugin>
         <groupId>com.igormaznitsa</groupId>
         <artifactId>mvn-golang-wrapper</artifactId>
         <version>${main-project-version}</version>
         <extensions>true</extensions>
         <executions>
           <execution>
             <id>default-clean</id>
             <phase>clean</phase>
             <goals>
               <goal>clean</goal>
             </goals>
             <configuration>
               <scanDependencies>false</scanDependencies>
             </configuration>
           </execution>
         </executions>
       </plugin>
     </plugins>
   </pluginManagement>
 </build>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants