You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Eric Gulatee (JIRA)" <ji...@codehaus.org> on 2009/04/16 17:45:57 UTC

[jira] Created: (MANT-48) Allow customization of source/target options for javac

Allow customization of source/target options for javac
------------------------------------------------------

                 Key: MANT-48
                 URL: http://jira.codehaus.org/browse/MANT-48
             Project: Maven 2.x Ant Plugin
          Issue Type: Improvement
            Reporter: Eric Gulatee


As of right now, mvn ant:ant generates a hard coded value for the source & target for the javac command.

Is it possible to:
-  Customize this value through properties?

or

-  See if there is a maven plugin [maven-compiler-plugin] and use that source and target.  


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Issue Comment Edited: (MANT-48) Allow customization of source/target options for javac

Posted by "Eric Gulatee (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MANT-48?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=173214#action_173214 ] 

Eric Gulatee edited comment on MANT-48 at 4/16/09 4:27 PM:
-----------------------------------------------------------

Here are two poms from my project.

Parent & Child.

Both have in their pom.

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

which as far as I know tells maven to use 1.5


I am attaching the generated maven-buiild.xml which clearly shows source = 1.3, target =1.1 for javac after doing an mvn ant:ant in the parent's directory.

So when I finally do an "ant" command it fails.






      was (Author: egulatee):
    Here are two poms from my project.

Parent & Child.

Both have in their pom.

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

which as far as I know tells maven to use 1.5

  
> Allow customization of source/target options for javac
> ------------------------------------------------------
>
>                 Key: MANT-48
>                 URL: http://jira.codehaus.org/browse/MANT-48
>             Project: Maven 2.x Ant Plugin
>          Issue Type: Improvement
>            Reporter: Eric Gulatee
>         Attachments: maven-build.xml, maven-build.xml, patch1.txt, pom.xml, pom.xml
>
>
> As of right now, mvn ant:ant generates a hard coded value for the source & target for the javac command.
> Is it possible to:
> -  Customize this value through properties?
> or
> -  See if there is a maven plugin [maven-compiler-plugin] and use that source and target.  

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MANT-48) Allow customization of source/target options for javac

Posted by "Eric Gulatee (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MANT-48?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=173209#action_173209 ] 

Eric Gulatee commented on MANT-48:
----------------------------------

>From what I saw, it wasn't working.  I didn't realize it's supposed to extract the source/target values.  

When I looked inside the code, All I saw were hard coded values.

In any case, let me create you a POM.


The purpose (At least in my case) was that I can pass properties on the ANT command line :)  



> Allow customization of source/target options for javac
> ------------------------------------------------------
>
>                 Key: MANT-48
>                 URL: http://jira.codehaus.org/browse/MANT-48
>             Project: Maven 2.x Ant Plugin
>          Issue Type: Improvement
>            Reporter: Eric Gulatee
>         Attachments: patch1.txt
>
>
> As of right now, mvn ant:ant generates a hard coded value for the source & target for the javac command.
> Is it possible to:
> -  Customize this value through properties?
> or
> -  See if there is a maven plugin [maven-compiler-plugin] and use that source and target.  

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Issue Comment Edited: (MANT-48) Allow customization of source/target options for javac

Posted by "Eric Gulatee (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MANT-48?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=173209#action_173209 ] 

Eric Gulatee edited comment on MANT-48 at 4/16/09 4:16 PM:
-----------------------------------------------------------

>From what I saw, it wasn't working.  I didn't realize it's supposed to extract the source/target values.  

When I looked inside the code, All I saw were hard coded values.

In any case, let me create you a POM.


The purpose (At least in my case) was that I can pass properties on the ANT command line :)  which allows me to retarget to 1.5 without changing the xml files.  

But if this is supposed to work and extract the javac source & target from the pom.xml, then apologies.



      was (Author: egulatee):
    From what I saw, it wasn't working.  I didn't realize it's supposed to extract the source/target values.  

When I looked inside the code, All I saw were hard coded values.

In any case, let me create you a POM.


The purpose (At least in my case) was that I can pass properties on the ANT command line :)  


  
> Allow customization of source/target options for javac
> ------------------------------------------------------
>
>                 Key: MANT-48
>                 URL: http://jira.codehaus.org/browse/MANT-48
>             Project: Maven 2.x Ant Plugin
>          Issue Type: Improvement
>            Reporter: Eric Gulatee
>         Attachments: patch1.txt
>
>
> As of right now, mvn ant:ant generates a hard coded value for the source & target for the javac command.
> Is it possible to:
> -  Customize this value through properties?
> or
> -  See if there is a maven plugin [maven-compiler-plugin] and use that source and target.  

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (MANT-48) Allow customization of source/target options for javac

Posted by "Eric Gulatee (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MANT-48?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Eric Gulatee updated MANT-48:
-----------------------------

    Attachment: pom.xml
                pom.xml

