Advanced Maven Techniques

1y ago
3.27 MB
83 Pages
Last View : 8m ago
Last Download : 1y ago
Upload by : Averie Goad

Advanced Maven TechniquesAnders HammarCTO, Devoteam Quaint

Who am I?Consultant at Devoteam Quaint10 years of Java4 years of MavenMaven trainerActive within the Maven communityNexus OSS contributor

Welcome to MavenSo what is Maven about, anyway?Maven manages the build processReuse standard build logic (compile, package,.)Applies it’s logic to a project, guided by project description (or “metadata”)Maven uses a declarative approachDescribe your project, not just the steps required to build itYour project description (or “object model”) goes in a pom.xml file

Key Features of MavenSo how can Maven help me and my team?A standardized build and deployment processA standardized project directory structureImproved dependency managementEasy to generate reasonable technical reports

Benefits of MavenBuild standardization - “A Common Interface”All basic functionality is provided no matter what Maven project you useDependency managementNo more manual management of dependencies and guessing versionsLifecycle managementProvides a build life cycle instead of making completely you build yourownProject management best practicesConsistent directory structure provides easy understanding of artifacts

Maven Golden RuleA Maven project creates one artifactSecondary artifacts might exist (sources JAR, Javadoc JAR, etc.)Want more than one artifact?Create several projects!

Maven Versions2.0latest: - end-of-life?2.1latest: 2.1.0Do not use - has issues!2.2latest: 3.0-alpha-6

Supported LanguagesMaven requires Java to execute.but supports many programming languagesJava, Flex, .Net, C , .nMave

Maven ResourcesApache Maven ProjectWebsite: http://maven.apache.orgMailing Lists: Users Mailing ListMaven Developers Mailing ListSonatype: http://www.sonatype.comSonatype Blogs: http://blogs.sonatype.comMaven support available from Sonatype

Maven BooksMaven: By ExampleMaven: The Complete Reference

More Maven BooksRepository Management with NexusDeveloping with Eclipse and MavenThe Maven Handbook

Today’s TopicsAdvanced Dependency ManagementLifecycle CustomizationPlugin Management

CreditTutorial based on Maven training materialCourtesy by Sonatype

Maven @ Jfokus 2010Next Generation Development Infrastructure: Maven, M2Eclipse, Nexus& Hudson by Jason van Zyl14.15-15.00, Jan 27Also come visit Sonatype’s booth!

Advanced Maven TechniquesMaven in your IDEPart 0 - M2Eclipse

Maven in EclipseMaven Eclipse Plugin (maven-eclipse-plugin)mvn eclipse:eclipseM2EclipseEclipse pluginstatic vs. dynamic

Maven in EclipseUsing Maven in EclipseThe M2Eclipse plugin currently provides the best IDE support for MavenEclipse build path based on the POMLaunch Maven from within EclipseGraphical pom editorDependency graphsSimplified dependency managementQuick search for dependenciesAutomatic download of sources and javadocMaterialize a project from POM

Maven in EclipseInstalling the m2eclipse plugin:Install the m2eclipse plugin from the Sonatype update siteUse install as normal

Maven in EclipseAlways run Eclipse using a JDKThe m2eclipse plugin expects a JDK.Eclipse doesn’t always run with a JDK by defaultUse the -vm option to point to your JDK in Windows"C:\Program Files\eclipse\eclipse.exe"-vm "C:\Program Files\Java\jdk1.6.0 05\bin"

DemoLet’s have a look.

Advanced Maven TechniquesManaging your dependenciesPart 1 - Advanced Dependency Management

DependenciesWhat are dependencies?Artifacts on which a project relies to compile, test, run, etc.Example:activemq-core mq-corecommons-logginggeronimo-jmsjunit

DependenciesProject dependencies are defined in the POM:Defined using the Maven artifact co-ordinatesDefined in the dependencies section dependencies dependency groupId commons-logging /groupId artifactId commons-logging /artifactId version 1.1 /version /dependency Dependency on commons-logging 1.1 dependency groupId org.apache.geronimo.specs /groupId artifactId geronimo-jms 1.1 spec /artifactId version 1.1.1 /version scope provided /scope /dependency geronimo-jms will be provided by the application server dependency groupId junit /groupId artifactId junit /artifactId version 4.4 /version scope test /scope /dependency JUnit 4.4 is only required to compile and execute the tests /dependencies

