Skip to content
This repository has been archived by the owner on Oct 29, 2020. It is now read-only.

No Maven maven-compiler-plugin source/target version specified #8

Open
faal opened this issue Dec 25, 2012 · 1 comment
Open

No Maven maven-compiler-plugin source/target version specified #8

faal opened this issue Dec 25, 2012 · 1 comment

Comments

@faal
Copy link

faal commented Dec 25, 2012

When compiling hdfs-du/pig I got an error:

[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Compilation failure

/var/home/fabian/hdfs-du/pig/src/main/java/com/twitter/hdfsdu/pig/piggybank/ExtractSizes.java:[29,42] generics are not supported in -source 1.3
(use -source 5 or higher to enable generics)
public class ExtractSizes extends EvalFunc {

/var/home/fabian/hdfs-du/pig/src/main/java/com/twitter/hdfsdu/pig/piggybank/ExtractSizes.java:[34,29] ';' expected

/var/home/fabian/hdfs-du/pig/src/main/java/com/twitter/hdfsdu/pig/piggybank/ExtractSizes.java:[35,2] not a statement

/var/home/fabian/hdfs-du/pig/src/main/java/com/twitter/hdfsdu/pig/piggybank/ExtractSizes.java:[35,13] ';' expected

I resolved the problem by adding:

  •  <plugin>
    
  •    <artifactId>maven-compiler-plugin</artifactId>
    
  •    <version>2.3.2</version>
    
  •    <configuration>
    
  •      <source>1.6</source>
    
  •      <target>1.6</target>
    
  •      <compilerArgument></compilerArgument>
    
  •    </configuration>
    
  •  </plugin>
    

in pom.xml

@alexanderfahlke
Copy link

Just add the following lines in the plugins section in the pom.xml files

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>2.0.2</version>
        <configuration>
          <source>1.6</source>
          <target>1.6</target>
        </configuration>
      </plugin>

The alternative is to set Java 1.6+ as the default for maven. This can be done by editing ~/.m2/settings.xml.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants