jar files in WEB-INF/lib - marven not picking up?

Im using intelliJ and vaadin 14 - I know this is not strickly a vaadin question but I hope its ok to ask anyway. I need som JAR files in my project from external source (in this case I cannot use a maven dependncy) so I put them in the src … /WEB-INF/lib folder.

I can compile the project fine and run it using intellij, but when I run the “install” target of maven it cannot compile since it does not find the packages and classes. How can I make maven know about the jarfiles?

  1. You can deploy the version on your local maven store:
    http://maven.apache.org/guides/mini/guide-3rd-party-jars-local.html
    This must be done for everyone building the software. And it’s a pain to manage (updates etc).

  2. Alternatively you can use a standalone maven proxy/dependency manager where you manage external dependencies and your software versions

  3. I dont know how long maven will support this, but this is also possible. Create a directory /lib and put this in your pom:

<dependency>
            <groupId>org.bla</groupId>
            <artifactId>arti</artifactId>
            <version>1.0</version>
            <scope>system</scope>
            <systemPath>${basedir}/lib/myjar.jar</systemPath>
        </dependency>

and in the copy-rename-maven-plugin

<configuration>
    <fileSets>
        <fileSet>
            <sourceFile>lib/myjar.jar</sourceFile>
            <destinationFile>target/${project.artifactId}-${project.version}/WEB-INF/lib/myjar.jar</destinationFile>
        </fileSet>
    </fileSets>
</configuration>

Regards