Dependency ScopeDifferent dependencies have different uses:The commons-logging dependency is a compile dependency:The project depends on this artifact for compilation, testing and runtimeThe geronimo-jms 1.1 spec dependency is a provided dependency:The project needs this artifact for compilation and testing; at deployment runtimethe container will supply itThe junit dependency is a test dependency is a test dependency:This projects needs this artifact for testCompile and test phasesWhy scoping?Scoping helps to define the various classpaths for different phasesScoping also affects the packaging phaseWhether a dependency is included in the artifact package

Dependency ScopeDependency scopesDependencies can have different scopes:compileprovidedtestruntimesystem(imported)

Dependency ScopeCompile scopeThe default scopeAvailable in all classpathsBundled with the packaged applicationExamples: Hibernate, Spring, . dependencies . dependency groupId org.springframework /groupId artifactId spring /artifactId version 2.5.3 /version /dependency . /dependencies

Dependency ScopeProvided scopeSupplied by the JDK or a container at runtimeInclude in the compile and test classpathsDon't include it in the final packageExamples: Servlet API,. dependencies . dependency groupId javax.servlet /groupId artifactId servlet-api /artifactId version 2.4 /version scope provided /scope /dependency . /dependencies

Dependency ScopeTest scopeNot needed for normal use of the applicationIncluded in the test compilation and execution classpathsNot bundled with the packaged applicationExamples: JUnit, TestNG, . dependencies . dependency groupId junit /groupId artifactId junit /artifactId version 4.4 /version scope test /scope /dependency . /dependencies

Dependency ScopeRuntime scopeRequired to test and execute the applicationNot required for compilationBundled with the packaged applicationExamples: Oracle JDBC dependencies . dependency groupId oracle /groupId artifactId ojdbc14 /artifactId version /version scope runtime /scope /dependency . /dependencies

Dependency ScopeSystem scopeSimilar to the provided scopeProvide the artifact explicitly as a file pathRarely used (better to use the repositories) dependencies . dependency groupId CommonsLoging /groupId artifactId commons-logging /artifactId version 1.0 /version scope system /scope systemPath {basedir}/lib/commons-logging-1.0.jar /systemPath /dependency . /dependencies

Transitive DependenciesDependencies of a dependencyGolden Rule: “The dependency of my dependency is my dependency. (Mostly)”My Project POMMy project depends on activemq-coreactivemq-coreactivemq-core depends oncommons-loggingcommons-loggingSo my project depends on commons-logging

Transitive DependenciesTransitive DependenciesPOMs declare dependencies on other artifactsUsing Maven coordinates, Maven recursively adds the dependencies to thecurrent projectMaven builds graphs of dependencies and handles any conflictsthat may occurAlways favors a more recent version of any artifact when selecting from arange

DemoVisualizing Dependencies in EclipseDependency HierarchyDependency Graph

Visualizing DependenciesFrom the command lineList your dependenciesmvn dependency:list mvn dependency:list[INFO] Scanning for projects.[INFO] Searching repository for plugin with prefix: 'dependency'.[INFO] ---------------------[INFO] Building babble-core[INFO]task-segment: [dependency:list][INFO] ---------------------[INFO] [dependency:list][INFO]Displays a list of resolved[INFO] The following files have been -attrs:jar:1.5.3:compile[INFO]cglib:cglib:jar:2.1 O][INFO] ---------------------[INFO] BUILD SUCCESSFUL[INFO] ----------------------

Visualizing DependenciesFrom the command lineView your dependenciesmvn dependency:tree mvn dependency:tree[INFO] Scanning for projects.[INFO] Searching repository for plugin with prefix: 'dependency'.[INFO] ---------------------[INFO] Building babble-core[INFO]task-segment: [dependency:tree][INFO] ---------------------[INFO] [dependency:tree][INFO] Displays a tree-structure[INFO] - dependencies[INFO] - net.sf.ehcache:ehcache:jar:1.2:compile[INFO] - javax.transaction:jta:jar:1.0.1B:compile[INFO] - INFO] - asm:asm-attrs:jar:1.5.3:compile[INFO] - dom4j:dom4j:jar:1.6.1:compile[INFO] - antlr:antlr:jar:2.7.6:compile[INFO] - cglib:cglib:jar:2.1 3:compile[INFO] - asm:asm:jar:1.5.3:compile[INFO] \- compile[INFO] - ompile[INFO] \- INFO] - junit:junit:jar:4.5:test[INFO] \- org.hamcrest:hamcrest-all:jar:1.1:compile[INFO] ---------------------[INFO] BUILD SUCCESSFUL[INFO] ----------------------of

