The package no longer builds for me due to a unit test failing
The issue has been resolved upstream. It was caused by mixed locale settings.
Git Clone URL: | https://aur.archlinux.org/portfolio.git (read-only, click to copy) |
---|---|
Package Base: | portfolio |
Description: | Track your portfolio performance (finance) |
Upstream URL: | https://github.com/portfolio-performance/portfolio |
Licenses: | EPL |
Submitter: | Cobra |
Maintainer: | Cobra |
Last Packager: | Cobra |
Votes: | 42 |
Popularity: | 0.35 |
First Submitted: | 2015-11-08 10:45 (UTC) |
Last Updated: | 2025-06-10 17:25 (UTC) |
The package no longer builds for me due to a unit test failing
The issue has been resolved upstream. It was caused by mixed locale settings.
The package no longer builds for me due to a unit test failing:
name.abuchen.portfolio.util.TextUtilTest.testIsNumericMatch -- Time elapsed: 0.003 s <<< FAILURE!
java.lang.AssertionError
at org.junit.Assert.fail(Assert.java:87)
at org.junit.Assert.assertTrue(Assert.java:42)
at org.junit.Assert.assertTrue(Assert.java:53)
at name.abuchen.portfolio.util.TextUtilTest.testIsNumericMatch(TextUtilTest.java:223)
Results:
Failures:
TextUtilTest.testIsNumericMatch:223
Tests run: 3751, Failures: 1, Errors: 0, Skipped: 0
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for Portfolio Performance 0.77.1:
[INFO]
[INFO] Portfolio Performance .............................. SUCCESS [ 0.821 s]
[INFO] portfolio-target-definition ........................ SUCCESS [ 0.175 s]
[INFO] name.abuchen.portfolio.pdfbox1 ..................... SUCCESS [01:03 min]
[INFO] name.abuchen.portfolio.pdfbox3 ..................... SUCCESS [ 0.381 s]
[INFO] name.abuchen.portfolio ............................. SUCCESS [ 45.148 s]
[INFO] name.abuchen.portfolio.junit ....................... SUCCESS [ 3.751 s]
[INFO] name.abuchen.portfolio.tests ....................... FAILURE [ 26.787 s]
[INFO] name.abuchen.portfolio.ui .......................... SKIPPED
[INFO] name.abuchen.portfolio.ui.tests .................... SKIPPED
[INFO] name.abuchen.portfolio.bootstrap ................... SKIPPED
[INFO] name.abuchen.portfolio.feature ..................... SKIPPED
[INFO] portfolio.product .................................. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 02:35 min
[INFO] Finished at: 2025-06-17T22:23:30+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.eclipse.tycho:tycho-surefire-plugin:4.0.13:test (default-test) on project name.abuchen.portfolio.tests: There are test failures.
This seems to be due to my locale de_DE.UTF-8
. To work around the error, I need to run export LC_ALL=C.UTF-8
first.
portfolio started crashing for me on startup with
java.lang.IllegalArgumentException: Unsupported class file major version 67
I got it working by executing archlinux-java set java-21-openjdk
(was on java-23-openjdk before).
I wonder why that is. Upstream seems to have switched from Java 17 to 21 in https://github.com/portfolio-performance/portfolio/pull/4230. But that got merged just recently on Oct 19 and should not yet be in the released version.
@Cobra. Thank you, I can confirm that the build succeeds with jdk17-openjdk. Maven requires java-environment>=8 and the default option is 1) jdk-openjdk, that leads to the build failing since version 0.67.0. But when you specifically choose 3) jdk17-openjdk the package builds.
@betonkarma: I had the exact same issue. When searching for the error (Could not initialize plugin: interface org.mockito.plugins.MockMaker)
, I found that it was sometimes suggested to arise from the use of the Java runtime environment instead of the development kit, and indeed, after installing jdk17-openjdk
, the package compiled without any error (without any change of the PKGBUILD). If you can confirm that this is indeed the culprit, I'm going to add JDK17 as dependency.
I'm getting these errors since version 0.67.0 (also 0.67.1) and the build fails:
Errors:
AlphavantageQuoteFeedTest.testGetLatestQuoteValid:49 » IllegalState Could not initialize plugin: interface org.mockito.plugins.MockMaker (alternate: null)
GenericJSONQuoteFeedTest.testExtractionWithDoubleVolume:335 » IllegalState Could not initialize plugin: interface org.mockito.plugins.MockMaker (alternate: null)
GenericJSONQuoteFeedTest.testExtractionWithDoubleVolumeAsString:305 » IllegalState Could not initialize plugin: interface org.mockito.plugins.MockMaker (alternate: null)
GenericJSONQuoteFeedTest.testExtractionWithLowHigh:215 » IllegalState Could not initialize plugin: interface org.mockito.plugins.MockMaker (alternate: null)
GenericJSONQuoteFeedTest.testExtractionWithVolume:245 » IllegalState Could not initialize plugin: interface org.mockito.plugins.MockMaker (alternate: null)
GenericJSONQuoteFeedTest.testExtractionWithVolumeAsString:275 » IllegalState Could not initialize plugin: interface org.mockito.plugins.MockMaker (alternate: null)
GenericJSONQuoteFeedTest.testInvalidJson:393 » IllegalState Could not initialize plugin: interface org.mockito.plugins.MockMaker (alternate: null)
GenericJSONQuoteFeedTest.testNoFeedUrl:361 » IllegalState Could not initialize plugin: interface org.mockito.plugins.MockMaker (alternate: null)
GenericJSONQuoteFeedTest.testSimpleExtraction:103 » IllegalState Could not initialize plugin: interface org.mockito.plugins.MockMaker (alternate: null)
GenericJSONQuoteFeedTest.testSimpleExtractionDateFormat1:147 » IllegalState Could not initialize plugin: interface org.mockito.plugins.MockMaker (alternate: null)
GenericJSONQuoteFeedTest.testSimpleExtractionDateFormat1AsString:169 » IllegalState Could not initialize plugin: interface org.mockito.plugins.MockMaker (alternate: null)
GenericJSONQuoteFeedTest.testSimpleExtractionDateFormat2:191 » IllegalState Could not initialize plugin: interface org.mockito.plugins.MockMaker (alternate: null)
GenericJSONQuoteFeedTest.testSimpleExtractionWithStrings:125 » IllegalState Could not initialize plugin: interface org.mockito.plugins.MockMaker (alternate: null)
YahooFinanceQuoteFeedTest.testGetLatestQuoteValid:56 » IllegalState Could not initialize plugin: interface org.mockito.plugins.MockMaker (alternate: null)
Tests run: 2864, Failures: 0, Errors: 14, Skipped: 0
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for Portfolio Performance 0.67.1:
[INFO]
[INFO] Portfolio Performance .............................. SUCCESS [ 0.499 s]
[INFO] portfolio-target-definition ........................ SUCCESS [ 0.579 s]
[INFO] name.abuchen.portfolio ............................. SUCCESS [01:16 min]
[INFO] name.abuchen.portfolio.junit ....................... SUCCESS [ 2.020 s]
[INFO] name.abuchen.portfolio.tests ....................... FAILURE [ 26.342 s]
[INFO] name.abuchen.portfolio.ui .......................... SKIPPED
[INFO] name.abuchen.portfolio.ui.tests .................... SKIPPED
[INFO] name.abuchen.portfolio.bootstrap ................... SKIPPED
[INFO] name.abuchen.portfolio.feature ..................... SKIPPED
[INFO] portfolio.product .................................. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 04:37 min
[INFO] Finished at: 2024-01-12T19:11:57+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.eclipse.tycho:tycho-surefire-plugin:4.0.4:test (default-test) on project name.abuchen.portfolio.tests: There are test failures.
[ERROR]
[ERROR] Please refer to /home/mioli/.cache/paru/clone/portfolio/src/portfolio-0.67.1/name.abuchen.portfolio.tests/target/surefire-reports for the individual test results.
[ERROR] -> [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/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <args> -rf :name.abuchen.portfolio.tests
==> FEHLER: Ein Fehler geschah in build().
Breche ab...
Fehler: ‚portfolio-0.67.1-1‘ konnte nicht erstellt werden:
Fehler: Pakete konnten nicht erstellt werden: portfolio-0.67.1-1
It insists for a good reason: portfolio is developed with Java 17 (an LTS version supported, AFAIK, until 2027), and it may or may not compile or run with any more recent version. We had several issues with that in the past until I decided to pin the version of Java to exactly the one used for its development.
But that's not really any problem: you can have several Java version installed in parallel, and switch between them using archlinux-java-run
, which is installed together with portfolio. My default is currently 17, and I haven't tested if the current version of portfolio runs with 21.
Hi Cobra, could you make portfolio work with the current java version? (jdk-openjdk 21.u35-7)
Currently portfolio insists on the old java version 17.
It works for me, many thanks to all those who worked on it.
Thanks to Bevan, we now have a simple and elegant (compared to my attempt) workaround that lets the PKGBUILD download and use the most recent version of maven (currently 3.9.4). Should not need any intervention from you. :)
Pinned Comments
Cobra commented on 2023-08-19 13:34 (UTC)
Thanks to Bevan, we now have a simple and elegant (compared to my attempt) workaround that lets the PKGBUILD download and use the most recent version of maven (currently 3.9.4). Should not need any intervention from you. :)