plugins - How to enable java 7 in maven of Apache Storm 0.9.3 -
i'm using apache storm 0.9.3 in ubuntu 14.04 lts. encounter maven compiler in apache storm 0.9.3 keep on using java 6 although had installed java 7.
the java version in ubuntu:
java version "1.7.0_80" java(tm) se runtime environment (build 1.7.0_80-b15) java hotspot(tm) client vm (build 24.80-b11, mixed mode)
the maven version in ubuntu:
apache maven 3.0.5 maven home: /usr/share/maven java version: 1.7.0_80, vendor: oracle corporation java home: /usr/lib/jvm/java-7-oracle/jre default locale: en_us, platform encoding: utf-8 os name: "linux", version: "3.13.0-52-generic", arch: "i386", family: "unix"
below error encounter:
[info] scanning projects... [warning] [warning] problems encountered while building effective model org.apache.storm:storm-starter:jar:0.9.3 [warning] 'reporting.plugins.plugin.version' org.apache.maven.plugins:maven-javadoc-plugin missing. @ org.apache.storm:storm:0.9.3, /home/user/.m2/repository/org/apache/storm/storm/0.9.3/storm-0.9.3.pom, line 694, column 21 [warning] 'reporting.plugins.plugin.version' org.apache.maven.plugins:maven-surefire-report-plugin missing. @ org.apache.storm:storm:0.9.3, /home/user/.m2/repository/org/apache/storm/storm/0.9.3/storm-0.9.3.pom, line 660, column 21 [warning] [warning] highly recommended fix these problems because threaten stability of build. [warning] [warning] reason, future maven versions might no longer support building such malformed projects. [warning] [info] [info] ------------------------------------------------------------------------ [info] building storm-starter 0.9.3 [info] ------------------------------------------------------------------------ [info] [info] --- maven-remote-resources-plugin:1.2.1:process (default) @ storm-starter --- [info] [info] --- maven-resources-plugin:2.5:resources (default-resources) @ storm-starter --- [debug] execute contextualize [info] using 'utf-8' encoding copy filtered resources. [info] copying 8 resources [info] copying 3 resources [info] [info] --- maven-compiler-plugin:3.1:compile (default-compile) @ storm-starter --- [info] changes detected - recompiling module! [info] compiling 48 source files /home/user/storm/examples/storm-starter/target/classes [info] ------------------------------------------------------------- [error] compilation error : [info] ------------------------------------------------------------- [error] /home/user/storm/examples/storm-starter/src/jvm/storm/starter/bolt/pnmstd.java:[79,19] strings in switch not supported in -source 1.6 (use -source 7 or higher enable strings in switch) [info] 1 error [info] ------------------------------------------------------------- [info] ------------------------------------------------------------------------ [info] build failure [info] ------------------------------------------------------------------------ [info] total time: 17.856s [info] finished at: sun may 31 06:55:27 myt 2015 [info] final memory: 18m/51m [info] ------------------------------------------------------------------------ [error] failed execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project storm-starter: compilation failure [error] /home/user/storm/examples/storm-starter/src/jvm/storm/starter/bolt/pnmstd.java:[79,19] strings in switch not supported in -source 1.6 [error] (use -source 7 or higher enable strings in switch) [error] -> [help 1] [error] [error] see full stack trace of errors, re-run maven -e switch. [error] re-run maven using -x switch enable full debug logging. [error] [error] more information errors , possible solutions, please read following articles: [error] [help 1] http://cwiki.apache.org/confluence/display/maven/mojofailureexception
below part of /home/user/.m2/repository/org/apache/storm/storm/0.9.3/storm-0.9.3.pom related maven:
<project xmlns="http://maven.apache.org/pom/4.0.0" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://maven.apache.org/pom/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelversion>4.0.0</modelversion> <prerequisites> <maven>3.0.0</maven> </prerequisites> <modules> <module>storm-buildtools/maven-shade-clojure-transformer</module> <module>storm-core</module> <module>examples/storm-starter</module> <module>external/storm-kafka</module> <module>external/storm-hdfs</module> <module>external/storm-hbase</module> </modules> <profiles> <profile> <id>sign</id> <build> <plugins> <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-gpg-plugin</artifactid> <executions> <execution> <id>sign-artifacts</id> <phase>verify</phase> <goals> <goal>sign</goal> </goals> </execution> </executions> </plugin> </plugins> </build> </profile> <profile> <id>dist</id> <modules> <module>storm-dist/binary</module> <module>storm-dist/source</module> </modules> <build> <plugins> <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-source-plugin</artifactid> <executions> <execution> <id>attach-sources</id> <goals> <goal>jar</goal> </goals> </execution> </executions> </plugin> <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-javadoc-plugin</artifactid> <executions> <execution> <id>attach-javadocs</id> <goals> <goal>jar</goal> </goals> </execution> </executions> </plugin> <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-jar-plugin</artifactid> <configuration> <archive> <manifest> <adddefaultimplementationentries>true</adddefaultimplementationentries> <adddefaultspecificationentries>true</adddefaultspecificationentries> </manifest> </archive> </configuration> </plugin> </plugins> </build> </profile> </profiles> <distributionmanagement> <site> <id>storm.maven.website</id> <name>storm website</name> <url>file:///tmp/site</url> </site> </distributionmanagement> <repositories> <repository> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>false</enabled> </snapshots> <id>central</id> <url>http://repo1.maven.org/maven2/</url> </repository> <repository> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>true</enabled> </snapshots> <id>clojars</id> <url>https://clojars.org/repo/</url> </repository> </repositories> <pluginmanagement> <plugins> <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-assembly-plugin</artifactid> <version>2.2.2</version> </plugin> <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-install-plugin</artifactid> <version>2.4</version> </plugin> <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-compiler-plugin</artifactid> <version>3.1</version> </plugin> <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-source-plugin</artifactid> <version>2.2.1</version> </plugin> <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-javadoc-plugin</artifactid> <version>2.9</version> </plugin> <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-jar-plugin</artifactid> <version>2.4</version> </plugin> <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-release-plugin</artifactid> <version>2.5</version> </plugin> <plugin> <groupid>com.theoryinpractise</groupid> <artifactid>clojure-maven-plugin</artifactid> <version>1.3.18</version> <extensions>true</extensions> </plugin> <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-surefire-report-plugin</artifactid> <version>2.16</version> </plugin> <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-gpg-plugin</artifactid> <version>1.4</version> </plugin> <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-shade-plugin</artifactid> <version>2.2</version> </plugin> <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-project-info-reports-plugin</artifactid> <version>2.7</version> </plugin> <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-site-plugin</artifactid> <version>3.3</version> </plugin> </plugins> </pluginmanagement> <plugins> <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-compiler-plugin</artifactid> <configuration> <source>1.6</source> <target>1.6</target> </configuration> </plugin> <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-release-plugin</artifactid> <configuration> <autoversionsubmodules>true</autoversionsubmodules> <tagnameformat>v@{project.version}</tagnameformat> </configuration> </plugin> <plugin> <groupid>com.theoryinpractise</groupid> <artifactid>clojure-maven-plugin</artifactid> <extensions>true</extensions> </plugin> </plugins> </build> <reporting> <plugins> <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-checkstyle-plugin</artifactid> <version>2.11</version> <reportsets> <reportset> <reports> <report>checkstyle</report> </reports> </reportset> </reportsets> </plugin> <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-pmd-plugin</artifactid> <version>3.0.1</version> </plugin> <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-javadoc-plugin</artifactid> </plugin> <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-surefire-report-plugin</artifactid> <configuration> <reportsdirectories> <file>${project.build.directory}/test-reports</file> <file>${project.build.directory}/surefire-reports</file> </reportsdirectories> </configuration> </plugin> <plugin> <groupid>org.codehaus.mojo</groupid> <artifactid>taglist-maven-plugin</artifactid> <version>2.4</version> <configuration> <taglistoptions> <tagclasses> <tagclass> <displayname>todo work</displayname> <tags> <tag> <matchstring>todo</matchstring> <matchtype>exact</matchtype> </tag> <tag> <matchstring>fixme</matchstring> <matchtype>exact</matchtype> </tag> </tags> </tagclass> </tagclasses> </taglistoptions> </configuration> </plugin> <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-javadoc-plugin</artifactid> </plugin> <plugin> <groupid>org.apache.rat</groupid> <artifactid>apache-rat-plugin</artifactid> <version>0.11</version> <configuration> <excludesubprojects>false</excludesubprojects> <excludes> <!-- exclude maven artifacts --> <exclude>**/target/**</exclude> <!-- exclude intellij projects --> <exclude>**/*.iml</exclude> <!-- exclude changelog, version, , todo files --> <exclude>**/changelog.md</exclude> <exclude>**/readme.md</exclude> <exclude>**/readme.markdown</exclude> <exclude>**/developer.md</exclude> <exclude>**/bylaws.md</exclude> <exclude>**/storm-ui-rest-api.md</exclude> <exclude>security.md</exclude> <exclude>version</exclude> <exclude>todo</exclude> <!-- thrift-generated code --> <exclude>**/src/py/**</exclude> <!-- following in license file --> <exclude>**/src/ui/public/js/jquery-1.6.2.min.js</exclude> <exclude>**/src/ui/public/js/jquery.cookies.2.2.0.min.js</exclude> <exclude>**/src/ui/public/js/jquery.tablesorter.min.js</exclude> <exclude>**/src/ui/public/js/moment.min.js</exclude> <exclude>**/src/ui/public/js/jquery.blockui.min.js</exclude> <exclude>**/src/ui/public/js/url.min.js</exclude> <exclude>**/src/ui/public/js/arbor.js</exclude> <exclude>**/src/ui/public/js/arbor-graphics.js</exclude> <exclude>**/src/ui/public/js/arbor-tween.js</exclude> <exclude>**/src/ui/public/js/jquery.mustache.js</exclude> <exclude>**/src/ui/public/js/purl.js</exclude> <!-- generated shade plugin --> <exclude>**/dependency-reduced-pom.xml</exclude> </excludes> </configuration> </plugin> </plugins> </reporting>
firstly must have installed java 7.
as indicated in
[warning] 'reporting.plugins.plugin.version' org.apache.maven.plugins:maven-javadoc-plugin missing. @ org.apache.storm:storm:0.9.3, /home/user/.m2/repository/org/apache/storm/storm/0.9.3/storm-0.9.3.pom, line 694, column 21 [warning] 'reporting.plugins.plugin.version' org.apache.maven.plugins:maven-surefire-report-plugin missing. @ org.apache.storm:storm:0.9.3, /home/user/.m2/repository/org/apache/storm/storm/0.9.3/storm-0.9.3.pom, line 660, column 21
go home directory , cd /.m2/repository/org/apache/storm/storm/0.9.3/ nano or vi storm-0.9.3.pom.
search
<plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-compiler-plugin</artifactid> <configuration> <source>1.6</source> <target>1.6</target> </configuration> </plugin>
modified 1.6 1.7 if intend use java-7-oracle. if you're using nano, can search using ctrl+w <source>1.6</source>
Comments
Post a Comment