This week's book giveaway is in the Java in General forum.
We're giving away four copies of Event Streams in Action and have Alexander Dean & Valentin Crettaz on-line!
See this thread for details.
Win a copy of Event Streams in Action this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

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

 
Greenhorn
Posts: 7
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
author & internet detective
Posts: 39396
763
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That is strange. I gave you a cow for sharing it along with the solution.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!