Can't find /mvn directory with 6.2

Good stuff Zac/Micha! Just tried it out with a simple library hosted on Maven and it worked perfectly.

But I can’t see where the jar has been downloaded to. The /mvn/ directory you mention doesn’t exist in my case. Nothing in the deploy log either, or in the Bundles list in the admin UI.

Where can I find it? (This is a standard 6.2.1.122 Tomcat install on Windows).

1 Like

Ummm, in single mode?

Try this maybe? Make a typo in the maven artifact

Yes, single mode.

Can’t see anything in the catalina log about Maven, even if I run from the command line.

I’ve searched the lucee install folder for the name of the jar but found nothing.

Wait, do you have a .m2 cache?

Erm, not that I know of?

With those logs settings, look in application.log?

One it’s installed it might no longer log as it’s simply found and used

Catalina.log is only for servlet related stuff

My bad the path was wrong, it’s just lucee-server\mvn\ not under the context

Actually I wasn’t seeing that directory either, but I think I’ve worked out why.

I already had an older version of the jar in my Lucee Admin > Bundles list (installed using osgiLoader).

When I uninstalled the existing jar and then ran my code, the specified jar was indeed downloaded to lucee-server\mvn\.

I think this might be a bug because, while I would expect Lucee not to download the jar from MVN if it finds a copy already installed locally, that should only be the case if the local version is the same.

I had specified a newer version so Lucee should have downloaded it.

It doesn’t just affect jars that have been custom installed. Here’s an example where I want to use the latest version of Tika, but Lucee is forcing me to use the much older version it already has loaded.

test.cfc

component javaSettings='{
  "maven": [
    {
      "groupid": "org.apache.tika",
      "artifactid": "tika-app",
      "version": "3.1.0"
    }
  ]
}'{
  //https://mvnrepository.com/artifact/org.apache.tika/tika-app/3.1.0
  
  import "org.apache.tika.Tika"

  function init(){
    Dump( BundleInfo( New Tika() ).location )
  }

}

index.cfm

<cfset New test()>

Output
C:\lucee\tomcat\lucee-server\bundles\org.lucee.tika-core-1.28.4.jar

According to the docs, there’s supposed to be encapsulation/isolation here but that doesn’t seem to be happening.

OK to file an issue, Zac?

Go for it

But in this case, I’d be creating an instance via new referencing Tika via the import alias and dumping the object to confirm.

BundleInfo is using a different code path, Java settings supports non osgi jars too

It’s often not easy to tell from a dumped object what version you’re dealing with.

Tika is OSGi compatible and BundleInfo() seems to give the same info as the dumped object:

Screenshot 2025-05-12 at 09-31-21

Which makes it clear it’s the wrong version and the requested version hasn’t been downloaded from Maven. Hence I think it’s the simplest way of testing here.

Huh! Now I’m really confused… Looking at my lucee-server/mvn directory it seems that when I started Lucee up about 45 minutes ago a whole bunch of java libraries were downloaded into it!

Why did that happen?!

Lucee automatically downloads all the required dependencies for the artifact specified in java settings

when doing this sort of stuff, I find this really useful to output all the logs to the console

set lucee_logging_force_level=trace
set lucee_logging_force_appender=console

Why didn’t it do that yesterday when I was testing this stuff out. Does it only download dependencies after a restart?

I can see that Tika 3.1.0 is among the new downloads, but my test case is still loading the old version.

I got a error loading dependencies in my logs the first time I tried it and then it fell back on the installed versions

Definitely some bugs which need resolving

Probably need to knock up some integration tests on lucee-testlab for all this kinda stuff

seems to fail the first time after a restart!

Might that not just be because the dependencies haven’t finished downloading the first time? Assuming this is a fresh instance each time the tests are run.