Visualizing DependenciesFrom the command lineOptimize your dependenciesFind unused dependenciesDeclare important dependencies more preciselymvn dependency:analyze mvn dependency:analyze[INFO] Scanning for projects.[INFO] Searching repository for plugin with prefix: 'dependency'.[INFO] ---------------------[INFO] Building babble-core[INFO]task-segment: [dependency:analyze]JPA annotations are used[INFO] ---------------------but not directly declared[INFO] Preparing dependency:analyze.[INFO] [dependency:analyze][WARNING] Used undeclared dependencies ar:1.0:compile[WARNING] Unused declared dependencies[INFO] ---------------------[INFO] BUILD SUCCESSFUL[INFO] ---------------------[INFO] Total time: 4 secondsHibernate libraries are[INFO] Finished at: Mon Mar 30 14:19:04 NZDT 2009[INFO] Final Memory: 13M/26Mdeclared but not used[INFO] ----------------------

Dependency ConflictsDependency ConflictsDifferent libraries require diversion versions of the same dependencyBy default:The nearest dependency to the top winsThe first dependency declared at a given level winsSometimes, we need to override the default behavior

Dependency ConflictsDependency ConflictsYou can visualize conflicts in the Dependency Hierarchy viewSpring wants commons-logging 1.1.1Application uses commons-logging 1.1

Dependency ConflictsDependency ConflictsOr in the Dependency GraphDependency conflict

Dependency ConflictsDependency ConflictsA more complicated case:Multiple conflicts

Dependency ConflictsDependency Conflict quick fix:Declare the correct version in your POM fileOr exclude the unwanted version explicitly

Excluding Transitive DependenciesExcluding Dependencies lets youOverride normal transitive dependency managementExclude certain libraries that would normally be transitively included dependencies dependency groupId org.springframework /groupId artifactId spring /artifactId Exclude the javax.jms dependency version 2.5.5 /version exclusions exclusion groupId javax.jms /groupId artifactId jms artifactId /exclusion /exclusions /dependency dependency groupId org.apache.geronimo.specs /groupId artifactId geronimo-jms 1.1 spec /artifact version 1.1 /version /dependency Use the Apache Geronimo JMS specs instead dependencies

Grouping DependenciesPossibility to group dependencies togetherlogically grouped dependenciesdefine in a separate POM projectdeclare a dependency on this POM artifact

Grouping DependenciesDefine logically grouped dependencies together project groupId se.devoteam.maven.jfokus /groupId artifactId persistence-deps /artifactId version 1.0 /version packaging pom /packaging dependencies dependency groupId org.hibernate /groupId project artifactId hibernate /artifactId description Project requiring JDBC /description version /version . /dependency dependencies dependency . groupId org.hibernate /groupId dependency artifactId hibernate-annotations /artifactId groupId se.devoteam.maven.jfokus /groupId version /version artifactId persistence-deps /artifactId /dependency version 1.0 /version dependency type pom /type groupId org.springframework /groupId /dependency artifactId spring-hibernate3 /artifactId /dependencies version 2.0.6 /version /project /dependency dependency groupId mysql /groupId artifactId mysql-connector-java /artifactId version 5.1 /version /dependency /dependencies /project

Grouping DependenciesKind of a hackThe drawback:The dependencies are pushed down one levelCould affect conflict resolutionmvn dependency:analyze will not work

Inherited BehaviorInheriting common dependenciesShared dependencies can be placed in the parent pom.xmlMore consistent dependenciesReduced repetitionEasier to maintain project. . dependencies dependency groupId junit /groupId artifactId junit /artifactId version 4.5 /version scope test /scope /dependency dependency groupId log4j /groupId artifactId log4j /artifactId version 1.2.15 /version /dependency /dependencies . /project These dependencies will beinherited by child projects

