Thanks for this Sébastien,

I had a similiar issue and added the build properties as you have outlined below.

I am not seeing these items "replaced in the generated build.xml", but I am seeing the compile step with additional "-DjavacSource" and "-DjavacTarget" options, and those are over-riding the build.xml

I can build fine manually, bu I am also playing with CruiseControl atm and am having some fun getting it to play nice with this fix, but I guess that is an issue for another forum...?

Regards

Dara

Sebastien Pennec wrote:
Hello Magali,

With the PDE plugin, it is possible to inject properties that will be replaced in the generated build.xml file.

Here is how:

<plugin>
  <groupId>org.codehaus.mojo</groupId>
  <artifactId>pde-maven-plugin</artifactId>
  <extensions>true</extensions>
  <configuration>
    <eclipseInstall>${path.to.eclipse}</eclipseInstall>
    <buildProperties>
      <javacSource>1.5</javacSource>
      <javacTarget>1.5</javacTarget>
    </buildProperties>
  </configuration>
</plugin>

In the <configuration> element, add a <buildProperties> element. You can then nest elements that are defined as properties in the generated build.xml file.

Hope this helps :)

Sébastien

Magali Hélène wrote:
Sorry for answering so late, but you are right, I have the same lines as you in my generated build.xml file and, actually, my code is JDK 1.4-compliant. But if you have found how to modify this, I am interested in it, because my next projet will not have a jdk 1.4 compliant code !
truly,

Magali




Sebastien Pennec a écrit :
Hello,

Thanks for your help :)

I have a pretty simple pom.xml, that follows what is presented on the Maven PDE Plugin page[1]. Here is the PDE part:

  <build>
    <plugins>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>pde-maven-plugin</artifactId>
        <extensions>true</extensions>
        <configuration>
          <eclipseInstall>${path.to.eclipse}</eclipseInstall>
        </configuration>
      </plugin>
    </plugins>
  </build>

If I run mvn clean compile, I get the following errors:


[javac] 2. ERROR in C:\dev\EclipseRCP\LogbackRCP\plugins\LogbackPlugin\src\main\java\ch\qos\logback\eclipse\model\LoggingEventManager.java (at line 21) [javac] private Collection<LoggingEvent> loggingEventCollection = new ArrayList<LoggingEvent>();
    [javac]                        ^^^^^^^^^^^^
[javac] Syntax error, parameterized types are only available if source level is 5.0

I first tried to add a maven-compile-plugin to specify that I want to use the JDK 1.5, but the build didn't work either.

After some research, I found that the generated build.xml has these elements:
<property name="javacSource" value="1.3"/>
<property name="javacTarget" value="1.2"/>

Do you have a way to change these values? Since the build.xml is generated, I guess that it must be an option somewhere...

Cheers,

Sébastien

[1]http://mojo.codehaus.org/pde-maven-plugin/examples/simple_plugin.html

Magali Hélène wrote:
I used the PDE Plugin with JDK 1.5, and it was ok...
Which errors have you and how do you use the plugin ?

Magali Hélène

Sebastien Pennec a écrit :
Hello,

I'm currently using the PDE plugin to build, guess what, an Eclipse plugin.

It returns errors when I use JDK 1.5 generics. Is it normal behavior? I thought that my code could be written using JDK 1.5... Should I only write JDK 1.4-compliant code?

Thanks for any hint :)

Sébastien



---------------------------------------------------------------------
To unsubscribe from this list please visit:

   http://xircles.codehaus.org/manage_email





---------------------------------------------------------------------
To unsubscribe from this list please visit:

   http://xircles.codehaus.org/manage_email





---------------------------------------------------------------------
To unsubscribe from this list please visit:

   http://xircles.codehaus.org/manage_email

Reply via email to