Bonjour,
Je suis nouvelle en scala. je souhait compiler un code qui mélange java et scala avec maven. Cependant j'obtiens une erreur que je n'arrive pas à résoudre. je précise que j'utilise java 1.7.
Voici mon pom.xml :
Et voici l'erreur que j'obtiens :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78 <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/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>scala</groupId> <artifactId>SparkUnada</artifactId> <version>0.0.1-SNAPSHOT</version> <name>${project.artifactId}</name> <repositories> <repository> <id>scala-tools.org</id> <name>Scala-tools Maven2 Repository</name> <url>http://scala-tools.org/repo-releases</url> </repository> <repository> <id>maven-hadoop</id> <name>Hadoop Releases</name> <url>https://repository.cloudera.com/content/repositories/releases/</url> </repository> <repository> <id>cloudera-repos</id> <name>Cloudera Repos</name> <url>https://repository.cloudera.com/artifactory/cloudera-repos/</url> </repository> </repositories <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> </properties> <build> <plugins> <plugin> <groupId>org.scala-tools</groupId> <artifactId>maven-scala-plugin</artifactId> <version>2.15.2</version> <executions> <execution> <id>scala-compile-first</id> <phase>process-resources</phase> <goals> <goal>add-source</goal> <goal>compile</goal> </goals> </execution> <execution> <id>scala-test-compile</id> <phase>process-test-resources</phase> <goals> <goal>testCompile</goal> </goals> </execution> </executions> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <executions> <execution> <phase>compile</phase> <goals> <goal>compile</goal> </goals> </execution> </executions> </plugin> </plugins> </build> <dependencies> <dependency> <groupId>org.scala-lang</groupId> <artifactId>scala-library</artifactId> <version>2.10.4</version> </dependency> <dependency> <groupId>org.apache.spark</groupId> <artifactId>spark-core_2.10</artifactId> <version>1.0.0-cdh5.1.0</version> </dependency> </dependencies> </project>
INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for scala:SparkUnada:jar:0.0.1-SNAPSHOT
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. @ line 74, column 12
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building SparkUnada 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ SparkUnada ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /home/jdromard/Documents/owncloud/workspace/SparkUnada/src/main/resources
[INFO]
[INFO] --- maven-scala-plugin:2.15.2:add-source (scala-compile-first) @ SparkUnada ---
[INFO] Add Source directory: /home/jdromard/Documents/owncloud/workspace/SparkUnada/src/main/scala
[INFO] Add Test Source directory: /home/jdromard/Documents/owncloud/workspace/SparkUnada/src/test/scala
[INFO]
[INFO] --- maven-scala-plugin:2.15.2:compile (scala-compile-first) @ SparkUnada ---
[INFO] Checking for multiple versions of scala
[WARNING] Expected all dependencies to require Scala version: 2.10.4
[WARNING] scala:SparkUnada:0.0.1-SNAPSHOT requires scala version: 2.10.4
[WARNING] com.twitter:chill_2.10:0.3.6 requires scala version: 2.10.3
[WARNING] Multiple versions of scala libraries detected!
[INFO] includes = [**/*.scala,**/*.java,]
[INFO] excludes = []
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ SparkUnada ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 11 source files to /home/jdromard/Documents/owncloud/workspace/SparkUnada/target/classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /home/jdromard/Documents/owncloud/workspace/SparkUnada/src/main/java/FeaturesProcessTSTAT/NetworkIPSourceTSTAT.java:[37,21] try-with-resources is not supported in -source 1.5
(use -source 7 or higher to enable try-with-resources)
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6.212 s
[INFO] Finished at: 2015-08-12T17:40:27+02:00
[INFO] Final Memory: 30M/687M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project SparkUnada: Compilation failure
[ERROR] /home/jdromard/Documents/owncloud/workspace/SparkUnada/src/main/java/FeaturesProcessTSTAT/NetworkIPSourceTSTAT.java:[37,21] try-with-resources is not supported in -source 1.5
[ERROR] (use -source 7 or higher to enable try-with-resources)
Merci d'avance
Ju
Partager