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

Getting IllegalArgumentException on trying to use the extension #579

Closed
debraj-manna opened this issue Oct 22, 2022 Discussed in #578 · 6 comments · Fixed by #582
Closed

Getting IllegalArgumentException on trying to use the extension #579

debraj-manna opened this issue Oct 22, 2022 Discussed in #578 · 6 comments · Fixed by #582
Labels
Milestone

Comments

@debraj-manna
Copy link

Discussed in #578

Originally posted by debraj-manna October 21, 2022
I am new to gitflow-incremental-builder and this is my first post. Please let me know if this the correct place for raising queries.

I am trying to run the incremental build on a branch, test_incr_build created from the reference branch incr_build.

I have added the below extension in my root pom in incr_build

<build>
 <extensions>
      <extension>
        <groupId>io.github.gitflow-incremental-builder</groupId>
        <artifactId>gitflow-incremental-builder</artifactId>
        <version>4.1.1</version>
      </extension>
    </extensions>
</build>

and the below under properties in my root pom in incr_build

<properties>
   <gib.referenceBranch>refs/heads/incr_build</gib.referenceBranch>
</properties>

But on doing mvn install -DskipTests -T 8 on test_incr_build I am getting the below error

[INFO] gitflow-incremental-builder 4.1.1 starting...
[INFO] Reference commit of local base branch 'HEAD' has id: commit e12dcd5af9803bac29f2d1fb28ff0f911852cf66 1666363048 ------p
[INFO] Reference commit of local reference branch 'refs/heads/incr_build' has id: commit e12dcd5af9803bac29f2d1fb28ff0f911852cf66 1666363048 ------p
[INFO] Using merge base of id: commit e12dcd5af9803bac29f2d1fb28ff0f911852cf66 1666363048 --tr-sp
[ERROR] Failed to execute gitflow-incremental-builder. IllegalArgumentException -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MavenExecutionException

Maven version 3.8.4

debrajmanna@debrajmanna-DX6QR261G3 java % mvn -version
Apache Maven 3.8.4 (9b656c72d54e5bacbed989b64718c159fe39b537)
Maven home: /opt/apache-maven-3.8.4

I can see the below exception on enabling debug logging in maven

[ERROR] Failed to execute gitflow-incremental-builder. IllegalArgumentException -> [Help 1]
org.apache.maven.MavenExecutionException: Failed to execute gitflow-incremental-builder.
    at io.github.gitflowincrementalbuilder.MavenLifecycleParticipant.perform (MavenLifecycleParticipant.java:91)
    at io.github.gitflowincrementalbuilder.MavenLifecycleParticipant.afterProjectsRead (MavenLifecycleParticipant.java:61)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:264)
    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:972)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    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: java.lang.IllegalArgumentException
    at sun.nio.fs.UnixPath.subpath (UnixPath.java:363)
    at sun.nio.fs.UnixPath.subpath (UnixPath.java:43)
    at io.github.gitflowincrementalbuilder.ChangedProjects.stripSrcSubpath (ChangedProjects.java:85)
    at io.github.gitflowincrementalbuilder.ChangedProjects.findProject (ChangedProjects.java:51)
    at io.github.gitflowincrementalbuilder.ChangedProjects.lambda$get$0 (ChangedProjects.java:44)
    at java.util.stream.ReferencePipeline$7$1.accept (ReferencePipeline.java:271)
    at java.util.HashMap$KeySpliterator.forEachRemaining (HashMap.java:1603)
    at java.util.stream.AbstractPipeline.copyInto (AbstractPipeline.java:484)
    at java.util.stream.AbstractPipeline.wrapAndCopyInto (AbstractPipeline.java:474)
    at java.util.stream.ReduceOps$ReduceOp.evaluateSequential (ReduceOps.java:913)
    at java.util.stream.AbstractPipeline.evaluate (AbstractPipeline.java:234)
    at java.util.stream.ReferencePipeline.collect (ReferencePipeline.java:578)
    at io.github.gitflowincrementalbuilder.ChangedProjects.get (ChangedProjects.java:45)
    at io.github.gitflowincrementalbuilder.UnchangedProjectsRemover.doAct (UnchangedProjectsRemover.java:94)
    at io.github.gitflowincrementalbuilder.UnchangedProjectsRemover.act (UnchangedProjectsRemover.java:57)
    at io.github.gitflowincrementalbuilder.MavenLifecycleParticipant.perform (MavenLifecycleParticipant.java:84)
    at io.github.gitflowincrementalbuilder.MavenLifecycleParticipant.afterProjectsRead (MavenLifecycleParticipant.java:61)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:264)
    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:972)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    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)
