Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maven project variables for dependencies

I have an html file which loads an applet. The html needs to refer to the jar by name, and since maven names it based on the artifactid, version, etc, the html needs to be dynamically updated as the project evolves. It seems like resource filtering is the way to go, but I can't figure out what the variable to interpolate should look like. I'd like something along the lines of ${project.dependencies.myartifactid.version}, but that doesn't seem to be an option and I've had woeful luck googling.

like image 322
Erik Ackerman Avatar asked Feb 01 '26 14:02

Erik Ackerman


1 Answers

You'll need something like ${project.dependencies[0].artifactId} where 0 is the index of the dependency of the applet in your war module (see PLXUTILS-37). And indeed, using resources filtering should work.

Update: It appears that there is bug in the Maven Resources Plugin, this property doesn't get filtered as mentioned in this question. You may have to use the workaround suggested in this answer.

like image 114
Pascal Thivent Avatar answered Feb 04 '26 04:02

Pascal Thivent