Maven is a tool for among others managing java dependencies, and building your application. It is used to produce a java application. As you understand, JavaScript runs on the client side in a web application, while java runs on the server side. But sometimes Maven can import JS resources as an integral part of a java library. PrimeFaces is one example.
As to the resource management within a JSF application, including JS scripts, you've basically got two ways:
- Import external scripts with a plain HTML
<script>
element. This way you don't need to do any imports and just reference an external to JSF script.
- Import internal scripts with a
<h:outputScript>
. This way, resources and in particular your scripts, will be imported from within a web application, most possibly, but not necessarily, from within your resources
folder. Otherwise, you can access scripts from maven imported artifacts, like PrimeFaces, that include JS resources as well. In this case you need to specify library
attribute of <h:outputScript>
.
To my knowledge, no java library ships with Three.js included, so your best bet is to either reference an external script, or import it within your JSF project. But if I'm wrong - just go ahead and incude that library via Maven to be able to reference it in your views.