You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Costin Caraivan <cc...@axway.com> on 2008/10/31 16:56:39 UTC

Different compiler output when building with Maven and with PDE?

Hello,

I'm trying to build some Eclipse plugins using PDE and Maven (migration to
Maven). The compiler used is the Eclipse Compiler (ECJ) and the version is
the same for both: 3.4.0.v_874. The source/target levels are the same, 1.5,
the dependencies are the same, yet some of the compiled files are not
equivalent (not even in size). Example: ToolBarManager.class built with
Maven: 6.4KB, built with PDE: 7.1KB. That's almost 0.8KB worth of
"optimizations"?!?

Does anyone here have experience with Maven and with PDE, maybe I'm missing
something in the configuration of Maven (I want to replicate the PDE output
with Maven).

For reference, the PDE execution command, and the Maven compile
configuration:

1. PDE
<target name="build">
                <property name="dir.runLocation"
value="${dir.finalBuildDir}"></property>
                <property name="dir.baseLocation"
value="${dir.runLocation}/base"></property>
                <property name="dir.buildDir"
value="${dir.runLocation}/builder"></property>
                <echo>{dir.buildDir}  =  ${dir.runLocation} </echo>
                <echo>{dir.location}=${dir.buildDir}</echo>
                <exec executable="java" failonerror="true">
                        <!-- starting eclipse ant Runner -->
                        <arg value="-jar"/>
                        <arg
value="${dir.runLocation}/base/eclipse/plugins/${eclipse.equinox.launcher}"/>
                        <arg value="-application"/>
                        <arg value="org.eclipse.ant.core.antRunner"/>
                        <arg value="-buildfile"/>
                        <arg
value="${dir.runLocation}\base\eclipse\plugins\${eclipse.pde.build}\scripts\productBuild\productBuild.xml"/>
                       
                        <!--  argumenst for the script provided by eclipse
-->
                       
                        <!--  name for the location of the build.properties
files  -->
                        <arg value="-Dbuilder=${dir.runLocation}\builder"/>
                       
                        <!--  name for the base location where the eclipse
used in the build is -->
                        <arg
value="-DbaseLocation=${dir.runLocation}\base\eclipse"/>
                       
                        <!--  skip downloading eclipse, allready downloaded
from svn -->
                        <arg value="-DskipBase=true"/>
                        <!--  target platform and operating system -->
                        <arg
value="-Dconfigs=${build.baseos},${build.basews},${build.basearch}"/>

                        <!--  build directory where we provide the structure
required by the pde build  -->
                        <arg value="-DbuildDirectory=${dir.runLocation}"/>
                       
                        <!--  source version and target version -->
                        <arg value="-DjavacSource=1.5"/>
                        <arg value="-DjavacTarget=1.5"/>
                        <!--  location for the scripts in eclipse -->
                        <arg value="-DrootDir=${dir.runLocation}" />
                       
                        <arg
value="-Declipse.pdebuild.scripts=${dir.baseLocation}\eclipse\plugins\${eclipse.pde.build}\scripts"/>
                       
                        <!--  main feature declaration -->
                        <arg value="-DmainFeature=${build.feature}"/>
                       
                        <!--  location of the product file, for the current
application -->
                        <arg
value="-Dproduct=${dir.runLocation}\features\${build.feature}\${build.feature.product}"/>
                       
                        <!--  directory for the build -->
                        <arg
value="-DbuildLabel=${build.label.prefix}-${timestamp}"/>
                        <!--  label for the final zip -->
                        <arg
value="-DbuildId=${build.id.prefix}-${timestamp}"/>
                        <arg value="-DbuildType=${build.release.type}"/>
                       
                        <arg
value="-DbuildVersion=${build.release.version}"/>
                       
                </exec>
        </target>

2. Maven
<plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.5</source>
                    <target>1.5</target>
                    <fork>true</fork>
                    <compilerVersion>1.5</compilerVersion>
                    <executable>java -jar
"${settings.localRepository}/org/eclipse/jdt/core/${ecj.version}/core-${ecj.version}.jar"
-classpath rt.jar -log compile.log -verbose -sourcepath
"src/main"</executable>
                    <verbose>true</verbose>
                </configuration>
                <executions>
                    <id>compile</id>
                    <execution>
                        <goals>
                            <goal>compile</goal>
                        </goals>
                    </execution>
                </executions>
                <dependencies>
                    <dependency>
                        <groupId>org.eclipse.jdt</groupId>
                        <artifactId>core</artifactId>
                        <version>${ecj.version}</version>
                    </dependency>
                </dependencies>
                <inherited>true</inherited>
            </plugin> 
-- 
View this message in context: http://www.nabble.com/Different-compiler-output-when-building-with-Maven-and-with-PDE--tp20268837p20268837.html
Sent from the Maven - Users mailing list archive at Nabble.com.


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