[ERROR] 
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MavenExecutionException

Current directory structure

debrajmanna@debrajmanna-DX6QR261G3 java % git rev-parse --show-toplevel
/Users/debrajmanna/code/java/github/spotnana
debrajmanna@debrajmanna-DX6QR261G3 java % realpath pom.xml   
/Users/debrajmanna/code/java/github/spotnana/src/java/pom.xml

Can someone let me know what does this error mean and how can I get around this?

@famod
Copy link
Member

famod commented Oct 22, 2022

I was able to replicate this issue, working on a fix.

@famod famod added the bug label Oct 22, 2022
@famod famod added this to the v4.1.2 milestone Oct 22, 2022
@debraj-manna
Copy link
Author

debraj-manna commented Oct 23, 2022

Thanks for checking this.

Is some particular directory structure causing the issue?

Can you please provide me with some idea when I can expect some fix / workaround?

@famod
Copy link
Member

famod commented Oct 30, 2022

Sorry for the late reply. There is only #578 (reply in thread) (as you've confirmed).

I'm trying to have another look today. Last time I was under the impression that the entire approach to handling src needs a redesign. So, no easy fix.

@famod
Copy link
Member

famod commented Nov 1, 2022

@debraj-manna can you try snapshot version 4.1.2-20221101.001348-1?

@debraj-manna
Copy link
Author

debraj-manna commented Nov 1, 2022

Thanks @famod . I tried with your PR branch. I am not getting the error.

Below is the relevant build log

debrajmanna@debrajmanna-DX6QR261G3 java % git rev-parse --show-toplevel
/Users/debrajmanna/Downloads/spotnana
debrajmanna@debrajmanna-DX6QR261G3 java % realpath pom.xml
/Users/debrajmanna/Downloads/spotnana/src/java/pom.xml
debrajmanna@debrajmanna-DX6QR261G3 java % mvn clean install -DskipTests -T 8 -o -Pdev-local
[INFO] Scanning for projects...
...
[INFO] gitflow-incremental-builder 4.1.2-SNAPSHOT starting...
[INFO] Reference commit of local base branch 'HEAD' has id: commit d0511281b5edddee7f630f33592aef4f73299186 1667245695 ------p
[INFO] Reference commit of local reference branch 'refs/heads/incr_build' has id: commit d0511281b5edddee7f630f33592aef4f73299186 1667245695 ------p
[INFO] Using merge base of id: commit d0511281b5edddee7f630f33592aef4f73299186 1667245695 --tr-sp
[INFO] ------------------------------------------------------------------------
[INFO] Changed Artifacts:
[INFO]
[INFO] payment
[INFO]
[INFO] gitflow-incremental-builder exiting...
[INFO] ------------------------------------------------------------------------
[INFO] Detecting the operating system and CPU architecture
[INFO] ------------------------------------------------------------------------
[INFO] os.detected.name: osx
[INFO] os.detected.arch: aarch_64
[INFO] os.detected.version: 13.0
[INFO] os.detected.version.major: 13
[INFO] os.detected.version.minor: 0
[INFO] os.detected.classifier: osx-aarch_64
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] payment                                                            [jar]
[INFO] coverage                                                           [jar]
[INFO]
[INFO] Using the MultiThreadedBuilder implementation with a thread count of 8
...
[INFO] Reactor Summary for payment 0.0.1-SNAPSHOT:
[INFO]
[INFO] payment ............................................ SUCCESS [  5.330 s]
[INFO] coverage ........................................... SUCCESS [  0.583 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  7.144 s (Wall Clock)
[INFO] Finished at: 2022-11-01T17:30:04+05:30
[INFO] ------------------------------------------------------------------------

GIB branch used for testing

debrajmanna@debrajmanna-DX6QR261G3 gitflow-incremental-builder % git ls-remote --get-url
https://github.com/famod/gitflow-incremental-builder
debrajmanna@debrajmanna-DX6QR261G3 gitflow-incremental-builder % git status
On branch src-root
Your branch is up to date with 'origin/src-root'.

nothing to commit, working tree clean
debrajmanna@debrajmanna-DX6QR261G3 gitflow-incremental-builder %

@famod famod closed this as completed in #582 Nov 1, 2022
@famod
Copy link
Member

famod commented Nov 1, 2022

Thanks for checking @debraj-manna! I'll deploy a release in the next few days (4.1.2 or 4.2.0, depending on what else I'm adding).

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