You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by John Wooten <wo...@gmail.com> on 2009/02/21 22:58:55 UTC

Can't get maven to compile with java 1.5

I have JAVA_HOME set to the java 1.5.1 and when I type echo $JAVA_HOME it
shows this.
I've put in a settings file settings.xml to set the jdk to 1.5 also.

It compiles and says it can't do generics using 1.3, to do a
/Users/woo/Development/workspaces/Qworkspace/Foundation/src/com/areteq/common/HashMapHandler.java:[11,26]
generics are not supported in -source 1.3
(try -source 1.5 to enable generics)
   public abstract HashMap<String, HashMapData> getHashMapData();

Where do I put this -source 1.5.  I've tried settings.xml, profiles, etc.

It would help if the error somehow mention where and how to set this.

RE: Can't get maven to compile with java 1.5

Posted by Jon Georg Berentsen <Jo...@Objectware.no>.
+1
BUT this link should give you some hints:
http://maven.apache.org/plugins/maven-checkstyle-plugin/plugin-info.html

AFTER you learn the basics ;)

Jon

-----Original Message-----
From: Wayne Fay [mailto:waynefay@gmail.com] 
Sent: 22. februar 2009 01:35
To: Maven Users List
Subject: Re: Can't get maven to compile with java 1.5

> Added that and here is pom.xml (inherited by Foundation/pom.xml)
snip
> Note it still says same thing.
>
> Is the configuration in the right place?

1. Don't send the full output like that to this list again. If you can
identify the relevant ~10 lines or so of the output, that's ok to send
here. Otherwise, paste the text at a site like pastebin.com and send a
link to it instead.
2. The same goes for posting full poms. Its ok to send snippets, but
full poms is too much.
3. You need to take the advice you've already been given by other
people about reading the free PDF ebooks provided by Sonatype and
exist. You have missed some basics related to versions that are
causing you problems now. Go back and learn the basics before
proceeding!

Hint: Things with a non-SNAPSHOT version should never, ever change, or
you will have big problems in Maven.

Wayne

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Can't get maven to compile with java 1.5

Posted by Wayne Fay <wa...@gmail.com>.
> Added that and here is pom.xml (inherited by Foundation/pom.xml)
snip
> Note it still says same thing.
>
> Is the configuration in the right place?

1. Don't send the full output like that to this list again. If you can
identify the relevant ~10 lines or so of the output, that's ok to send
here. Otherwise, paste the text at a site like pastebin.com and send a
link to it instead.
2. The same goes for posting full poms. Its ok to send snippets, but
full poms is too much.
3. You need to take the advice you've already been given by other
people about reading the free PDF ebooks provided by Sonatype and
exist. You have missed some basics related to versions that are
causing you problems now. Go back and learn the basics before
proceeding!

Hint: Things with a non-SNAPSHOT version should never, ever change, or
you will have big problems in Maven.

Wayne

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Can't get maven to compile with java 1.5

Posted by John Wooten <jw...@shoulderscorp.com>.
Added that and here is pom.xml (inherited by Foundation/pom.xml)

----------------
<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>com.areteq</groupId>
   <artifactId>Deep6MasterPOM</artifactId>
   <packaging>pom</packaging>
   <!-- modules>
     <module>../Foundation</module>
   </modules -->
   <version>1</version>
   <name>Deep6MasterPOM</name>
   <url>http://maven.apache.org</url>
   <description>This project provides a Super POM with the JDepend  
plugin specified</description>
   <inceptionYear>Feb-20-2009</inceptionYear>
   <issueManagement>
   	<system>Mantis</system>
   	<url>http://localhost/~woo/mantis</url>
   </issueManagement>
   <developers>
   	<developer>
   		<id>woo</id>
   		<name>John Wooten</name>
   		<email>jwooten@shoulderscorp.com</email>
   		<organization>ShouldersCorp</organization>
   		<organizationUrl>http://www.shoulderscorp.com</organizationUrl>
   		<timezone>EST</timezone>
   		<roles>
   			<role>Architect/Lead-Developer</role>
   		</roles>
   	</developer>
   </developers>
   <scm>
   	<connection>scm:svn:svn+ssh://woo37830@www.areteq.com/Deep6</ 
