Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[virgo-dev] Virgo maven build

Hi All,

I finally got some time and attached is the result of some prototyping.

Attached is the master.pom - lock down versions of plugins and artifacts used across all projects.
Also to provide some place for common properties and version variables.
(see attached pom.xml)

I decided to work in the dependency order (i.e. http://wiki.eclipse.org/Virgo/Build#.22Rippling.22).
So I started with osgi-test-stubs.

The results of my experimentation is maven-squashed.patch (attached).

So issues I ran into:
1. Could not get maven-compiler-plugin with compilerId = aspectj (http://maven.apache.org/plugins/maven-compiler-plugin/non-javac-compilers.html) to work
2. #1 means that we really can't do "exactly" what osgi-test-stubs build is doing, i.e. compiling with iajc. What I got working is the virgo-build/weaving approach. Compile with jdt and call iajc on compiled code.
3. Bundlor usage is a bit unfriendly with maven. Especially for webapps. (see comments in master pom.xml)

Top two issues ate most of the time. I pulled down sources for all of the related plugins and to be honest - each and everyone of them is in need of some TLC.

What worked:
1. tycho-compiler-jdt works well and allows override of jdt compiler version. (Should jdt compiler be updated from 3.3?)
2. generated class files are identical in size
3. tests run and pass building both ways.

I will continue on modifying all other projects and post back with results.

Regards,
Dmitry



<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd";>
    <modelVersion>4.0.0</modelVersion>
    <groupId>org.eclipse.virgo</groupId>
    <artifactId>master</artifactId>
    <packaging>pom</packaging>
    <version>2-SNAPSHOT</version>
    <name>Eclipe :: Virgo :: Master POM</name>


    <properties>
        <java.version>1.5</java.version>
        <bundlor.version>1.0.0.RELEASE</bundlor.version>
        <org.aspectj.tools.version>1.6.6.RELEASE</org.aspectj.tools.version>
        <org.eclipse.osgi.version>3.5.0.v20090311-1300</org.eclipse.osgi.version>

        <!-- default compiler flags -->
        <compile.debug>true</compile.debug>
        <compile.debug.level>lines,vars,source</compile.debug.level>
        <compiler.args>-enableJavadoc</compiler.args>

    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.junit</groupId>
                <artifactId>com.springsource.org.junit</artifactId>
                <version>4.7.0</version>
            </dependency>
            <dependency>
                <groupId>org.osgi</groupId>
                <artifactId>org.osgi.core</artifactId>
                <version>4.1.0</version>
            </dependency>
            <dependency>
                <groupId>org.osgi</groupId>
                <artifactId>org.osgi.compendium</artifactId>
                <version>4.1.0</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <dependency>
            <groupId>org.junit</groupId>
            <artifactId>com.springsource.org.junit</artifactId>
        </dependency>
    </dependencies>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-antrun-plugin</artifactId>
                    <version>1.3</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-clean-plugin</artifactId>
                    <version>2.4.1</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>2.3.1</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-war-plugin</artifactId>
                    <version>2.1-beta-1</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>2.3</version>
                    <configuration>
                        <archive>
                            <manifest>
                                <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
                                <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                            </manifest>
                        </archive>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>2.4.3</version>
                    <configuration>
                        <encoding>UTF-8</encoding>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>2.1.2</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>2.5</version>
                </plugin>

                <plugin>
                    <groupId>com.springsource.bundlor</groupId>
                    <artifactId>com.springsource.bundlor.maven</artifactId>
                    <version>${bundlor.version}</version>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                    <encoding>UTF-8</encoding>
                    <debug>${compile.debug}</debug>
                    <debuglevel>${compile.debug.level}</debuglevel>
                    <compilerArgument>${compiler.args}</compilerArgument>
                    <compilerId>jdt</compilerId>
                    <fork>false</fork>
                    <verbose>true</verbose>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.sonatype.tycho</groupId>
                        <artifactId>tycho-compiler-jdt</artifactId>
                        <version>0.8.0</version>
                        <exclusions>
                            <exclusion>
                                <groupId>org.sonatype.tycho</groupId>
                                <artifactId>org.eclipse.jdt.core</artifactId>
                            </exclusion>
                        </exclusions>
                    </dependency>
                    <!-- TODO: Should this be upgraded to a later version of jdt compiler -->
                    <!-- NOTE: the one excluded form type-compiler-jdt is v3.5 something -->
                    <dependency>
                        <groupId>org.eclipse.jdt</groupId>
                        <artifactId>com.springsource.org.eclipse.jdt.core.compiler.batch</artifactId>
                        <version>3.3.0</version>
                    </dependency>
                </dependencies>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <includes>
                        <include>**/*Test.class</include>
                        <include>**/*Tests.class</include>
                    </includes>
                    <excludes>
                        <exclude>**/Abstract*.class</exclude>
                    </excludes>
                    <forkMode>once</forkMode>
                    <junitArtifactName>org.junit:com.springsource.org.junit</junitArtifactName>
                </configuration>
            </plugin>
            <plugin>
                <!-- NOTE: all of the hoopla here with double running of bundlor is to deal with war archives -->
                <groupId>com.springsource.bundlor</groupId>
                <artifactId>com.springsource.bundlor.maven</artifactId>
                <version>${bundlor.version}</version>
                <executions>
                    <!-- run once to get a MANIFEST generated outside of the jar -->
                    <execution>
                        <id>eyeball</id>
                        <goals>
                            <goal>bundlor</goal>
                        </goals>
                        <phase>package</phase>
                        <!-- for now just re-write the final artifacts -->
                        <configuration>
                            <inputPath>${project.build.directory}/${project.build.finalName}.${project.packaging}</inputPath>
                            <!--<outputPath>${project.build.directory}/${project.build.finalName}.${project.packaging}</outputPath>-->
                        </configuration>
                    </execution>
                    <!-- run again to get manifest generated in a jar/war/etc -->
                    <execution>
                        <id>bundle</id>
                        <goals>
                            <goal>bundlor</goal>
                        </goals>
                        <phase>package</phase>
                        <!-- for now just re-write the final artifacts -->
                        <configuration>
                            <inputPath>${project.build.directory}/${project.build.finalName}.${project.packaging}</inputPath>
                            <outputPath>${project.build.directory}/${project.build.finalName}.${project.packaging}</outputPath>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <!-- todo - move repos out of poms - for example into settings.xml -->
    <!-- at issue would be upgrade of the master version - and all downstream projects would need to manually build or install master -->
    <repositories>
        <repository>
            <id>com.springsource.repository.bundles.release</id>
            <name>SpringSource Enterprise Bundle Repository - SpringSource Bundle Releases</name>
            <url>http://repository.springsource.com/maven/bundles/release</url>
        </repository>

        <repository>
            <id>com.springsource.repository.bundles.external</id>
            <name>SpringSource Enterprise Bundle Repository - External Bundle Releases</name>
            <url>http://repository.springsource.com/maven/bundles/external</url>
        </repository>
        <repository>
            <id>com.springsource.repository.libraries.release</id>
            <name>SpringSource Enterprise Bundle Repository - SpringSource Library Releases</name>
            <url>http://repository.springsource.com/maven/libraries/release</url>
        </repository>

        <repository>
            <id>com.springsource.repository.libraries.external</id>
            <name>SpringSource Enterprise Bundle Repository - External Library Releases</name>
            <url>http://repository.springsource.com/maven/libraries/external</url>
        </repository>
    </repositories>

    <pluginRepositories>
        <pluginRepository>
            <id>com.springsource.repository.bundles.release</id>
            <name>SpringSource Enterprise Bundle Repository - SpringSource Bundle Releases</name>
            <url>http://repository.springsource.com/maven/bundles/release</url>
        </pluginRepository>
    </pluginRepositories>
</project>

Attachment: maven-squashed.patch
Description: Binary data


Back to the top