2009/9/18 raghu guru <[email protected]>:
> Onc eagain Thanks for reply,
>
> May be i tell you what i exactly i want, lets see if you have any idea on
> this.
>
> Basically i want to include change my MANIFEST.MF something like
>
>    Compiler:IBM-JDK-1.4
>    Compiler-Path:C:\JDK\ibm-jdk-1.4\bin\javac
>
> So i included in jar pluging something like
>
> <Compiler>${maven.compiler.compilerVersion}</Compiler>
>
> <Compiler-Path>${maven.compiler.executable}</Compiler-Path>
>
> but what i'm getting in my MANIFEST is
> Compiler: null
> Compiler-Path: null
>

Short answer is: nope

Long answer is: it depends...

if you can get maven-toolchains-plugin released (I might do that once
my apache commit access is set up) then you could write a plugin that
queries the current toolchain and sets properties to the vesion of
java specified in the current tool chain.  That would allow you to
specify the compiler config via toolchains and also additionally you
would be querying the same toolchain in your (to be written) property
setting plugin.  Then the properties would be available for subsequent
plugin executions attached to the lifecycle.

Otherwise, if you define your compile config using properties, you
could get the properties that way...

Otherwise, you could use exec-maven-plugin or maven-antrun-plugin to
invoke the javac (specified by your property defining the path to the
java home you want to compile with) with -version and then parse the
output and put it into a properties file which you can then load...
using properties-maven-plugin.

;-)

-Stephen

> so now is there any other properties to get these value?
>
> On Thu, Sep 17, 2009 at 5:18 PM, Stephen Connolly <
> [email protected]> wrote:
>
>> essentially you can even compile with java 1.6 and use the 1.3 runtime
>> libraries and source 1.3 and target 1.3 and the resulting classes will be
>> just as good as compiling with java 1.3
>>
>> the real issue you have is ensuring that the class and method signatures
>> that you have used in your code are only those for 1.4 or earlier
>>
>> that is where either a full set of unit tests or something like
>> animal-sniffer comes in.
>>
>> unfortunately I have not released animal-sniffer from codehaus *yet* so
>> you'd have to use the original version from java.net
>>
>> if you can wait a short while org.codehaus.mojo:animal-sniffer-maven-plugin
>> and you can use that (short time is a week or two)
>>
>> Sent from my [rhymes with tryPod] ;-)
>>
>> On 17 Sep 2009, at 23:06, raghu guru <[email protected]> wrote:
>>
>>  Thanks Again,
>>>
>>> Is there any properties available that shows compiled with 1.4, may be if
>>> its available i want to include into MANIFEST.MF
>>>
>>> or is there a way to just confirm it
>>>
>>>
>>> On Thu, Sep 17, 2009 at 4:57 PM, Stephen Connolly <
>>> [email protected]> wrote:
>>>
>>>  sorry, I missed your pom snippet on this small screen
>>>>
>>>> your classes were compiled with java 1.4
>>>>
>>>> your jar was packaged up by a java 1.5 jre
>>>>
>>>> Sent from my [rhymes with tryPod] ;-)
>>>>
>>>> On 17 Sep 2009, at 22:50, raghu guru <[email protected]> wrote:
>>>>
>>>> thanks for replying
>>>>
>>>>>
>>>>> is this means, that configuring compiler version / executable in
>>>>> compiler
>>>>> plugin will not have any effect on this??
>>>>>
>>>>> i thought by classes are compiled with javac mentioned in executable
>>>>> tag..
>>>>>
>>>>> On Thu, Sep 17, 2009 at 4:40 PM, Stephen Connolly <
>>>>> [email protected]> wrote:
>>>>>
>>>>> your code was compiled with java 1.5 in compatibility mode for 1.4
>>>>>
>>>>>>
>>>>>> providing you have only used classes and methods only from the 1.4
>>>>>> runtime
>>>>>> libraries, everything will be fine
>>>>>>
>>>>>> you need to use another tool to ensure that you have not accidentally
>>>>>> used
>>>>>> some 1.5 methods (eg String.isEmpty())
>>>>>>
>>>>>> animal-sniffer is one tool to do this check for you
>>>>>>
>>>>>> Sent from my [rhymes with tryPod] ;-)
>>>>>>
>>>>>>
>>>>>> On 17 Sep 2009, at 22:32, raghu guru <[email protected]> wrote:
>>>>>>
>>>>>> Hi All,
>>>>>>
>>>>>>
>>>>>>> I use Maven 2.2.1 and it runs on JDK 1.5 and above, but my source code
>>>>>>> is
>>>>>>> not 1.5 compatible yet, so i configured my compiler plugin as shown
>>>>>>> below.
>>>>>>> Everything works fine. but when i look into MANIFEST.MF of my jar file
>>>>>>> it
>>>>>>> shows Build-Jdk: 1.5.0_13. So how do i confirm that my code were
>>>>>>> compiled
>>>>>>> with 1.4 only not with 1.5 ??
>>>>>>>
>>>>>>> Please Help
>>>>>>>
>>>>>>> ....
>>>>>>> .....
>>>>>>> <groupId>org.apache.maven.plugins</groupId>
>>>>>>>       <artifactId>maven-compiler-plugin</artifactId>
>>>>>>>       <configuration>
>>>>>>>           <verbose>true</verbose>
>>>>>>>           <executable>C:\JDK\ibm-jdk-1.4\bin\javac</executable>
>>>>>>>           <compilerVersion>IBM-JDK-1.4</compilerVersion>
>>>>>>>
>>>>>>>
>>>>>>> Thanks
>>>>>>> Jan
>>>>>>>
>>>>>>>
>>>>>>>  ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: [email protected]
>>>>>> For additional commands, e-mail: [email protected]
>>>>>>
>>>>>>
>>>>>>
>>>>>>  ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: [email protected]
>>>> For additional commands, e-mail: [email protected]
>>>>
>>>>
>>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [email protected]
>> For additional commands, e-mail: [email protected]
>>
>>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to