Home

cmvn - Configured Maven User Manual

image

Contents

1. 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 aspects of the underlyin
2. option scope test A dependency with option scope runtime A dependency with option scope system A managed dependency only in dependencyManagement block Example compile org slf4j slf4j api 1 6 1 optional compile org slf4j jcl over slf4j 1 6 1 optional forceversion test org testng testng 6 0 1 3 5 4 property Define a property in a lt properties gt block Format OPTION Example property maven compiler source 1 6 property maven compiler target 1 6 property project build sourceEncoding UTF 8 10 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 extension BOOLEAN Specify if this plugin is a extensions plugin and thus e g can contribute new project packaging ty
3. or greater Setting Format Description artifactrepo URL Alias for repository with option plugins false build LIST OPTION List of options for the lt build gt block plugin GAV Maven plugin configuration project GAV Project coordinates compile GAV Alias for dependency with option scope compile dependency GAV A project package dependency eclispeClasspath LIST OPTION List of options to generate a classpath file used by Eclipse dependencyManagement GAV Managed dependency in dependencyManagement block exclude GA Exclude the given dependency in transitive de pendencies Will generate exclusion blocks in any dependency block module DIR The path of a sub project pluginrepo URL Alias for repository with option artifacts false property OPTION Definition of property key with value value repo URL Alias for repository repository URL Maven Repository runtime GAV Alias for dependency with option scope runtime system GAV alias for dependency with option scope system test GAV Alias for dependency with option scope test 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 Example using maven bundle plugin project org example org example osgibundle 1 0 0 packaging bundle 3 5 2 module Definition of a sub project Format DIR OPTION Options Option For
4. E_ARGS x goto endInit REM The 4NT Shell from jp software 4NTArgs set 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 14 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 15
5. ation 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 Since cmvn 0 1 2 autoreconfigure is the default 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 t
6. cmvn Configured Maven User Manual Tobias Roeser Version 0 1 6 Contents 1 Introduction 3 2 Execution Modes 3 21 TOWSON lt sr Son it kar Be dE Res da dba dia ED bw eG 4 2 1 1 Automatic re configuration 2002 4 2 1 2 Maven Settings 2 25442 54 A eee aa ea ewe 4 2 1 3 Using Templates pom ml cam cocoa a Ra 5 22 WMG AA 5 Zor CIEN 2 ee 4 4 ed CELE E E E SEGUE EME MEE 6 3 The configuration file cmvn conf 6 ole Camila Me Sa ae ee Ee Gye Ad e BPR te BR nk be de E 6 3 2 Contig le OAR css 222k SE AE E REA SA Md HO 7 Oot Legend mo ra aa as rs ads e 7 dd DIENES ass ar AREA A E A 7 DO AS aa AO a EM 8 do Project errar aia riders gone ers q 8 Qe WANS cocer GA eed SR SLRE SES SEE ARE REG a 9 3 5 3 dependency 2 545 dra AE BRE EER RE RR RA 9 o pen md ee Bk ee Oe RR ee eee ho ae ed 10 Soy Papeete A ee Oe ee wee ee a pb e Be 11 a TEA 11 SR 12 39 5 8 SELIpSaDlIsSSpatB 2 oa eee eon ee aa 12 4 Terms of Use License 13 A Shell Wrapper 14 B Command Shell Wrapper Windows 14 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 application is a lot more
7. figuration 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 3 The configuration file cmvn conf 3 1 Config file syntax The config file has a very simplistic human readable and editable format empty lines were ignored the hash sign starts a comment until end of line each non comment line consists of a pair of key and value delimited by a colon 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 PUSE SOM A A O ale if an option value is ommitted an option without an equal sign it is evaluated to 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
8. g 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 sub project configur
9. his file and the Local Maven Repository when running in cleanup execution mode 2 1 3 Using Templates pom xml cmvn When cmvn detects the presence of a file pom xml cmvn it will use it as template when generating the pom xml file for Maven cmvn will first read the template file and afterward extend it with the settings found in cmvn conf You can use this to easily migrate existing Maven projects or if you need complex setups and Maven features like lt profile gt 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 Without the auto reconfigure setting the same behavior can be achieved by running cmvn reconfigure 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 con
10. mat 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 Example module org example domain module org example service module org example service impl legacy skipCmvn 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 Format TEXT FILE 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 project 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
11. pes 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 Example plugin org apache maven plugins maven assembly plugin 2 2 beta 5 appendAssemblyld false xml descriptorRefs lt descriptorRef gt jar with dependencies lt descriptorRef gt xml archive lt manifest gt lt mainClass gt org example Main lt mainClass gt lt manifest gt 11 3 5 7 build Redefine some project default settings Format LIST OPTION Options Option Format Desciption sources DIR The directory containing the source files testSources DIR The directory containing the test source files finalName FILE The name of the final build JAR file targetDir DIR The directory containing the build output files e g target 3 5 8 eclipseClasspath Generate a classpath file which can be used by Eclipse to generate the project classpath container Format LIST OPTION Options Option Format Desciption autoGenerate TEXT Auto generate lib entries for project dependencies of the given scope Supported scopes are compile includes pro vided and system test runtime optional BOOLEAN Generate an optional marker for the actual entry key TEXT A free key added as attribute in the classpathentry element Known supported attributes are e g kind path output sourcepath E
12. 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 3 3 Legend The following sections contain tables with uses the following keyword in the format column 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 configClass LIST OPTION Generate a Java class as source code containing static methods 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 except include 3 5 Settings Settings are used to generate the underlying native build scripts Currently the only sup ported buildsystem is Maven 2
13. xample Multiple given eclipseClasspath settings to configure a Java 6 project with tests eclipseClasspath kind src path src main java eclipseClasspath kind src path src main resources eclipseClasspath kind output path target classes eclipseClasspath kind src output target test classes path src test java eclipseClasspath kind con path org eclipse jdt launching JRE_CONTAINER org eclipse jdt internal debug ui launcher StandardVMType JavaSE 1 6 eclipseClasspath autoGenerate compile eclipseClasspath autoGenerate test 12 4 Terms of Use License cmvn is published under the Apache License Version 2 0 http www apache org licenses LICENSE 2 0 13 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 3 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_LIN

Download Pdf Manuals

image

Related Search

Related Contents

P3000 PowerMarquee Master Display Hardware User Manual  グルテストNeoアルファによるSMBG※  Manual  Organização do Ano Lectivo 2011  OM, Gardena, Nettoyeur-Brosseur haute pression, Art 05700      INSCRIPTIONS - MODE D`EMPLOI Année 2014 - Saint  Gebrauchsanweisung Operating instructions Istruzioni d'uso Mode d  東 京 ガ ス 株 式 会 社 住宅用火災(煙式)・ガス・CO警報器 SC-K712C-K  

Copyright © All rights reserved.
Failed to retrieve file