possibly, but that should be done sync, not async

   [java]    [script] 	testAdditional.poiTest -------------- load poi 5.4.0 via javasettings (first time) --------------
     [java] ->/home/runner/.m2/repository/org/apache/poi/poi/5.4.0/poi-5.4.0.pom
     [java] ->/home/runner/.m2/repository/org/apache/poi/poi/5.4.0/poi-5.4.0.jar
     [java]    [script] "DEBUG","main","05/12/2025","11:58:13","maven","int dependencies for groupID:org.apache.poi;artifactId:poi;version:5.4.0"
     [java]    [script] "DEBUG","main","05/12/2025","11:58:13","maven","int parent for groupID:org.apache.poi;artifactId:poi;version:5.4.0"
     [java]    [script] "DEBUG","main","05/12/2025","11:58:13","maven","int properties for groupID:org.apache.poi;artifactId:poi;version:5.4.0"
     [java]    [script] "DEBUG","pool-6-thread-1","05/12/2025","11:58:13","maven","int repositories for groupID:org.apache.poi;artifactId:poi;version:5.4.0"
     [java]    [script] ->/home/runner/.m2/repository/commons-codec/commons-codec/1.17.1/commons-codec-1.17.1.pom
     [java]    [script] ->/home/runner/.m2/repository/org/apache/commons/commons-collections4/4.4/commons-collections4-4.4.pom
     [java]    [script] ->/home/runner/.m2/repository/org/apache/commons/commons-math3/3.6.1/commons-math3-3.6.1.pom
     [java]    [script] ->/home/runner/.m2/repository/commons-io/commons-io/2.18.0/commons-io-2.18.0.pom
     [java]    [script] -------------- load poi 5.4.0 via javasettings (again) --------------
     [java]    [script] "DEBUG","main","05/12/2025","11:58:13","dynamic","extract metadata from [org.apache.poi.Version]"
     [java]    [script] -------------- load poi 5.4.1 via javasettings (first time) --------------
     [java]    [script] ->/home/runner/.m2/repository/org/apache/poi/poi/5.4.1/poi-5.4.1.pom
     [java]    [script] ->/home/runner/.m2/repository/commons-codec/commons-codec/1.17.1/commons-codec-1.17.1.jar
     [java]    [script] ->/home/runner/.m2/repository/org/apache/commons/commons-collections4/4.4/commons-collections4-4.4.jar
     [java]    [script] ->/home/runner/.m2/repository/commons-io/commons-io/2.18.0/commons-io-2.18.0.jar
     [java]    [script] ->/home/runner/.m2/repository/org/apache/commons/commons-math3/3.6.1/commons-math3-3.6.1.jar
     [java]    [script] ->/home/runner/.m2/repository/org/apache/poi/poi/5.4.1/poi-5.4.1.jar
     [java]    [script] ->/home/runner/.m2/repository/com/zaxxer/SparseBitSet/1.3/SparseBitSet-1.3.pom
     [java]    [script] ->/home/runner/.m2/repository/com/zaxxer/SparseBitSet/1.3/SparseBitSet-1.3.jar
     [java]    [script] "DEBUG","main","05/12/2025","11:58:13","maven","int dependencies for groupID:org.apache.poi;artifactId:poi;version:5.4.1"
     [java]    [script] "DEBUG","main","05/12/2025","11:58:13","maven","int parent for groupID:org.apache.poi;artifactId:poi;version:5.4.1"
     [java]    [script] "DEBUG","main","05/12/2025","11:58:13","maven","int properties for groupID:org.apache.poi;artifactId:poi;version:5.4.1"
     [java]    [script] "DEBUG","pool-7-thread-1","05/12/2025","11:58:13","maven","int repositories for groupID:org.apache.poi;artifactId:poi;version:5.4.1"
     [java] ->/home/runner/.m2/repository/commons-codec/commons-codec/1.18.0/commons-codec-1.18.0.pom
     [java]    [script] -------------- load poi 5.4.1 via javasettings (again) --------------
     [java]    [script] "DEBUG","main","05/12/2025","11:58:13","dynamic","extract metadata from [org.apache.poi.Version]"
     [java]    [script] 	 (2 tests passed in 531 ms, 2 ERRORED)
     [java]    [script] ERRORED
     [java]    [script] 
     [java]    [script] 	Suites/Specs: 1/4
     [java]    [script] 	Failures: 0
     [java]    [script] 	Errors:   2
     [java]    [script] 	Pass:     2
     [java]    [script] 	Skipped:  0
     [java]    [script] "DEBUG","main","05/12/2025","11:58:13","dynamic","extract metadata from [java.lang.ClassNotFoundException]"