Inherited BehaviorUsing DependencyManagement to inherit dependenciesUse dependencyManagement to centralizes version numbersDeclare the official version numbers in a parent POM fileOnly declare the artifacts in the child projectsOnly declare the artifact here project modelVersion 4.0.0 /modelVersion groupId org.sonatype.mavenbook /groupId project artifactId a-parent /artifactId modelVersion 4.0.0 /modelVersion version 1.0.0 /version parent . groupId org.sonatype.mavenbook /groupId dependencyManagement artifactId a-parent /artifactId dependencies version 1.0.0 /version dependency /parent groupId mysql /groupId artifactId project-a /artifactId artifactId mysql-connector-java /artifactId . version 5.1.2 /version dependencies /dependency dependency . groupId mysql /groupId dependencies artifactId mysql-connector-java /artifactId /dependencyManagement Official version number /dependency /dependencies /project

Inherited BehaviorUsing DependencyManagement to inherit dependenciesThe dependencyManagement section lists dependency version numbersIt does not add any dependencies to the projectThis project only needs JUnit project modelVersion 4.0.0 /modelVersion Official version numbers for groupId org.sonatype.mavenbook /groupId JUnit and HamcrestIt will depend on JUnit 4.5 artifactId a-parent /artifactId version 1.0.0 /version To be used if these. dependencyManagement libraries are required by project It will not have a dependencies modelVersion 4.0.0 /modelVersion child projectshamcrest dependency dependency parent groupId junit /groupId groupId org.sonatype.mavenbook /groupId artifactId junit /artifactId artifactId a-parent /artifactId version 4.5 /version version 1.0.0 /version scope test /scope /parent /dependency artifactId project-a /artifactId dependency . groupId org.hamcrest /groupId dependencies artifactId hamcrest-all /artifactId dependency version 1.1 /version groupId junit /groupId /dependency artifactId junit /artifactId /dependency . /dependencies dependencies /project /dependencyManagement

Overriding Transitive DependenciesDependencyManagement with Transitive Dependencies dependencyManagement also applies to Transitive DependenciesThis can be used to override versions of dependencies you don’t directly depend on.For example, if a specific version of a logger conflicts with your application server orhas a known bug.

Overriding Transitive DependenciesDependencyManagement with Transitive DependenciesDependency conflict in atransitive dependency dependencyManagement dependencies dependency groupId commons-logging /groupId artifactId commons-logging /artifactId version 1.1.1 /version /dependency /dependencies /dependencyManagement Declare the version we want in theDependencyManagement sectionResolved conflict

DemoDependency Management

Dependency ScopeImport scopeOnly works with Maven 2.0.9 onwardsImport dependencies in the dependencyManagement sectionof another projectLets you import dependencyManagement info from severalsourcesOnly used by project type pom (e.g. parent projects) project project modelVersion 4.0.0 /modelVersion modelVersion 4.0.0 /modelVersion groupId se.devoteam.maven.jfokus /groupId groupId se.devoteam.maven.jfokus /groupId artifactId a-parent /artifactId artifactId b-parent /artifactId version 1.0 /version version 1.0 /version . dependencyManagement dependencyManagement dependencies dependencies dependency dependency groupId mysql /groupId groupId se.devoteam.maven.jfokus /groupId artifactId mysql-connector-java /artifactId artifactId a-parent /artifactId version 5.1.2 /version version 1.0 /version /dependency type pom /type . scope import /scope dependencies /dependency /dependencyManagement . dependencies /dependencyManagement

Enforce Correct DependenciesThrough a Maven Repository Managerenforce dependencies centrallyMaven Enforcer Plugincontrol through rules in the build bannedDependencies

Advanced Maven TechniquesAdapting the build processPart 2 - Lifecycle Customization

A Standardized LifecycleMaven provides standardized lifecycles for projectsReduced learning curve between projectsAllows for standardized, repeatable builds across projectsCustomized through choices in POMs

A Standardized LifecycleProvides for many typical development steps:Preparing source code for compilationCompiling codeRunning unit testsPackaging applicationsRunning integration testsDeploying to local and remote repositories

The Maven LifecycleMaven provides the following lifecycles:default lifecycle - project deploymentclean lifecycle - project cleaningsite lifecycle - project site creation

A Standardized LifecycleThe standard Maven lifecycle (an extract)Prepare resource filesprocess-resourcesCompile application source codecompileCompile test classestest-compileRun unit teststestCreate a distributable formatpackageRun integration testsintegration-testinstallDeploy to local repositoryDeploy to remote repositorydeploy

A Standardized LifecycleYou can invoke lifecycle phases directly.process-resources mvn compilecompiletest-compile mvn testtestpackage mvn packageintegration-testinstalldeploy mvn install mvn deploy