connection>
   	<tag>Deep6Master</tag>
   	<url>http://localhost</url>
   </scm>
   <organization>
   	<name>ShouldersCorp.</name>
   	<url>http://www.shoulderscorp.com</url>
   </organization>
   <!-- repositories>
   </repositories -->
   <build>
     <directory>target</directory>
     <outputDirectory>target/classes</outputDirectory>
     <finalName>${project.artifactId}-${project.version}</finalName>
     <testOutputDirectory>target/test-classes</testOutputDirectory>
     <sourceDirectory>src</sourceDirectory>
     <scriptSourceDirectory>scripts</scriptSourceDirectory>
     <testSourceDirectory>test</testSourceDirectory>
     <plugins>
             <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-compiler-plugin</artifactId>
         <configuration>
          <source>1.5</source>
          <target>1.5</target>
        </configuration>
       </plugin>
	</plugins>
    </build>

   <dependencies>
   	<dependency>
   		<groupId>junit</groupId>
   		<artifactId>junit</artifactId>
   		<version>3.8.1</version>
   		<scope>test</scope>
   	</dependency>
   	<dependency>
   		<groupId>log4j</groupId>
   		<artifactId>log4j</artifactId>
   		<version>1.2.8</version>
   		<scope>test</scope>
   	</dependency>
    	<dependency>
   		<groupId>commons-logging</groupId>
   		<artifactId>commons-logging</artifactId>
   		<version>1.0.4</version>
   		<!-- scope>test</scope -->
   	</dependency>
   </dependencies>
    <reporting>
   <plugins>
     <plugin>
         <groupId>org.codehaus.mojo</groupId>
         <artifactId>jdepend-maven-plugin</artifactId>
     </plugin>
     <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-surefire-report-plugin</artifactId>
     </plugin>
<plugin>
   <groupId>org.apache.maven.plugins</groupId>
   <artifactId>maven-pmd-plugin</artifactId>
   <configuration>
     <rulesets>
       <ruleset>/rulesets/basic.xml</ruleset>
       <ruleset>/rulesets/imports.xml</ruleset>
       <ruleset>/rulesets/unusedcode.xml</ruleset>
       <ruleset>/rulesets/finalizers.xml</ruleset>
     </rulesets>
   </configuration>
</plugin>
<plugin>
   <groupId>org.apache.maven.plugins</groupId>
   <artifactId>maven-checkstyle-plugin</artifactId>
   <configuration>
     <configLocation>config/maven_checks.xml</configLocation>
   </configuration>
</plugin>

    </plugins>
  </reporting>

</project>


