aspose file tools*
The moose likes Ant, Maven and Other Build Tools and the fly likes Maven install issue - parameterized types are only available if source level is 5.0 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Maven install issue - parameterized types are only available if source level is 5.0" Watch "Maven install issue - parameterized types are only available if source level is 5.0" New topic
Author

Maven install issue - parameterized types are only available if source level is 5.0

Yogesh R Kapare
Greenhorn

Joined: Oct 23, 2012
Posts: 7
    
    1
Hello Team,

I am facing a typical issue, I have one java project, one web project and an ear proect which I try to build through maven.

When I run MAVEN command 'mvn clean install'.The build fails with an error :

'parameterized types are only available if source level is 5.0 arguments <String, SomeXXXXBean> parameterized types are only available if source level is 5.0'.

To resolve this problem I made the following entry to the POM

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

</plugin>

Still I kept on getting the same error.

When I ran the command 'mvn clean install' and again 'mvn install', the project was able to build properly but, I wanted a clean reason to understand this weird behaviour i.e I had to run the command 'mvn install' again after 'mvn clean install'.

I then realized that there was some problem with the source folder configurations so , I made the following configuration to the POM :

<sourceDirectory>../src/main/java</sourceDirectory>.

After making this change the command 'mvn clean install' started woring like a charm.

Please note : I am documenting this only for information purpose (As,it does not look like question) though, anyone who has any idea to this strange behaviour may try to improve this post.

Thanks & regards,

Yogesh R Kapare
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30764
    
156

That is strange. I gave you a cow for sharing it along with the solution.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
wood burning stoves
 
subject: Maven install issue - parameterized types are only available if source level is 5.0