Here are two poms from my project.

Parent & Child.

Both have in their pom.

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

which as far as I know tells maven to use 1.5


> Allow customization of source/target options for javac
> ------------------------------------------------------
>
>                 Key: MANT-48
>                 URL: http://jira.codehaus.org/browse/MANT-48
>             Project: Maven 2.x Ant Plugin
>          Issue Type: Improvement
>            Reporter: Eric Gulatee
>         Attachments: patch1.txt, pom.xml, pom.xml
>
>
> As of right now, mvn ant:ant generates a hard coded value for the source & target for the javac command.
> Is it possible to:
> -  Customize this value through properties?
> or
> -  See if there is a maven plugin [maven-compiler-plugin] and use that source and target.  

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MANT-48) Allow customization of source/target options for javac

Posted by "Benjamin Bentmann (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MANT-48?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=173208#action_173208 ] 

Benjamin Bentmann commented on MANT-48:
---------------------------------------

Can you elaborate on your use case some more? For instance, the Ant Plugin already extracts the source/target values from the Maven Compiler Plugin. If that isn't working for you, could you provide an example POM to reproduce?

I also don't quite understand the intention of your patch. It's merely replacing the actual default values with properties but if the default values aren't used, the properties won't be used either. So I'm really not sure what you're trying to solve.

> Allow customization of source/target options for javac
> ------------------------------------------------------
>
>                 Key: MANT-48
>                 URL: http://jira.codehaus.org/browse/MANT-48
>             Project: Maven 2.x Ant Plugin
>          Issue Type: Improvement
>            Reporter: Eric Gulatee
>         Attachments: patch1.txt
>
>
> As of right now, mvn ant:ant generates a hard coded value for the source & target for the javac command.
> Is it possible to:
> -  Customize this value through properties?
> or
> -  See if there is a maven plugin [maven-compiler-plugin] and use that source and target.  

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Issue Comment Edited: (MANT-48) Allow customization of source/target options for javac

Posted by "Benjamin Bentmann (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MANT-48?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=173208#action_173208 ] 

Benjamin Bentmann edited comment on MANT-48 at 4/16/09 3:53 PM:
----------------------------------------------------------------

Can you elaborate on your use case some more? For instance, the Ant Plugin already extracts the source/target values from the Maven Compiler Plugin. If that isn't working for you, could you provide an example POM to reproduce?

In general, I wonder how much sense it makes to allow customization of the source/target values via properties. I mean these aren't user-specific settings so I would like to understand the need to override them via properties. 

I also don't quite understand the intention of your patch. It's merely replacing the actual default values with properties but if the default values aren't used, the properties won't be used either. So I'm really not sure what you're trying to solve.

      was (Author: bentmann):
    Can you elaborate on your use case some more? For instance, the Ant Plugin already extracts the source/target values from the Maven Compiler Plugin. If that isn't working for you, could you provide an example POM to reproduce?

I also don't quite understand the intention of your patch. It's merely replacing the actual default values with properties but if the default values aren't used, the properties won't be used either. So I'm really not sure what you're trying to solve.
  
> Allow customization of source/target options for javac
> ------------------------------------------------------
>
>                 Key: MANT-48
>                 URL: http://jira.codehaus.org/browse/MANT-48
>             Project: Maven 2.x Ant Plugin
>          Issue Type: Improvement
>            Reporter: Eric Gulatee
>         Attachments: patch1.txt
>
>
> As of right now, mvn ant:ant generates a hard coded value for the source & target for the javac command.
> Is it possible to:
> -  Customize this value through properties?
> or
> -  See if there is a maven plugin [maven-compiler-plugin] and use that source and target.  

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (MANT-48) Allow customization of source/target options for javac

Posted by "Eric Gulatee (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MANT-48?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Eric Gulatee updated MANT-48:
-----------------------------

    Attachment: patch1.txt

Patch puts the target & source for javac in the property file [maven.build.properties] instead of the ANT file.

Note:  This is probably not the correct location as it may get overwritten.  However, it allows for retargetting without editing the ant file.  


> Allow customization of source/target options for javac
> ------------------------------------------------------
>
>                 Key: MANT-48
>                 URL: http://jira.codehaus.org/browse/MANT-48
>             Project: Maven 2.x Ant Plugin
>          Issue Type: Improvement
>            Reporter: Eric Gulatee
>         Attachments: patch1.txt
>
>
> As of right now, mvn ant:ant generates a hard coded value for the source & target for the javac command.
> Is it possible to:
> -  Customize this value through properties?
> or
> -  See if there is a maven plugin [maven-compiler-plugin] and use that source and target.  

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (MANT-48) Allow customization of source/target options for javac

Posted by "Eric Gulatee (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MANT-48?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Eric Gulatee updated MANT-48:
-----------------------------

    Attachment: maven-build.xml
                maven-build.xml