A Standardized Life CycleInvoking a lifecycle phase will also invoke the previous phasesprocess-resourcesprocess-resources mvn compilecompiletest-compile mvn testtestpackage mvn packageintegration-testinstalldeploy mvn install mvn deploy

Maven Plugins and GoalsEach lifecycle phase is implemented using ploy:deploy

Maven Plugins and GoalsYou can invoke a plugin in two ways:Invoking a lifecycle phase mvn compileInvoke the compile lifecycle phaseInvoking a plugin goal directly mvn jar:test-jarInvoke the test-jar goal of the jar plugin

Customizing the lifecycleThe standard Maven lifecycleprocess-resourcesAn ordered sequenceof events used to builda projectEach phase is composed ofzero or more t-compileComposed of stepsknown as “phases”compiler:testCompiletestEach phase isbound to a particularplugin goalsurefire:testpackageEach phase handles a differenttask in the sequenceGoals areimplemented ire:integration-testinstall:installdeploy:deploy

Package-Specific Lifecycle BindingsThere are specific lifecycle bindings for the following packagetypes:EAREJBJARMaven PluginPOMWAR

Package-Specific Lifecycle BindingsThe POM Lifecycle bindingsA project with packaging ear has a different set of default goals from aproject with a packaging of jar or warLifecycle rinstall:installdeploy:deploy

Package-Specific Lifecycle BindingsThe JAR Lifecycle bindingsA project with packaging jar has a different set of default goals from aproject with a packaging of war or earLifecycle lecompiler:compileprocess-test-resources :installdeploydeploy:deploy

Package-Specific Lifecycle BindingsThe WAR Lifecycle bindingsA project with packaging war has a different set of default goals from aproject with a packaging of jar or earLifecycle lecompiler:compileprocess-test-resources :installdeploydeploy:deploy

Package-Specific Lifecycle BindingsThe EAR Lifecycle bindingsA project with packaging ear has a different set of default goals from aproject with a packaging of jar or warLifecycle s:resourcesear:earinstall:installdeploy:deploy

Package-Specific Lifecycle BindingsPossible to create custom packaging typesDefine your own specific lifecycle bindings project modelVersion 4.0.0 /modelVersion groupId se.devoteam.maven.jfokus /groupId artifactId demo-sar /artifactId version 1.0-SNAPSHOT /version packaging jboss-sar /packaging . build plugins plugin groupId org.codehaus.mojo /groupId artifactId jboss-packaging-maven-plugin /artifactId version 2.1.1 /version !-- Enable packaging types and lifecycle bindings. -- extensions true /extensions /plugin . /plugins This configuration enables the /build custom package type project

Customizing the lifecycleYou can customize the lifecycle in two waysConfigure the standard plugin associated with a phaseAdd a new plugin to add extra behavior to a phasecompilecompiler:compilegmaven:compFine-tune or override the existingplugin configuration(e.g. compiling Java 5 code)ileAdd new behavior to a phase(e.g. compiling Groovy classes)

Customizing the lifecycleCustomizing an existing configuration - compiling Java 5 codeJava compilation is done by the maven-compiler-pluginThis plugin is configurable:Compiles sources for projectsSupports multiple compilersSupports compiler optionsSupport pinning the compiler to a particular source and target version

Customizing the lifecycleAn example of customization - compiling for Java 5 project . build pluginManagement plugins plugin groupId org.apache.maven.plugins /groupId artifactId maven-compiler-plugin /artifactId Plugin configuration always goes in configuration the configuration block source 1.5 /source target 1.5 /target /configuration /plugin Here, compile for Java 5 code /plugins pluginManagement /build . /project

Customizing the lifecycleAdding new behavior - executing a Groovy scriptMaven and Groovy integrate well with the gmaven-plugin pluginIn this example we want to execute a Groovy script during the compilephase:Add the gmaven-plugin plugin groupId org.codehaus.groovy /groupId artifactId gmaven-plugin /artifactId executions During the compile phase. execution phase compile /phase goals Call the plugin’s execute goal goal execute /goal /goals configuration source {pom.basedir}/src/main/script/myscript.groovy /source /configuration /execution Plugin-specific configuration /executions /plugin

DemoLifecycle customization

Advanced Maven TechniquesControlling the pluginsPart 3 - Plugin Management

Binding InheritancePlugin bindings are inheritedsimilar to how dependencies workconvention - it is configurable plugin groupId org.codehaus.groovy /groupId artifactId gmaven-plugin /artifactId version 1.2 /version inherited false /inherited executions execution This plugin binding is not phase compile /phase inherited goals goal execute /goal /goals configuration . /configuration /execution /executions /plugin