---------------- here is output ----------------
[INFO] Scanning for projects...
[INFO]  
------------------------------------------------------------------------
[INFO] Building Foundation
[INFO]
[INFO] Id: com.areteq:Foundation:jar:1
[INFO] task-segment: [site]
[INFO]  
------------------------------------------------------------------------
[INFO] Attempting to resolve a version for plugin:  
org.apache.maven.plugins:maven-checkstyle-plugin using meta-version:  
LATEST
[INFO] Using version: 2.2 of plugin: org.apache.maven.plugins:maven- 
checkstyle-plugin
[INFO] Attempting to resolve a version for plugin:  
org.apache.maven.plugins:maven-pmd-plugin using meta-version: LATEST
[INFO] Using version: 2.4 of plugin: org.apache.maven.plugins:maven- 
pmd-plugin
[INFO] Attempting to resolve a version for plugin:  
org.apache.maven.plugins:maven-surefire-report-plugin using meta- 
version: LATEST
[INFO] Using version: 2.4.3 of plugin: org.apache.maven.plugins:maven- 
surefire-report-plugin
[INFO] Attempting to resolve a version for plugin:  
org.codehaus.mojo:jdepend-maven-plugin using meta-version: LATEST
[INFO] Using version: 2.0-beta-2 of plugin: org.codehaus.mojo:jdepend- 
maven-plugin
[INFO] Attempting to resolve a version for plugin:  
org.apache.maven.plugins:maven-project-info-reports-plugin using meta- 
version: LATEST
[INFO] Using version: 2.1 of plugin: org.apache.maven.plugins:maven- 
project-info-reports-plugin
[INFO] [statemgmt:start-fork]
[INFO] Starting forked execution [fork id: -1694468129]
[INFO] Setting property: classpath.resource.loader.class =>  
'org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader'.
[INFO] Setting property: velocimacro.messages.on => 'false'.
[INFO] Setting property: resource.loader => 'classpath'.
[INFO] Setting property: resource.manager.logwhenfound => 'false'.
[INFO] **************************************************************
[INFO] Starting Jakarta Velocity v1.4
[INFO] RuntimeInstance initializing.
[INFO] Default Properties File: org/apache/velocity/runtime/defaults/ 
velocity.properties
[INFO] Default ResourceManager initializing. (class  
org.apache.velocity.runtime.resource.ResourceManagerImpl)
[INFO] Resource Loader Instantiated:  
org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader
[INFO] ClasspathResourceLoader : initialization starting.
[INFO] ClasspathResourceLoader : initialization complete.
[INFO] ResourceCache : initialized. (class  
org.apache.velocity.runtime.resource.ResourceCacheImpl)
[INFO] Default ResourceManager initialization complete.
[INFO] Loaded System Directive:  
org.apache.velocity.runtime.directive.Literal
[INFO] Loaded System Directive:  
org.apache.velocity.runtime.directive.Macro
[INFO] Loaded System Directive:  
org.apache.velocity.runtime.directive.Parse
[INFO] Loaded System Directive:  
org.apache.velocity.runtime.directive.Include
[INFO] Loaded System Directive:  
org.apache.velocity.runtime.directive.Foreach
[INFO] Created: 20 parsers.
[INFO] Velocimacro : initialization starting.
[INFO] Velocimacro : adding VMs from VM library template :  
VM_global_library.vm
[ERROR] ResourceManager : unable to find resource  
'VM_global_library.vm' in any resource loader.
[INFO] Velocimacro : error using  VM library template  
VM_global_library.vm :  
org.apache.velocity.exception.ResourceNotFoundException: Unable to  
find resource 'VM_global_library.vm'
[INFO] Velocimacro :  VM library template macro registration complete.
[INFO] Velocimacro : allowInline = true : VMs can be defined inline in  
templates
[INFO] Velocimacro : allowInlineToOverride = false : VMs defined  
inline may NOT replace previous VM definitions
[INFO] Velocimacro : allowInlineLocal = false : VMs defined inline  
will be  global in scope if allowed.
[INFO] Velocimacro : initialization complete.
[INFO] Velocity successfully started.
[INFO] [checkstyle:checkstyle]
[WARNING] File encoding has not been set, using platform encoding  
MacRoman, i.e. build is platform dependent!
[INFO] There are 6464 checkstyle errors.
[WARNING] Unable to locate Source XRef to link to - DISABLED
[INFO] [pmd:pmd]
[WARNING] Unable to locate Source XRef to link to - DISABLED
[WARNING] File encoding has not been set, using platform encoding  
MacRoman, i.e. build is platform dependent!
[WARNING] Error while parsing /Users/woo/Development/workspaces/ 
Qworkspace/Foundation/src/com/areteq/common/HashMapHandler.java: Can't  
use generics unless running in JDK 1.5 mode!
[WARNING] Error while parsing /Users/woo/Development/workspaces/ 
Qworkspace/Foundation/src/com/areteq/common/HashMapHandler.java: Can't  
use generics unless running in JDK 1.5 mode!
[WARNING] Error while parsing /Users/woo/Development/workspaces/ 
Qworkspace/Foundation/src/com/areteq/common/HashMapHandler.java: Can't  
use generics unless running in JDK 1.5 mode!
[WARNING] Error while parsing /Users/woo/Development/workspaces/ 
Qworkspace/Foundation/src/com/areteq/common/HashMapHandler.java: Can't  
use generics unless running in JDK 1.5 mode!
[WARNING] Error while parsing /Users/woo/Development/workspaces/ 
Qworkspace/Foundation/src/com/areteq/gui/GenericPreferencesFrame.java:  
Can't use JDK 1.5 for loop syntax when running in JDK 1.4 mode!
[WARNING] Error while parsing /Users/woo/Development/workspaces/ 
Qworkspace/Foundation/src/com/areteq/gui/GenericPreferencesFrame.java:  
Can't use JDK 1.5 for loop syntax when running in JDK 1.4 mode!
[WARNING] Error while parsing /Users/woo/Development/workspaces/ 
Qworkspace/Foundation/src/com/areteq/gui/GenericPreferencesFrame.java:  
Can't use JDK 1.5 for loop syntax when running in JDK 1.4 mode!
[WARNING] Error while parsing /Users/woo/Development/workspaces/ 
Qworkspace/Foundation/src/com/areteq/gui/GenericPreferencesFrame.java:  
Can't use JDK 1.5 for loop syntax when running in JDK 1.4 mode!
[WARNING] Error while parsing /Users/woo/Development/workspaces/ 
Qworkspace/Foundation/src/com/areteq/util/DefaultByteOperator.java:  
Can't use annotations when running in JDK 1.4 mode!
[WARNING] Error while parsing /Users/woo/Development/workspaces/ 
Qworkspace/Foundation/src/com/areteq/util/DefaultByteOperator.java:  
Can't use annotations when running in JDK 1.4 mode!
[WARNING] Error while parsing /Users/woo/Development/workspaces/ 
Qworkspace/Foundation/src/com/areteq/util/DefaultByteOperator.java:  
Can't use annotations when running in JDK 1.4 mode!
[WARNING] Error while parsing /Users/woo/Development/workspaces/ 
Qworkspace/Foundation/src/com/areteq/util/DefaultByteOperator.java:  
Can't use annotations when running in JDK 1.4 mode!
[INFO] [pmd:cpd]
[WARNING] Unable to locate Source XRef to link to - DISABLED
[WARNING] File encoding has not been set, using platform encoding  
MacRoman, i.e. build is platform dependent!
[INFO] [statemgmt:start-fork]
[INFO] Starting forked execution [fork id: -1694468129]
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:compile]
[INFO] Nothing to compile - all classes are up to date
[INFO] [resources:testResources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:testCompile]
[INFO] No sources to compile
[INFO] [surefire:test]
[INFO] No tests to run.
[INFO] [statemgmt:end-fork]
[INFO] Ending forked execution [fork id: -1694468129]
[INFO] [surefire-report:report]
[WARNING] Unable to locate Test Source XRef to link to - DISABLED
[INFO] [statemgmt:clear-fork-context]
[INFO] Cleaning up forked execution context [fork id: -1694468129]
[INFO] [surefire-report:report-only]
[WARNING] Unable to locate Test Source XRef to link to - DISABLED
[INFO] [statemgmt:start-fork]
[INFO] Starting forked execution [fork id: -1694468129]
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:compile]
[INFO] Nothing to compile - all classes are up to date
[INFO] [statemgmt:end-fork]
[INFO] Ending forked execution [fork id: -1694468129]
[INFO] [jdepend:generate]
[INFO] [statemgmt:clear-fork-context]
[INFO] Cleaning up forked execution context [fork id: -1694468129]
[INFO] [project-info-reports:plugin-management]
[INFO] [project-info-reports:mailing-list]
[INFO] [project-info-reports:cim]
[INFO] [project-info-reports:dependency-management]
[INFO] [project-info-reports:license]
[INFO] [project-info-reports:project-team]
[INFO] [project-info-reports:scm]
[INFO] [project-info-reports:index]
[INFO] [project-info-reports:issue-tracking]
[INFO] [project-info-reports:summary]
[INFO] [project-info-reports:plugins]
[WARNING]