> Allow customization of source/target options for javac
> ------------------------------------------------------
>
>                 Key: MANT-48
>                 URL: http://jira.codehaus.org/browse/MANT-48
>             Project: Maven 2.x Ant Plugin
>          Issue Type: Improvement
>            Reporter: Eric Gulatee
>         Attachments: maven-build.xml, maven-build.xml, patch1.txt, pom.xml, pom.xml
>
>
> As of right now, mvn ant:ant generates a hard coded value for the source & target for the javac command.
> Is it possible to:
> -  Customize this value through properties?
> or
> -  See if there is a maven plugin [maven-compiler-plugin] and use that source and target.  

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Issue Comment Edited: (MANT-48) Allow customization of source/target options for javac

Posted by "Eric Gulatee (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MANT-48?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=173214#action_173214 ] 

Eric Gulatee edited comment on MANT-48 at 4/16/09 4:30 PM:
-----------------------------------------------------------

Here are two poms from my project.

Parent & Child.

Both have in their pom.

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

which as far as I know tells maven to use 1.5


I am attaching the generated maven-buiild.xml which clearly shows source = 1.3, target =1.1 for javac after doing an mvn ant:ant in the parent's directory.

So when I finally do an "ant" command it fails.




Now, when I searched through the MANT code, I found the place that generated the javac task and did the changes.

My goal, indeed is NOT to have javac necessarily switch between the versions, however, having properties that can be overriden allows me to run ant with source and target 1.5 without changing the build files.

Now what would be superb would be if it detected the javac source & target version from the pom which you indicate it does.  So either I'm doing something silly (Very well possible) or something's broken.







      was (Author: egulatee):
    Here are two poms from my project.

Parent & Child.

Both have in their pom.

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

which as far as I know tells maven to use 1.5


I am attaching the generated maven-buiild.xml which clearly shows source = 1.3, target =1.1 for javac after doing an mvn ant:ant in the parent's directory.

So when I finally do an "ant" command it fails.





  
> Allow customization of source/target options for javac
> ------------------------------------------------------
>
>                 Key: MANT-48
>                 URL: http://jira.codehaus.org/browse/MANT-48
>             Project: Maven 2.x Ant Plugin
>          Issue Type: Improvement
>            Reporter: Eric Gulatee
>         Attachments: maven-build.xml, maven-build.xml, patch1.txt, pom.xml, pom.xml
>
>
> As of right now, mvn ant:ant generates a hard coded value for the source & target for the javac command.
> Is it possible to:
> -  Customize this value through properties?
> or
> -  See if there is a maven plugin [maven-compiler-plugin] and use that source and target.  

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MANT-48) Allow customization of source/target options for javac

Posted by "Benjamin Bentmann (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MANT-48?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=173211#action_173211 ] 

Benjamin Bentmann commented on MANT-48:
---------------------------------------

bq. The purpose (At least in my case) was that I can pass properties on the ANT command line 
As said, I feel happier if I would understand the reason for this. You don't build with source=1.4 and with source=1.5 in the next moment, do you? CLI properties usually support dynamically switching settings, I just haven't groked yet why one would do this for source/target.

> Allow customization of source/target options for javac
> ------------------------------------------------------
>
>                 Key: MANT-48
>                 URL: http://jira.codehaus.org/browse/MANT-48
>             Project: Maven 2.x Ant Plugin
>          Issue Type: Improvement
>            Reporter: Eric Gulatee
>         Attachments: patch1.txt
>
>
> As of right now, mvn ant:ant generates a hard coded value for the source & target for the javac command.
> Is it possible to:
> -  Customize this value through properties?
> or
> -  See if there is a maven plugin [maven-compiler-plugin] and use that source and target.  

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Closed: (MANT-48) Allow customization of source/target options for javac

Posted by "Benjamin Bentmann (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MANT-48?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Benjamin Bentmann closed MANT-48.
---------------------------------

      Assignee: Benjamin Bentmann
    Resolution: Won't Fix

I'm rejecting this feature request in favor of a fix for the original bug: MANT-51.

> Allow customization of source/target options for javac
> ------------------------------------------------------
>
>                 Key: MANT-48
>                 URL: http://jira.codehaus.org/browse/MANT-48
>             Project: Maven 2.x Ant Plugin
>          Issue Type: Improvement
>            Reporter: Eric Gulatee
>            Assignee: Benjamin Bentmann
>         Attachments: maven-build.xml, maven-build.xml, patch1.txt, pom.xml, pom.xml
>
>
> As of right now, mvn ant:ant generates a hard coded value for the source & target for the javac command.
> Is it possible to:
> -  Customize this value through properties?
> or
> -  See if there is a maven plugin [maven-compiler-plugin] and use that source and target.  

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira