There are two primary things you need to do to convert to a Maven project:
1. Arrange your project files in the directory structure required by Maven. For example, Java source goes under src/main/java,
testing code under src/test/java. webapp files such as JSPs and WEB-INF/web.xml would go under src/main/webapp and so forth.
2. Create an appropriate Maven POM file that declares what kind of product you are creating (JAR, WAR, whatever), what its name and version are going to be, what plugins - if any - will be required for Maven to do the jobs, and what dependencies there are for Maven and in what scope. For example:
These 2 dependencies pull in servlet API version 2.4 (it's from an old project) and
JSP API version 2.0. Scope is "provided", meaning that these are libraries which will be used to help compile, but will not be included in the WAR, since they're provided by the webapp server. A common scope is "compile", which not only compiles using the dependency, but also inserts a copy of the dependency into the target product (for WARs, that means Maven will put it under WEB-INF/lib/.)
Maven keeps a local cache of dependencies, so if you reference a dependency or dependency version that isn't already in your cache, it will automatically download a copy from a Maven repository off the Internet (or, if your shop has a local repository server, from there).
I believe that Base64 was originally stolen by people from private Sun libraries and that ability is no longer available, so you'll have to adjust for that. I'm not sure if the org.w3c classes are still relevant or if they have been supplanted by something more modern, but if they're at all still worth using, then there should be a library that Maven can use.
Not only is if fine to use J2EE libraries for an open source project, I think that JEE (the successor to J2EE) is itself entirely open-source since Oracle handed it over to jakarta.