DEPRECATED: Binding aggregator mojos to lifecycle phases in the POM is  
considered dangerous.
This feature has been deprecated. Please adjust your POM files  
accordingly.

Offending mojo:

org.apache.maven.plugins:maven-project-info-reports-plugin: 
2.1:dependency-convergence

Project: com.areteq:Foundation:jar:1
POM File: /Users/woo/Development/workspaces/Qworkspace/Foundation/ 
pom.xml

[INFO] [project-info-reports:dependency-convergence]
[INFO] [project-info-reports:dependencies]
[INFO] [statemgmt:end-fork]
[INFO] Ending forked execution [fork id: -1694468129]
[INFO] [site:site]
[INFO] Skipped "Surefire Report" report, file "surefire-report.html"  
already exists for the English version.
[INFO] Generating "Checkstyle" report.
[WARNING] File encoding has not been set, using platform encoding  
MacRoman, i.e. build is platform dependent!
[INFO] There are 6464 checkstyle errors.
[WARNING] Unable to locate Source XRef to link to - DISABLED
[INFO] Generating "PMD Report" report.
[WARNING] Unable to locate Source XRef to link to - DISABLED
[WARNING] File encoding has not been set, using platform encoding  
MacRoman, i.e. build is platform dependent!
[WARNING] Error while parsing /Users/woo/Development/workspaces/ 
Qworkspace/Foundation/src/com/areteq/common/HashMapHandler.java: Can't  
use generics unless running in JDK 1.5 mode!
[WARNING] Error while parsing /Users/woo/Development/workspaces/ 
Qworkspace/Foundation/src/com/areteq/common/HashMapHandler.java: Can't  
use generics unless running in JDK 1.5 mode!
[WARNING] Error while parsing /Users/woo/Development/workspaces/ 
Qworkspace/Foundation/src/com/areteq/common/HashMapHandler.java: Can't  
use generics unless running in JDK 1.5 mode!
[WARNING] Error while parsing /Users/woo/Development/workspaces/ 
Qworkspace/Foundation/src/com/areteq/common/HashMapHandler.java: Can't  
use generics unless running in JDK 1.5 mode!
[WARNING] Error while parsing /Users/woo/Development/workspaces/ 
Qworkspace/Foundation/src/com/areteq/gui/GenericPreferencesFrame.java:  
Can't use JDK 1.5 for loop syntax when running in JDK 1.4 mode!
[WARNING] Error while parsing /Users/woo/Development/workspaces/ 
Qworkspace/Foundation/src/com/areteq/gui/GenericPreferencesFrame.java:  
Can't use JDK 1.5 for loop syntax when running in JDK 1.4 mode!
[WARNING] Error while parsing /Users/woo/Development/workspaces/ 
Qworkspace/Foundation/src/com/areteq/gui/GenericPreferencesFrame.java:  
Can't use JDK 1.5 for loop syntax when running in JDK 1.4 mode!
[WARNING] Error while parsing /Users/woo/Development/workspaces/ 
Qworkspace/Foundation/src/com/areteq/gui/GenericPreferencesFrame.java:  
Can't use JDK 1.5 for loop syntax when running in JDK 1.4 mode!
[WARNING] Error while parsing /Users/woo/Development/workspaces/ 
Qworkspace/Foundation/src/com/areteq/util/DefaultByteOperator.java:  
Can't use annotations when running in JDK 1.4 mode!
[WARNING] Error while parsing /Users/woo/Development/workspaces/ 
Qworkspace/Foundation/src/com/areteq/util/DefaultByteOperator.java:  
Can't use annotations when running in JDK 1.4 mode!
[WARNING] Error while parsing /Users/woo/Development/workspaces/ 
Qworkspace/Foundation/src/com/areteq/util/DefaultByteOperator.java:  
Can't use annotations when running in JDK 1.4 mode!
[WARNING] Error while parsing /Users/woo/Development/workspaces/ 
Qworkspace/Foundation/src/com/areteq/util/DefaultByteOperator.java:  
Can't use annotations when running in JDK 1.4 mode!
[INFO] Generating "CPD Report" report.
[WARNING] Unable to locate Source XRef to link to - DISABLED
[WARNING] File encoding has not been set, using platform encoding  
MacRoman, i.e. build is platform dependent!
[INFO] Generating "Surefire Report" report.
[WARNING] Unable to locate Test Source XRef to link to - DISABLED
[INFO] Generating "JDepend" report.
[INFO] Generating "Plugin Management" report.
[INFO] Generating "Mailing Lists" report.
[INFO] Generating "Continuous Integration" report.
[INFO] Generating "Project License" report.
[INFO] Generating "Project Team" report.
[INFO] Generating "Source Repository" report.
[INFO] Generating "About" report.
[INFO] Generating "Issue Tracking" report.
[INFO] Generating "Project Summary" report.
[INFO] Generating "Project Plugins" report.
[INFO] Generating "Dependencies" report.
[INFO] [statemgmt:clear-fork-context]
[INFO] Cleaning up forked execution context [fork id: -1694468129]
[INFO]  
------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO]  
------------------------------------------------------------------------
[INFO] Total time: 24 seconds
[INFO] Finished at: Sat Feb 21 17:42:12 EST 2009
[INFO] Final Memory: 14M/48M
[INFO]  
------------------------------------------------------------------------

