viernes, 15 de junio de 2012

Maven offline

Right so this one time at band camp.... (really don't get it??? American Pie 1 OMG!!!)

Ok moving on, I have this maven project which has like ALL THE DEPENDENCIES IN THE WORLD.

And every time I build it it start downloading all of them. Problem is 99.9999999% of the time they don't change.

How to avoid that overhead?
mvn -o
The -o modifier tells maven not to go look for the dependencies and to use the ones it already has.

Now we're on the subject I found this cool page that list all the modifiers. Nothing you could't do with a  mvn --help, never the less I need to keep posting you know.

So here it is the list of modifiers:


usage: mvn [options] [<goal(s)>] [<phase(s)>]

Options:
 -q,--quiet                        Quiet output - only show errors
 -C,--strict-checksums             Fail the build if checksums don't match
 -c,--lax-checksums                Warn if checksums don't match
 -P,--activate-profiles            Comma-delimited list of profiles to
                                   activate
 -amd,--also-make-dependents       If project list is specified, also
                                   build projects that depend on projects on the list
 -ff,--fail-fast                   Stop at first failure in reactorized
                                   builds
 -rf,--resume-from                 Resume reactor from specified project
 -fae,--fail-at-end                Only fail the build afterwards; allow
                                   all non-impacted builds to continue
 -B,--batch-mode                   Run in non-interactive (batch) mode
 -am,--also-make                   If project list is specified, also
                                   build projects required by the list
 -fn,--fail-never                  NEVER fail the build, regardless of
                                   project result
 -emp,--encrypt-master-password    Encrypt master security password
 -ep,--encrypt-password            Encrypt server password
 -up,--update-plugins              Synonym for cpu
 -N,--non-recursive                Do not recurse into sub-projects
 -npr,--no-plugin-registry         Don't use ~/.m2/plugin-registry.xml for
                                   plugin versions
 -gs,--global-settings             Alternate path for the global settings
                                   file
 -U,--update-snapshots             Forces a check for updated releases and
                                   snapshots on remote repositories
 -cpu,--check-plugin-updates       Force upToDate check for any relevant
                                   registered plugins
 -npu,--no-plugin-updates          Suppress upToDate check for any
                                   relevant registered plugins
 -V,--show-version                 Display version information WITHOUT
                                   stopping build
 -D,--define                       Define a system property
 -X,--debug                        Produce execution debug output
 -e,--errors                       Produce execution error messages
 -f,--file                         Force the use of an alternate POM file.
 -h,--help                         Display help information
 -o,--offline                      Work offline
 -pl,--projects                    Build specified reactor projects
                                   instead of all projects
 -r,--reactor                      Dynamically build reactor from
                                   subdirectories
 -s,--settings                     Alternate path for the user settings
                                   file
 -v,--version                      Display version information

No hay comentarios:

Publicar un comentario