Home
cmvn - Configured Maven User Manual
Contents
1. BOOLEAN A boolean value true or false DIR A directory in the local file system FILE A file in the local file system GAV groupld artifactld version analog to Maven or org name rev analog to Ivy GA Same as GAV but without a version LIST X A semicolon delimited list of X if ommitted than text OPTION A key value pair TEXT Text URL A URL XML A XML fragement 3 4 Directives Directives are instructions to cmvn to do something special Directive Format Description include FILE Include the content of the given file The content will be threated as if it was in the actual file val OPTION Create an immutable variable key with content value All oc curences of this variable were expanded in the value part of all succeeding lines 3 5 Settings Settings are used to generate the underlying native build scripts Currently the only sup ported buildsystem is Maven 2 Setting Format Description project GAV Project coordinates dependency GAV A project package dependency compile GAV Alias for dependency with option scope compile test GAV Alias for dependency with option scope test runtime GAV Alias for dependency with option scope runtime system GAV alias for dependency with option scope system dependencyManagement GAV Managed dependency in dependencyManagement block property OPTION Definition of property key with value value repository URL Maven Repository repo URL Alias for repository pluginre
2. aspects of the underlying build infrastructure To leave the full power to the developer cmvn supports templates for the underlying build scripts for those settings cmvn can not generate But for common project setup this is rarely needed 2 Execution Modes cmvn can be run in different execution modes gt Configuration gt Build gt Cleanup leg Autotools GNU Make CMake Scons nttp maven apache org 3 like a Repository Manager Using Apache Maven 3 0 is highly recommended The execution mode is given as first parameter when executing cmvn 2 1 Configuration Simplest Example shell gt cmvn configure Just generate the needed build scripts if needed of the underlying buildsystem For Maven this generates a pom xml and a Maven settings file cmvn settings xml in a local hidden directory 2 1 1 Automatic re configuration To reconfigure an already configured project e g because the cmvn config file has changed or a generated file is missing one can use the option reconfigure which does exactly the same as configure except that the concrete initial configuration is preserved thus only the files were recreated without changing the current configuration shell gt cmvn reconfigure If cmvn detects that the current project is not up to date it must be used with reconfigure To avoid the burden of beeing forced to run a cmvn reconfigure after each change of the project or
3. application is a lot more easy compared to platform dependent programming languages and tools nevertheless a lot of the configuration tasks of those other build systems are still required Often the lack of a configuration process in Java build systems results in very obscure setups A very popular build system for Java is Apache Maven currently in version 3 It partially helps the developer with managing her dependencies but fails miserably at producing reliable builds at least without support of a complex build infrastructure cmvn tries to close this gap by providing a configuration step before the actual build sys tem Concrete this goal will be reached by generating the build scripts for the underlying nativ build system Whenever a configuration has changed cmvn will first regenerate the build scripts and after that executes the underlying build system with the right configured settings To assist the developer but do not stay in his way cmvn does not aim to replace existing build chains Instead its main focus is adding another first configuration step to the build chain to create more reliable and reproducable build environments In its first release cmvn supports Apache Maven 2 0 and above In later releases support for various other build chains will be added e g Apache Ant Ivy SBT JackBuild or others Although cmvn generates the build scripts in Maven case pom xml files is does not can and it wants not handle all
4. cmvn Configured Maven User Manual Tobias Roeser Version 0 0 5 Contents 1 Introduction 2 Execution Modes 21 COMO lt er de rri kat nd eRe ds ED bee oo 21 1 Automatic re configuration a a amem Rew a a ais 2 1 2 Maven Settings 626 44445 8 OA See wR ee ee ew 22 EN oa ck tes a ee ee Oe ee te UN RS ok Se 23 LIBIDO 2 245444 42 84 665484448 464 4844 Be bee 3 The configuration file cmvn conf a come Sm gt sei no ow ss EA E BAS EB SG BEM 3 2 Conte file example ss sd ok eee ee oe A oe YE eo HES do Legend 2 os E ed Oe eSB E RE d E EPS EE A dd DCRR 2 eee tetas dadag HEA Ys ERE se HE GY eed e Ee Gy SENES ABRE eS TETE BREE RES DONA eS 351 project ssa passara SS Pad Bo bed SEG wm amp ER A wa ki ena keuendasdwecedwe ae fue wae 3 5 3 dependency 2645 sa monona RE RSE REP E REE RES amp 35A Property sonda eee eke kee Ad BAGS aes RR es ud ok Skt ee Og we ee mo ee ed A PI na ra a a as O Sl DULA 2 ake ka Eee EE rs a e Bon E Ed 4 Terms of Use License A Shell Wrapper B Command Shell Wrapper Windows 1 Introduction cmvn is a helper tool for developers targeted at the Java Virtual Machine JVM Its main focus is to declaratively describe and configure the required development and build environ ment A most significant difference between Java targeted build systems compared to those for C C is the lack of a defined configuration step before executing the compiler Although building a Java
5. ect but will be ignored in a transitive dependency res olution In an ideal world any compile type dependency should be optional Excluded dependency from transitive resolved dependency tree Additionally the dependency will be added to the lt dependencyManagement gt block This enforces the given version and is somethimes an alternative to the exclude option and vice versa A dependency with option scope compile A dependency with option scope test A dependency with option scope runtime A dependency with option scope system A managed dependency only in dependencyManagement block Define a property in a lt properties gt block Format OPTION 3 5 5 repository A remote Maven repository used to download dependencies Format URL Options Option Format Desciption plugins BOOLEAN Can be used to download Maven plugins default true artifacts BOOLEAN Can be used to download Maven artifacts default true releases BOOLEAN Can be used to download released dependencies snapshots BOOLEAN Can be used to download snapshot dependencies Aliases repo Same as repository pluginrepo A repository with option artifacts false artifactrepo A repository with option plugins false 3 5 6 plugin A Maven plugin contribution to the Maven lifecycle Format GAV Options Any option has the format OPTION and is added to the lt configuration gt block of the plugin definition Directives Directive Format Desciption e
6. et CMVN CMD LINE ARGS Y goto endInit Win9xArg REM Slurp the command line arguments This loop allows for an unlimited number REM of agruments up to the command line limit anyway set CMVN CMD LINE ARGS Win9xApp if la a goto endInit set CMVN_CMD_LINE_ARGS CMVN_CMD_LINE_ARGS 41 12 shift goto Win9xApp OREM Reaching here means variables are defined and arguments have been captured endInit SET CMVN JAVA EXE YJAVA HOME Nbinljava exe hCMVN JAVA EXE jar cmvn executable jar ACMVN CMD LINE ARGSY set CMVN JAVA EXE set CMVN CMD LINE ARGS 13
7. ory when running in cleanup execution mode 2 2 Build Maven Example Clean project build and install the build jar file into the local Maven repository shell gt cmvn build clean install The build execution mode is automatically enabled if no other mode was requested and at least one non option argument was given to cmvn So the example above could also be written as shell gt cmvn clean install If cmvn is run without any option and parameter but the project was configured with the reconfigure option all necessary project files will be regenerated automatically if needed 2 3 Cleanup The execution mode cleanup is used to remove all generated files and the configuration data Currently there are two variants to enable the cleanup mode one version enabled with clean removes only the generated native build scripts the other variant distclean cleans also the configuration state and any other generated environment setup e g a hidden project local Maven repository shell gt cmvn clean Cleans up all generated native build scripts shell gt cmvn distclean Cleans up all generated files including configured state Without the auto reconfigure setting the same behavior can be achieved by running cmvn reconfigure 3 The configuration file cmvn conf 3 1 Config file syntax The config file has a very simplistic human readable and editable format emp
8. po URL Alias for repository with option artifacts false artifactrepo URL Alias for repository with option plugins false module DIR The path of a sub project plugin GAV Maven plugin configuration build LIST OPTION List of options for the lt build gt block 3 5 1 project Essential project information mandatory for Maven Format GAV OPTION Options Option Format Desciption packaging TEXT The packaging of the project if ommitted than jar 3 5 2 module Definition of a sub project Format DIR OPTION Options Option Format Desciption skipCmvn BOOLEAN This sub project is a pure Maven project Do not try to find a cmvn conf file skipEmvn BOOLEAN Alias for skipCmvn for compatibility 3 5 3 dependency A dependency referencing a project in a Maven repository in most cases a jar file Format GAV OPTION Options Option scope systemPath classifier type optional exclude forceversion Aliases compile test runtime system dependencyManagement 3 5 4 property Format TEXT TEXT TEXT TEXT BOOLEAN GA BOOLEAN Desciption The scope of the dependency One of compile runtime test system or provided The local file path to the jar file Only valid if scope is system In contrast to Maven specification this path can be also relative The classifier e g sources The type An optional dependency is not optional for the current proj
9. sub project configuration the option auto reconfigure can be used together with configure shell gt cmvn configure auto reconfigure Configured that way cmvn will automatically reconfigure the project and the whole project tree before a build if needed 2 1 2 Maven Settings By default cmvn configure initally created an new project local Maven settings file and thus uses a project local repository This is intended to isolate projects from each other while still maintaining project interoperability via remotely realeased dependencies This default way enables the developer to easy build branches without fearing of interferences and inconsistencies caused by multiple projects branches that are releasing to the same local repository Of course the newly created repository and Maven settings file is shared between all sub projects of the one you just configured In case this default behavior is not desired you can tell cmvn to use an alternative existing Maven settings file with the option maven settings In this case you may will loose the benefits of side effect free development of multiple project on the same computer Also this may limit the reproducability of the build process in different environments shell gt cmvn configure maven settings home user m2 settings xml Notice that if you use an alternative Maven settings file cmvn will not touch this file and the Local Maven Reposit
10. ty lines were ignored the hash sign starts a comment until end of line keys starting with a hyphen are directives all other keys were settings values may have options in which case options are separated by a semicolon value options are themselves key value pairs delimited by equal sign A LO e RS ES true 8 non comment lines ending with a backslash 1 were continued on the next line 3 2 Config file example The following is an example project config file cmvn conf Include directive include common cmvncommon conf Immutable variable directive val EXAMPLE VERSION 0 0 1 project settings using a variable cmun uses a short syntax for projects and dependencies group artifact version GAV or org name rev project de tototec de tototec example EXAMPLE_VERSION a dependency with option spreading two lines compile de tototec de tototec example utils EXAMPLE_VERSION classifier jdk15 compile scope dependency compile org slf4j slf4j api 1 6 1 optional runtime dependency runtime ch qos logback logback classic 0 9 26 optional test scope dependency test org testng testng 5 14 6 each non comment line consists of a pair of key and value delimited by a colon if an option value is ommitted an option without an equal sign it is evaluated to 3 3 Legend The following sections contain tables with uses the following keyword in the format column
11. xtension BOOLEAN Specify if this plugin is a extensions plugin and thus e g can contribute new project packaging types execution XML A free XML fragement that will be placed inside the lt executions gt block of this plugin xml anyOption XML Can be used if the option value is XML and not text 3 5 7 build Redefine some project default settings Format LIST OPTION Options Option Format Desciption sources DIR The directory containing the source files 10 4 Terms of Use License cmvn is published under the Apache License Version 2 0 http www apache org licenses LICENSE 2 0 11 A Shell Wrapper cmvn is distributed as executable jar including all its required dependencies For convenience you may want to create a simple shell script cmvn as an executable wrapper around the program Listing 1 Shell wrapper mvu bin sh pass all arguments to cmun with exec java jar cmvn executable 0 1 0 jar B Command Shell Wrapper Windows Listing 2 Windows Command Shell wrapper cmvn bat init REM Decide how to startup depending on the version of windows OREM Windows NT with Novell Login if 08 WINNT goto WinNTNovell OREM Win98ME if NOT LOSh Windows NT goto Win9xArg WinNTNovell REM 4NT shell if eval 2 2 4 goto 4NTArgs REM Regular WinNT shell set CMVN CMD LINE ARGS x goto endInit OREM The 4NT Shell from jp software 4NTArgs s
Download Pdf Manuals
Related Search
Related Contents
Yamaha P155 Musical Instrument User Manual SERVICE MANUAL AHE-450-DE4 - Aqua Numatic Henry Xtra HVX200-12 Meat Slicer Manual del propietario Copyright © All rights reserved.
Failed to retrieve file