Maven jQA:scan -Djqassistant.scan.reset=false leaves a lock file?

3 views
Skip to first unread message

Gerd Aschemann

unread,
Aug 4, 2025, 12:16:00 PMAug 4
to 'Gerd Aschemann' via jQAssistant
I have a (rather complex) build script which call Maven on a number of repositories to execute jQA `scan` on them. As I want to accumulate all results in a single database, I start every run with -Djqassistant.scan.reset=false.
As far as I can see, jQA very often leaves a lock file in the database directory (`…/store/data/databases/store_lock`) which prevents the next iteration to run successfully. 

Error: Failed to execute goal com.buschmais.jqassistant:jqassistant-maven-plugin:2.7.0:scan (default-cli) on project indexer-reader: Execution default-cli of goal com.buschmais.jqassistant:jqassistant-maven-plugin:2.7.0:scan failed: Error starting Neo4j database server at .../jqassistant/store/data/databases: Component 'org.neo4j.kernel.internal.locker.LockerLifecycleAdapter@14ddbb6a' was successfully initialized, but failed to start. Please see the attached cause exception "Unable to obtain lock on file: .../jqassistant/store/data/databases/store_lock. Please ensure no other process is using this database, and that the directory is writable (required even for read-only access)". -> [Help 1]

As a workaround, I have added a loop which checks for the lock file and removes it after some (15) seconds if it does not vanish. This has improved the situation, though making the whole process way slower (I have 125 repositories to scan). It runs many hours so, these (125x15 secs) ~30 minutes do not really matter.
However on some of the projects jQA scan runs into the lock problem anyway (even when starting with a clean db directory). It seems to fail after checking some modules successfully but on one of the last modules. I see this behaviour on several of my 125 repos but could not yet identify a common pattern, eg., some projects are single module projects, others are multi module. It seems to always fail on multi module projects but not every multi module project involved.

Looks like this (excerpt):
[INFO] Maven SLF4J Simple Provider ........................ SUCCESS [ 0.164 s]
[INFO] Maven Embedder ..................................... SUCCESS [ 3.052 s]
[INFO] Maven Compat ....................................... SUCCESS [ 2.525 s]
[INFO] Apache Maven Distribution .......................... FAILURE [ 3.401 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------

I seem to have this problem with jQA 2.6.0 and 2.7.0 (some month ago I was using 2.5.0 and cannot remember such issues, but perhaps had other changes).

Any ideas?

--
Gerd Aschemann --- Veröffentlichen heißt Verändern (Carmen Thomas)
+49/173/3264070 -- ge...@aschemann.net -- http://www.aschemann.net

Dirk Mahler

unread,
Aug 6, 2025, 8:14:26 AMAug 6
to jqass...@googlegroups.com
Hi Gerd,

this message usually occurs if a Maven module contains an extension. In
this case jQA cannot detect that the store is already opened and the
underlying database is already in use (classloading stuff).

Can you try to add the property "-Djqassistant.maven.reuse-store=false"
to your mvn command line? It will open and close the database per
module, so the build will be slower than before.

Cheers

Dirk
> --
> You received this message because you are subscribed to the Google
> Groups "jQAssistant" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to jqassistant...@googlegroups.com.
> To view this discussion visit
> https://groups.google.com/d/msgid/jqassistant/584DDD5C-1DF3-4C03-95E7-299D1438F89D%40aschemann.net
> .

--
Senior Consultant IT
-----------------------------------------------------------------
BUSCHMAIS GbR
Inhaber Torsten Busch, Frank Schwarz, Dirk Mahler, Tobias Israel
Adresse Leipziger Straße 93, 01127 Dresden
Telefon +49 351 320923-0
Mobil +49 177 3137411
Fax +49 351 320923-29
E-Mail dirk....@buschmais.com
Internet www.buschmais.de
-----------------------------------------------------------------

Gerd Aschemann

unread,
Aug 7, 2025, 2:33:09 AMAug 7
to jqass...@googlegroups.com
Hi Dirk,

thanks, this has at least lead to successful completion of all scans (even the multi module projects).
Nevertheless, the store_lock file still remains in place and I delete it before starting the next scan for another repository writing to the same DB.

How can I get rid of that?

Regards
  Gerd

Reply all
Reply to author
Forward
0 new messages