Getting IllegalArgumentException on trying to use the extension
See original GitHub issueDiscussed in https://github.com/gitflow-incremental-builder/gitflow-incremental-builder/discussions/578
<div type='discussions-op-text'>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?</div>
Issue Analytics
- State:
- Created a year ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Extension functions: IllegalArgumentException vs ...
An IllegalArgumentException indicates to me that the caller is violating the function contract. So in the case that you have an extension ......
Read more >Method threw 'java.lang.IllegalArgumentException' exception ...
Can not set java.lang.Long field com.azure.messaging.eventhubs.EventData$SystemProperties.sequenceNumber to (long)10 at.
Read more >Solving java.lang.IllegalArgumentException
java.lang.IllegalArgumentException is thrown in order to indicate that a method has been passed an illegal or inappropriate argument.
Read more >Non trivial error in case of collision between DSL extension ...
IllegalArgumentException : Cannot add extension with name 'android', as there is an extension already registered with that name. * Try: Run ...
Read more >"java.lang.IllegalArgumentException" while running ... - IBM
Symptom. The error happens because the value set for DataType in Extensions.xml is not valid for some of the custom table entities.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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).
Thanks @famod . I tried with your PR branch. I am not getting the error.
Below is the relevant build log
GIB branch used for testing