question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Getting IllegalArgumentException on trying to use the extension

See original GitHub issue

Discussed 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:closed
  • Created a year ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
famodcommented, 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).

0reactions
debraj-mannacommented, 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 %
Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found