Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add missing maven libraries to Jetty

I am trying to launch a maven project, that I always launched manually in Tomcat, in Jetty. For this I am using the maven-jetty-plugin.

When executing jetty:run It seems like everything goes fine, except for the fact that Jetty does not find the dependencies defined in the POM.

If I run jetty:war, the war is built properly, using the dependencies, so that works. Why is jetty:run not including my libraries in WEB-INF/lib (or anywhere else)?

like image 877
W. Goeman Avatar asked Dec 03 '25 16:12

W. Goeman


1 Answers

If you need a dependency for Jetty which resides somewhere other than the main Maven repo, add the following:

<pluginRepositories>
    <pluginRepository>
        <id>repo-id</id>
        <url>http://my_other_repo.edu</url>
    </pluginRepository>
</pluginRepositories>

I don't believe Jetty will use the existing repositories in your POM.

like image 154
jthiesse Avatar answered Dec 06 '25 09:12

jthiesse



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!