Hi, The ! at the beginning of the hadoop.profile property in hadoop-1.0 profile indicates that if the hadoop.profile property is not specified or absent, then the profile will be activated. So if you didn't specify it as a system property (e.g. -Dhadoop.profile=XXXX), it would be used by default.
Given what I explained above, for your second question, you need to specify -Dhadoop.profile=2 and just omit -Phadoop-2 to activate the hadoop-2 profile in your build. Thanks, Deng On Thu, Jul 31, 2014 at 7:29 PM, 李响 <[email protected]> wrote: > Dear maven user and developers, > > Attached is pom.xml of Flume. I have some questions as follow, really > appreciate your help or guide, thanks !! > > 1. Why profile id = hadoop-1.0 is the default profile ? > If not specifying -Pxxxxx for mvn command, I found hadoop-1.0 is the > default one to use. why is it the default one ? is it > because <name>!hadoop.profile</name> is specified in its activation and > hadoop.profile is not specified in properties ? Seems not... I tried with > adding <hadoop.profile>2</hadoop.profile> into properties, but hadoop-1.0 > is still used. This can be proven by the version of dependencies downloaded > into .m2 repository > > 2. hadoop-test-xxxx is needed for profile id = hadoop-2 ? > when I issued "mvn xxxx -Phadoop-2", the following errors came out: > > [ERROR] Failed to execute goal > org.apache.maven.plugins:maven-remote-resources-plugin:1.1:process > (default) on project flume-hdfs-sink: Failed to resolve dependencies for > one or more projects in the reactor. Reason: Missing: > [ERROR] ---------- > [ERROR] 1) org.apache.hadoop:hadoop-test:jar:2.4.0 > [ERROR] > [ERROR] Try downloading the file manually from the project website. > [ERROR] > [ERROR] Then, install it using the command: > [ERROR] mvn install:install-file -DgroupId=org.apache.hadoop > -DartifactId=hadoop-test -Dversion=2.4.0 -Dpackaging=jar > -Dfile=/path/to/file > [ERROR] > [ERROR] Alternatively, if you host your own repository you can deploy the > file there: > [ERROR] mvn deploy:deploy-file -DgroupId=org.apache.hadoop > -DartifactId=hadoop-test -Dversion=2.4.0 -Dpackaging=jar > -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id] > [ERROR] > [ERROR] Path to dependency: > [ERROR] 1) org.apache.flume.flume-ng-sinks:flume-hdfs-sink:jar:1.5.0.1 > [ERROR] 2) org.apache.hadoop:hadoop-test:jar:2.4.0 > [ERROR] > [ERROR] ---------- > [ERROR] 1 required artifact is missing. > [ERROR] > [ERROR] for artifact: > [ERROR] org.apache.flume.flume-ng-sinks:flume-hdfs-sink:jar:1.5.0.1 > [ERROR] > [ERROR] from the specified remote repositories: > [ERROR] repo1.maven.org (http://repo1.maven.org/maven2, releases=true, > snapshots=false), > [ERROR] repository.jboss.org ( > http://repository.jboss.org/nexus/content/groups/public/, releases=true, > snapshots=false), > [ERROR] apache.snapshots (http://repository.apache.org/snapshots, > releases=false, snapshots=true), > [ERROR] central (http://repo.maven.apache.org/maven2, releases=true, > snapshots=false) > [ERROR] -> [Help 1] > [ERROR] > [ERROR] To see the full stack trace of the errors, re-run Maven with the > -e switch. > [ERROR] Re-run Maven using the -X switch to enable full debug logging. > [ERROR] > [ERROR] For more information about the errors and possible solutions, > please read the following articles: > [ERROR] [Help 1] > http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException > > I just wonder and be confused why org.apache.hadoop:hadoop-test:jar:2.4.0 > is requested. Because the following statements only appear in profile id = > hadoop-1.0 > <dependency> > <groupId>org.apache.hadoop</groupId> > <artifactId>hadoop-test</artifactId> > <version>${hadoop.version}</version> > </dependency> > > The pom.xml for flume-hdfs-sink is also attached as pom-1.xml. Thanks ! > > -- > > 李响 > > 手机 cellphone :+86-1368-113-8972 > E-mail :[email protected] > MSN :[email protected] > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > -- Maria Odea "Deng" Ching-Mallete | [email protected] | http://www.linkedin.com/in/oching
