[prev in list] [next in list] [prev in thread] [next in thread] 

List:       groovy-user
Subject:    Re: [groovy-user] [GMaven] Compiling to java 1.5
From:       RS Raghavan <rs.raghavan () gmail ! com>
Date:       2009-03-31 15:09:22
Message-ID: 1dcefab00903310809i3e28af70k7f5eec85167db125 () mail ! gmail ! com
[Download RAW message or body]

Jason,

I did not not - I included the following in the build and "mvn clean
compile" at the command prompt worked.

Thanks a bunch
Raghavan

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


On Tue, Mar 31, 2009 at 12:40 AM, Jason Dillon <jason@planet57.com> wrote:

> Have you configured the maven-compiler-plugin to use 1.5?  If not, you need
> to do that too.
> --jason
>
>
> On Mar 31, 2009, at 11:07 AM, RS Raghavan wrote:
>
> Jason,
>
> Here's the output - I did specify the targetByteCode tag name  partial of
> my pom is at the end.  Please see "second output" where I specified the
> source and target options on the command line.
>
> Thanks,
> Raghavan
>
> C:\Perforce\sandbox\osa-setup>mvn clean compile
> [INFO] Scanning for projects...
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Building Example Project
> [INFO]    task-segment: [clean, compile]
> [INFO]
> ------------------------------------------------------------------------
> [INFO] [clean:clean]
> [INFO] Deleting directory C:\Perforce\sandbox\osa-setup\target
> [INFO] [groovy:generateStubs {execution: default}]
> [INFO]  Generated 1 Java stub
> [INFO] [resources:resources]
> [INFO] Using default encoding to copy filtered resources.
> [INFO] [compiler:compile]
> [INFO] Compiling 20 source files to
> C:\Perforce\sandbox\osa-setup\target\classes
> [INFO]
> ------------------------------------------------------------------------
> [ERROR] BUILD FAILURE
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Compilation failure
>
> C:\Perforce\sandbox\osa-setup\src\main\groovy\com\pearson\osa\setup\Item.java:[35,21]
> generics are not supported in -source 1.3
> (try -source 1.5 to enable generics)
>     private SortedSet<String> objNme = new TreeSet<String>();
>
> C:\Perforce\sandbox\osa-setup\src\main\groovy\com\pearson\osa\setup\TDGen3.java:[21,15]
> generics are not supported in -source 1.3
> (try -source 1.5 to enable generics)
>     private Map<String, XSAValue> mapTD = new HashMap<String,
> XSAValue>(200);
>
> C:\Perforce\sandbox\osa-setup\src\main\groovy\com\pearson\osa\setup\OEItems.java:[17,19]
> generics are not supported in -source 1.3
>
> (try -source 1.5 to enable generics)
>         private Map<String, String> oe = new HashMap<String, String>(1000);
>
> C:\Perforce\sandbox\osa-setup\src\main\groovy\com\pearson\osa\setup\TDInfo.java:[24,22]
> generics are not supported in -source 1.3
> (try -source 1.5 to enable generics)
>     private static Map<String, XSAValue> mapTD = new HashMap<String,
> XSAValue>(200);
>
> C:\Perforce\sandbox\osa-setup\src\main\groovy\com\pearson\osa\setup\TDRow.java:[16,22]
> generics are not supported in -source 1.3
> (try -source 1.5 to enable generics)
>     static private Map<String, String> colNmes = new HashMap<String,
> String>(200);
>
> C:\Perforce\sandbox\osa-setup\src\main\groovy\com\pearson\osa\setup\TDCell.java:[14,22]
> generics are not supported in -source 1.3
> (try -source 1.5 to enable generics)
>     static private Map<String, XSAValue> xlateOrig = new HashMap<String,
> XSAValue>(200);
>
> C:\Perforce\sandbox\osa-setup\src\main\groovy\com\pearson\osa\setup\FtpToMainframe.java:[15,20]
> generics are not supported in -sou
> rce 1.3
> (try -source 1.5 to enable generics)
>         private Map <String, String> filenames = new HashMap<String,
> String>();
>
> C:\Perforce\sandbox\osa-setup\src\main\groovy\com\pearson\osa\setup\SAItems.java:[31,21]
> generics are not supported in -source 1.3
>
> (try -source 1.5 to enable generics)
>     private SortedSet<String> sa = new TreeSet<String>();
>
> C:\Perforce\sandbox\osa-setup\src\main\groovy\com\pearson\osa\setup\AllCols.java:[9,52]
> generics are not supported in -source 1.3
> (try -source 1.5 to enable generics)
>         class ColumnComparator implements Comparator<ColumnData> {
>
> C:\Perforce\sandbox\osa-setup\src\main\groovy\com\pearson\osa\setup\XSAValue.java:[19,15]
> generics are not supported in -source 1.
> 3
> (try -source 1.5 to enable generics)
>     private Map<String, String> convert = new HashMap<String, String>(200);
>
>
> [INFO]
> ------------------------------------------------------------------------
> [INFO] For more information, run Maven with the -e switch
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Total time: 14 seconds
> [INFO] Finished at: Mon Mar 30 22:59:27 CDT 2009
>
>
>
>
> ---Second Output with source and target specified
> C:\Perforce\sandbox\osa-setup>mvn compile -Dmaven.compiler.source=1.5
> -Dmaven.compiler.target=1.5
> [INFO] Scanning for projects...
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Building Example Project
> [INFO]    task-segment: [compile]
> [INFO]
> ------------------------------------------------------------------------
> [INFO] [groovy:generateStubs {execution: default}]
> [INFO]  Generated 1 Java stub
> [INFO] [resources:resources]
> [INFO] Using default encoding to copy filtered resources.
> [INFO] [compiler:compile]
> [INFO] Compiling 20 source files to
> C:\Perforce\sandbox\osa-setup\target\classes
> [INFO] [groovy:compile {execution: default}]
> [INFO]  Compiled 1 Groovy class
> [INFO]
> ------------------------------------------------------------------------
> [INFO] BUILD SUCCESSFUL
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Total time: 18 seconds
> [INFO] Finished at: Mon Mar 30 23:03:04 CDT 2009
> [INFO] Final Memory: 11M/20M
> [INFO]
> ------------------------------------------------------------------------
>
>
> Partial pom
>   <build>
>     <plugins>
>       <plugin>
>         <groupId>org.codehaus.groovy.maven</groupId>
>         <artifactId>gmaven-plugin</artifactId>
>         <version>1.0-rc-5</version>
>         <configuration>
>             <targetByteCode>1.5</targetByteCode>
>         </configuration>
>         <executions>
>           <execution>
>             <goals>
>               <goal>generateStubs</goal>
>               <goal>compile</goal>
>               <goal>generateTestStubs</goal>
>               <goal>testCompile</goal>
>             </goals>
>           </execution>
>         </executions>
>       </plugin>
>     </plugins>
>   </build>
>
>
>
> On Mon, Mar 30, 2009 at 11:58 AM, Jason Smith <jsmith@infotrustgroup.com>wrote:
>
>>  Could you post the full error please?  This may have something to do
>> with your Java compiler settings (which default to Java 1.4).
>>
>>
>> *From:* RS Raghavan [mailto:rs.raghavan@gmail.com]
>> *Sent:* Friday, March 27, 2009 11:23 PM
>> *To:* user@groovy.codehaus.org
>> *Subject:* [groovy-user] [GMaven] Compiling to java 1.5
>>
>>
>>  I am using gmaven plugin to compile my java and groovy code together -
>> when I issue mvn compile at the command prompt, I get the following error
>> (try -source 1.5 to enable generics)
>>
>> I tried the following - I did look into the documentation and could not
>> figure out how to specify the source 1.5.
>>
>> Could somebody please help me?
>>
>> Thanks,
>> Raghavan
>>
>> <build>
>>     <plugins>
>>       <plugin>
>>         <groupId>org.codehaus.groovy.maven</groupId>
>>         <artifactId>gmaven-plugin</artifactId>
>>         <version>1.0-rc-5</version>
>>      <configuration>
>>       <source>1.5</source>
>>    </configuration>
>>       <executions>
>>           <execution>
>>             <goals>
>>               <goal>generateStubs</goal>
>>               <goal>compile</goal>
>>               <goal>generateTestStubs</goal>
>>               <goal>testCompile</goal>
>>             </goals>
>>           </execution>
>>         </executions>
>>       </plugin>
>>     </plugins>
>>   </build>
>>
>
>
>

[Attachment #3 (text/html)]

Jason,<br><br>I did not not - I included the following in the build and &quot;mvn \
clean compile&quot; at the command prompt worked. <br><br>Thanks a bunch <br>Raghavan \
<br><br>&lt;plugin&gt;<br>        \
&lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;<br>  \
&lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;<br>        \
&lt;configuration&gt;<br>          &lt;source&gt;1.5&lt;/source&gt;<br>          \
&lt;target&gt;1.5&lt;/target&gt;<br>        &lt;/configuration&gt;<br>  \
&lt;/plugin&gt;<br><br><br><div class="gmail_quote">On Tue, Mar 31, 2009 at 12:40 AM, \
Jason Dillon <span dir="ltr">&lt;<a \
href="mailto:jason@planet57.com">jason@planet57.com</a>&gt;</span> \
wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, \
204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> <div style="">Have you \
configured the maven-compiler-plugin to use 1.5?  If not, you need to do that \
too.<div><br></div><font \
color="#888888"><div>--jason</div></font><div><div></div><div \
class="h5"><div><br></div><div><br> <div><div>On Mar 31, 2009, at 11:07 AM, RS \
Raghavan wrote:</div><br><blockquote type="cite">Jason,<br><br>Here&#39;s the output \
- I did specify the targetByteCode tag name  partial of my pom is at the end.  Please \
see &quot;second output&quot; where I specified the source and target options on the \
command line. <br>  <br>Thanks,<br>Raghavan <br> \
<br>C:\Perforce\sandbox\osa-setup&gt;mvn clean compile<br>[INFO] Scanning for \
projects...<br>[INFO] \
------------------------------------------------------------------------<br>[INFO] \
Building Example Project<br>  [INFO]    task-segment: [clean, compile]<br>[INFO] \
------------------------------------------------------------------------<br>[INFO] \
[clean:clean]<br>[INFO] Deleting directory \
C:\Perforce\sandbox\osa-setup\target<br>[INFO] [groovy:generateStubs {execution: \
default}]<br>  [INFO]  Generated 1 Java stub<br>[INFO] \
[resources:resources]<br>[INFO] Using default encoding to copy filtered \
resources.<br>[INFO] [compiler:compile]<br>[INFO] Compiling 20 source files to \
C:\Perforce\sandbox\osa-setup\target\classes<br>  [INFO] \
------------------------------------------------------------------------<br>[ERROR] \
BUILD FAILURE<br>[INFO] \
------------------------------------------------------------------------<br>[INFO] \
Compilation failure<br>  \
<br>C:\Perforce\sandbox\osa-setup\src\main\groovy\com\pearson\osa\setup\Item.java:[35,21] \
generics are not supported in -source 1.3<br>(try -source 1.5 to enable generics)<br> \
private SortedSet&lt;String&gt; objNme = new TreeSet&lt;String&gt;();<br>  \
<br>C:\Perforce\sandbox\osa-setup\src\main\groovy\com\pearson\osa\setup\TDGen3.java:[21,15] \
generics are not supported in -source 1.3<br>(try -source 1.5 to enable generics)<br> \
private Map&lt;String, XSAValue&gt; mapTD = new HashMap&lt;String, \
XSAValue&gt;(200);<br>  \
<br>C:\Perforce\sandbox\osa-setup\src\main\groovy\com\pearson\osa\setup\OEItems.java:[17,19] \
generics are not supported in -source 1.3<br><br>(try -source 1.5 to enable \
generics)<br>        private Map&lt;String, String&gt; oe = new HashMap&lt;String, \
String&gt;(1000);<br>  \
<br>C:\Perforce\sandbox\osa-setup\src\main\groovy\com\pearson\osa\setup\TDInfo.java:[24,22] \
generics are not supported in -source 1.3<br>(try -source 1.5 to enable generics)<br> \
private static Map&lt;String, XSAValue&gt; mapTD = new HashMap&lt;String, \
XSAValue&gt;(200);<br>  \
<br>C:\Perforce\sandbox\osa-setup\src\main\groovy\com\pearson\osa\setup\TDRow.java:[16,22] \
generics are not supported in -source 1.3<br>(try -source 1.5 to enable generics)<br> \
static private Map&lt;String, String&gt; colNmes = new HashMap&lt;String, \
String&gt;(200);<br>  \
<br>C:\Perforce\sandbox\osa-setup\src\main\groovy\com\pearson\osa\setup\TDCell.java:[14,22] \
generics are not supported in -source 1.3<br>(try -source 1.5 to enable generics)<br> \
static private Map&lt;String, XSAValue&gt; xlateOrig = new HashMap&lt;String, \
XSAValue&gt;(200);<br>  \
<br>C:\Perforce\sandbox\osa-setup\src\main\groovy\com\pearson\osa\setup\FtpToMainframe.java:[15,20] \
generics are not supported in -sou<br>rce 1.3<br>(try -source 1.5 to enable \
generics)<br>        private Map &lt;String, String&gt; filenames = new \
HashMap&lt;String, String&gt;();<br>  \
<br>C:\Perforce\sandbox\osa-setup\src\main\groovy\com\pearson\osa\setup\SAItems.java:[31,21] \
generics are not supported in -source 1.3<br><br>(try -source 1.5 to enable \
generics)<br>    private SortedSet&lt;String&gt; sa = new \
TreeSet&lt;String&gt;();<br>  \
<br>C:\Perforce\sandbox\osa-setup\src\main\groovy\com\pearson\osa\setup\AllCols.java:[9,52] \
generics are not supported in -source 1.3<br>(try -source 1.5 to enable generics)<br> \
class ColumnComparator implements Comparator&lt;ColumnData&gt; {<br>  \
<br>C:\Perforce\sandbox\osa-setup\src\main\groovy\com\pearson\osa\setup\XSAValue.java:[19,15] \
generics are not supported in -source 1.<br>3<br>(try -source 1.5 to enable \
generics)<br>    private Map&lt;String, String&gt; convert = new HashMap&lt;String, \
String&gt;(200);<br>  <br><br>[INFO] \
------------------------------------------------------------------------<br>[INFO] \
For more information, run Maven with the -e switch<br>[INFO] \
------------------------------------------------------------------------<br>  [INFO] \
Total time: 14 seconds<br>[INFO] Finished at: Mon Mar 30 22:59:27 CDT \
2009<br><br><br><br><br>---Second Output with source and target \
specified<br>C:\Perforce\sandbox\osa-setup&gt;mvn compile -Dmaven.compiler.source=1.5 \
-Dmaven.compiler.target=1.5<br>  [INFO] Scanning for projects...<br>[INFO] \
------------------------------------------------------------------------<br>[INFO] \
Building Example Project<br>[INFO]    task-segment: [compile]<br>[INFO] \
------------------------------------------------------------------------<br>  [INFO] \
[groovy:generateStubs {execution: default}]<br>[INFO]  Generated 1 Java \
stub<br>[INFO] [resources:resources]<br>[INFO] Using default encoding to copy \
filtered resources.<br>[INFO] [compiler:compile]<br>[INFO] Compiling 20 source files \
to C:\Perforce\sandbox\osa-setup\target\classes<br>  [INFO] [groovy:compile \
{execution: default}]<br>[INFO]  Compiled 1 Groovy class<br>[INFO] \
------------------------------------------------------------------------<br>[INFO] \
BUILD SUCCESSFUL<br>[INFO] \
------------------------------------------------------------------------<br>  [INFO] \
Total time: 18 seconds<br>[INFO] Finished at: Mon Mar 30 23:03:04 CDT 2009<br>[INFO] \
Final Memory: 11M/20M<br>[INFO] \
------------------------------------------------------------------------<br><br><br>Partial \
pom <br>  &lt;build&gt;<br>    &lt;plugins&gt;<br>      &lt;plugin&gt;<br>        \
&lt;groupId&gt;org.codehaus.groovy.maven&lt;/groupId&gt;<br>        \
&lt;artifactId&gt;gmaven-plugin&lt;/artifactId&gt;<br>        \
&lt;version&gt;1.0-rc-5&lt;/version&gt;<br>  &lt;configuration&gt;<br>            \
&lt;targetByteCode&gt;1.5&lt;/targetByteCode&gt;<br>        \
&lt;/configuration&gt;<br>        &lt;executions&gt;<br>          \
&lt;execution&gt;<br>            &lt;goals&gt;<br>  \
&lt;goal&gt;generateStubs&lt;/goal&gt;<br>              \
&lt;goal&gt;compile&lt;/goal&gt;<br>              \
&lt;goal&gt;generateTestStubs&lt;/goal&gt;<br>              \
&lt;goal&gt;testCompile&lt;/goal&gt;<br>  &lt;/goals&gt;<br>           \
&lt;/execution&gt;<br>        &lt;/executions&gt;<br>      &lt;/plugin&gt;<br>    \
&lt;/plugins&gt;<br>  &lt;/build&gt;<br><br><br><br><div class="gmail_quote">On Mon, \
Mar 30, 2009 at 11:58 AM, Jason Smith <span dir="ltr">&lt;<a \
href="mailto:jsmith@infotrustgroup.com" \
target="_blank">jsmith@infotrustgroup.com</a>&gt;</span> wrote:<br>  <blockquote \
class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt \
0pt 0.8ex; padding-left: 1ex;"> <div link="blue" vlink="purple" lang="EN-US"> \
<div><p><span style="font-size: 11pt; color: rgb(31, 73, 125);">Could you post the \
full error please?  This may have something to do with your Java compiler settings \
(which default to Java 1.4).</span></p> <div><span style="font-size: 11pt; color: \
rgb(31, 73, 125);"> </span><br></div> <div style="border-style: solid none none; \
border-color: rgb(181, 196, 223) -moz-use-text-color -moz-use-text-color; \
border-width: 1pt medium medium; padding: 3pt 0in 0in;"> <p><b><span \
style="font-size: 10pt;">From:</span></b><span style="font-size: 10pt;"> RS Raghavan \
[mailto:<a href="mailto:rs.raghavan@gmail.com" \
target="_blank">rs.raghavan@gmail.com</a>] <br> <b>Sent:</b> Friday, March 27, 2009 \
11:23 PM<br>  <b>To:</b> <a href="mailto:user@groovy.codehaus.org" \
target="_blank">user@groovy.codehaus.org</a><br> <b>Subject:</b> [groovy-user] \
[GMaven] Compiling to java 1.5</span></p> </div><div><div></div><div><div> \
<br></div><p>  I am using gmaven plugin to compile my java and groovy code together - \
when I issue mvn compile at the command prompt, I get the following error<br> (try \
-source 1.5 to enable generics)<br> <br> I tried the following - I did look into the \
documentation and could not figure out how to specify the source 1.5.<br>  <br> Could \
somebody please help me?<br> <br> Thanks,<br> Raghavan <br> <br> &lt;build&gt;<br>    \
&lt;plugins&gt;<br>       &lt;plugin&gt;<br>         \
&lt;groupId&gt;org.codehaus.groovy.maven&lt;/groupId&gt;<br>         \
&lt;artifactId&gt;gmaven-plugin&lt;/artifactId&gt;<br>  \
&lt;version&gt;1.0-rc-5&lt;/version&gt;<br>      &lt;configuration&gt;<br>       \
&lt;source&gt;1.5&lt;/source&gt;<br>    &lt;/configuration&gt;<br>       \
&lt;executions&gt;<br>           &lt;execution&gt;<br>             &lt;goals&gt;<br>  \
&lt;goal&gt;generateStubs&lt;/goal&gt;<br>               \
&lt;goal&gt;compile&lt;/goal&gt;<br>               \
&lt;goal&gt;generateTestStubs&lt;/goal&gt;<br>               \
&lt;goal&gt;testCompile&lt;/goal&gt;<br>  &lt;/goals&gt;<br>           \
&lt;/execution&gt;<br>         &lt;/executions&gt;<br>       &lt;/plugin&gt;<br>     \
&lt;/plugins&gt;<br>   &lt;/build&gt;</p> </div></div></div> </div> \
</blockquote></div><br></blockquote> \
</div><br></div></div></div></div></blockquote></div><br>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic