You don't "package a database". MySQL/MariaDB is a fully stand-alone product in its own right. The only "package" there is the OS application installation package(s) for the MySQL server, client, and tools.
You do, however,
provision a database. That is, you use DDL to define the schema and SQL to pre-load any initial data such as constant lookup tables.
That's outside of Java, however. In fact, when I worked in a more bureaucratic environment, I kept a separate "SQL" directory in my project that the database administrator would pull all the DDL and SQL from and run it, since developers weren't supposed to directly touch production databases. In a shop provisioned via something like
Jenkins, I'd expect that the SQL operations could be made part of the Jenkins profile for that project.
Another alternative would be to put "one-shot" code into the web application that would pull the DDL/SQL from a WAR resource file and execute it via brute-force
JDBC statements. That's assuming that the required database directives are allowed via JDBC - which isn't true in all DBMS systems.
Still another alternative if you're using an ORM like Hibernate is to set the Hibernate configuration option that will cause Hibernate to build the tables you need. You'll probably have to have the DBA create the database manually first, though. And any data loading code would be manually written.
I don't really like either of the last 2 options, since they make the WAR consume more resources, may require it to have additional database privileges (which could be used as exploits), and provide the potential to damage the database schema, but to each their own.