Binding InheritancePlugin binding inheritance is configurableWhere the binding is declaredNot where inherited (i.e. the child)

DemoPlugin binding inheritance

Plugin ManagementOptimizing plugin dependenciesSimilar to the dependencyManagement sectionIt does not add any new plugins to the projectParent POM build pluginManagement plugins plugin Applies for any child groupId org.easyb /groupId project using this plugin artifactId maven-easyb-plugin /artifactId version 0.9.6 /version configuration storyType html /storyType storyReport target/easyb/easyb.html /storyReport /configuration executions execution goals goal test /goal /goals Child POM /execution build /executions plugins /plugin plugin /plugins groupId org.easyb /groupId /pluginManagement artifactId maven-easyb-plugin /artifactId /build Inherits plugin configuration /plugin from the parent.

Plugin ManagementOptimizing plugin dependenciesLifecycle-related plugins apply to all child projectsParent POM pluginManagement plugins plugin groupId org.apache.maven.plugins /groupId artifactId maven-compiler-plugin /artifactId version 2.1 /version configuration This is a lifecycle plugin source 1.5 /source target 1.5 /target /configuration /plugin /plugins Applies for all child projects /pluginManagement

DemoPlugin Management

Plugin ConfigurationPlugin configuration possible on two levelsplugin levelexecution level plugin groupId . /groupId artifactId . /artifactId version . /version configuration !-- Plugin level config -- !-- This configuration applies to all executions -- /configuration executions execution goals goal . /goal /goals configuration !-- Execution level config -- !-- Configuration specific to this execution -- /configuration /execution /executions /plugin

DemoPlugin configuration

Tutorial based on Maven training material Courtesy by Sonatype. Maven @ Jfokus 2010 Next Generation Development Infrastructure: Maven, M2Eclipse, Nexus & Hudson by Jason van Zyl 14.15-15.00, Jan 27 Also come visit Sonatype’s booth! Advanced Maven Techniques Maven in your IDE

Related Documents:

Hands-on Maven 2 -- working with multiple project builds Installing the Maven 2.x Plug-in for Eclipse 3.2 Working with the Maven 2.x Plug-in for Eclipse 3.2 As you complete this tutorial, you will gain an appreciation and understanding of the philosophy behind the design of Maven

Yaml / groovy G r a d l e 2007. Authors, Company, Community Jason Van Zyl Worked on Turbine Author of - Velocity - Maven founder of Sonatype . Logo comes from maven (maven-site-plugin ) Then you recognise pom infos. Basic Declarations. Maven Core Concepts 2 : D

Mac apache-maven-3.3.3-bin.tar.gz Step 4: Extract the Maven archive Extract the archive, to the directory you wish to install Maven 3.3.3. The subdirectory apache-

Maven: The Complete Reference iii 2.3.1 Installing Maven on Linux, BSD or Mac OSX. . . . . . . . . . . . . . . . . . .12 2.3.2 Installing Maven on Microsoft Windows .File Size: 2MBPage Count: 339

Maven extends Ant to let you download dependencies Maven is a set of reusable Ant scriptlets . Maven is able to generate a web site or PDF including any documentation you care to add, and adds to that standard reports about the state of development of the project. Examples of this information can

Maven core components and plugins. Today, the work is on non-XML files to ease encoding configuration of every plugin. When working on m2eclipse, Hervé’s intent is to improve the user experience when learning Maven (Maven Ant Tasks is the first migration step I worked on) and to fix Maven i

libJCudaRuntime apple x86_64.dylib. The profile is automatically detected by maven, so that windows architectures download windows appropriate natives etc. We use a maven plugin (maven natives) to unpack these native dependencies and copy them inside the final executable.

CBSE Sample Paper Class 11 Maths Set 2 Solution. 1 cos2 1 cos4 1 2 2 x x cos2x cos4x 0 2 cos3x cos x 0 Cos3x 0 6 3 0 2 6 3 x n Cosx x k n n is integer π π π π π π 8. Solution: 30 40 60 4 7 2 4 10 4 15 4 ( ) . ( ) ( ) 1 1 1 1 1 i i i i i i i i 9. Solution: Substituting the points (0, 0) and (5, 5) on the given line x y – 8 0 0 .