Note it still says same thing.

Is the configuration in the right place?


On Feb 21, 2009, at 5:28 PM, Wes Wannemacher wrote:

>        <configuration>
>          <source>1.5</source>
>          <target>1.5</target>
>        </configuration>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Can't get maven to compile with java 1.5

Posted by Wes Wannemacher <we...@wantii.com>.
On Saturday 21 February 2009 16:58:55 John Wooten wrote:
> I have JAVA_HOME set to the java 1.5.1 and when I type echo $JAVA_HOME it
> shows this.
> I've put in a settings file settings.xml to set the jdk to 1.5 also.
>
> It compiles and says it can't do generics using 1.3, to do a
> /Users/woo/Development/workspaces/Qworkspace/Foundation/src/com/areteq/comm
>on/HashMapHandler.java:[11,26] generics are not supported in -source 1.3
> (try -source 1.5 to enable generics)
>    public abstract HashMap<String, HashMapData> getHashMapData();
>
> Where do I put this -source 1.5.  I've tried settings.xml, profiles, etc.
>
> It would help if the error somehow mention where and how to set this.

Add this to the build section of your pom.xml ->

  <build>
    <finalName>blah</finalName>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <source>1.5</source>
          <target>1.5</target>
        </configuration>
      </plugin>
    </plugins>
  </build>


-- 

Wes Wannemacher
Author - Struts 2 In Practice 
Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more
http://www.manning.com/wannemacher


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org