rbeckman-nextgen / test-mc6

0 stars 0 forks source link

Define a Resource as a Maven dependency #3757

Open rbeckman-nextgen opened 4 years ago

rbeckman-nextgen commented 4 years ago

Add a new resource type to define a resource as a Maven dependency and repository.

Imported Issue. Original Details: Jira Issue Key: MIRTH-3899 Reporter: jbartels Created: 2016-03-08T07:12:32.000-0800

rbeckman-nextgen commented 4 years ago

A behavior similar to what I am after can be accomplished by taking the following manual steps:

[1] example pom, this happens to pull dependencies for jasper reports: `

4.0.0 com.mirth grab-mvn-deps pom 0.0.1 net.sf.jasperreports jasperreports 5.6.0 bcmail-jdk14 org.bouncycastle bcprov-jdk14 bouncycastle bcprov-jdk14 org.bouncycastle bcmail-jdk14 bouncycastle jdtcore eclipse log4j log4j org.slf4j slf4j-log4j12 org.slf4j jcl104-over-slf4j net.sf.jasperreports jasperreports-fonts 4.0.0

`

[2] - https://maven.apache.org/plugins/maven-dependency-plugin/copy-dependencies-mojo.html

Imported Comment. Original Details: Author: jbartels Created: 2016-03-08T08:28:43.000-0800

rbeckman-nextgen commented 4 years ago

We would not do anything like calling "mvn" in a local OS shell from within the MC JVM... Instead, there would have to be a way to download the JAR every time the resource is updated. Remember that all this needs to be dynamic and multiple-classloader friendly; it's not something that would be done only at build time or server startup time.

There's probably some embedded way to do parse a POM, and get download URLs for each dependency ID. Note that this would require that the server have access to the internet, which is not always possible depending on the environment.

Imported Comment. Original Details: Author: narupley Created: 2016-03-08T08:39:56.000-0800

rbeckman-nextgen commented 4 years ago

A similar need came up on another project and I was able to do some research.

I was able to find some additional options:

Maven Invoker looks really good, but under the covers it just makes syscalls to "mvn".

Mojo Executor is not actively maintained, but it does appear to be pure Java. I'm not able to find it making syscalls. I think it directly invokes the Maven Mojo classes. What is less clear is how to load its execution environment.

Imported Comment. Original Details: Author: jbartels Created: 2016-11-18T14:43:16.000-0800