id = "maven" name = "Apache Maven" homepage = "https://maven.apache.org" description = "Apache Maven is a software project management and comprehension tool." icon = "SimpleIcons:apachemaven" executables = ["mvn"] [dotfiles] # https://maven.apache.org/settings.html — "${user.home}/.m2/settings.xml" is # the user-level settings file; the global ${maven.home}/conf/settings.xml is # not user-level and is not listed. toolchains.xml sits beside it, per # https://maven.apache.org/guides/mini/guide-using-toolchains.html. # On Windows ${user.home} is the user profile, so both are the same ~/ paths # once the consumer resolves them. paths = [ "~/.m2/settings.xml", "~/.m2/toolchains.xml", ] # The local repository and the Maven Wrapper distributions are downloaded # artifacts, not configuration. exclude = [ "~/.m2/repository/", "~/.m2/wrapper/", ] # https://maven.apache.org/guides/mini/guide-encryption.html — settings-security.xml # holds "", the master password every other encrypted password in # settings.xml is derived from. The whole file is that one credential. secret = ["~/.m2/settings-security.xml"] # Read when Maven starts and held for the build. # entries carry the repository credentials. Maven writes one element # per line, so the line-oriented prefix syntax reaches them; a value split # across lines would not be matched, which is why a consumer is still expected # to scan the file it syncs. Everything else in settings.xml — mirrors, # proxies, profiles, pluginGroups — is worth carrying between machines, so the # file is synced and only these two elements are lifted out. [[dotfiles.secret_paths]] file = "~/.m2/settings.xml" match = { prefix = ["", ""] } # is an absolute path to this machine's disk. It is written # only when the user moves the repository off the default, and where they put # it is worth keeping so they can rebuild this machine. [[dotfiles.machine_lines]] file = "~/.m2/settings.xml" match = { prefix = [""] } scope = "backup" # is where a JDK happens to be installed on this machine — a # Homebrew prefix here, /usr/lib/jvm there, a drive letter on Windows. The # location follows from the OS and architecture the JDK was installed for, so # it holds for every machine of that class. [[dotfiles.machine_lines]] file = "~/.m2/toolchains.xml" match = { prefix = [""] } scope = "platform" [commands] format = 1 label = "Run Maven build" description = "Run lifecycle phases or goals. Settings, toolchains, checksum and password-encryption options are left out." quality = "ai-draft" base = "fig:mvn" parser = { end_of_options = "--", interleave = "permute", long_equals = true, short_attached = true, short_bundles = false } [[commands.source]] id = "fig" kind = "completion" url = "https://github.com/withfig/autocomplete/blob/master/src/mvn.ts" license = "MIT" [[commands.field]] id = "goals" label = "Phases or goals" type = "string" position = 0 multiple = true suggestions = [{ value = "clean", label = "clean" }, { value = "validate", label = "validate" }, { value = "compile", label = "compile" }, { value = "process-resources", label = "process-resources" }] sources = ["fig"] [[commands.field]] id = "define" label = "System properties" description = "name=value, for example skipTests=true." type = "string" option = ["--define", "-D"] multiple = true sources = ["fig"] [[commands.field]] id = "profiles" label = "Profiles (comma separated)" type = "string" option = ["--activate-profiles", "-P"] sources = ["fig"] [[commands.field]] id = "projects" label = "Projects to build" type = "string" option = ["--projects", "-pl"] sources = ["fig"] [[commands.field]] id = "also_make" label = "Also build required projects" type = "boolean" option = ["--also-make", "-am"] sources = ["fig"] [[commands.field]] id = "file" label = "Alternate POM" type = "path" option = ["--file", "-f"] path = { kind = "file", role = "input" } sources = ["fig"] [[commands.field]] id = "threads" label = "Threads" description = "For example 4 or 1C." type = "string" option = ["--threads", "-T"] sources = ["fig"] [[commands.field]] id = "offline" label = "Work offline" type = "boolean" option = ["--offline", "-o"] sources = ["fig"] [[commands.field]] id = "batch_mode" label = "Batch mode (non-interactive)" type = "boolean" option = ["--batch-mode", "-B"] sources = ["fig"] [[commands.field]] id = "update_snapshots" label = "Force snapshot update" type = "boolean" option = ["--update-snapshots", "-U"] sources = ["fig"] [[commands.field]] id = "errors" label = "Show error messages" type = "boolean" option = ["--errors", "-e"] sources = ["fig"] [[commands.field]] id = "debug" label = "Debug output" type = "boolean" option = ["--debug", "-X"] sources = ["fig"] [[commands.task]] id = "clean_install" label = "Clean install, skip tests" fields = ["goals", "define"] required = ["goals"] set = { goals = ["clean", "install"], define = ["skipTests=true"] } [[commands.task]] id = "test" label = "Run tests" fields = ["goals", "profiles"] required = ["goals"] set = { goals = ["test"] } [[commands.group]] id = "basic" label = "Basic" fields = ["goals", "define", "profiles", "offline"] [[commands.group]] id = "advanced" label = "Advanced" fields = ["projects", "also_make", "file", "threads", "batch_mode", "update_snapshots", "errors", "debug"]