Changeset 15588


Ignore:
Timestamp:
05/23/22 06:23:46 (10 months ago)
Author:
Mark Evenson
Message:

build: can now use Maven to build

The basic assembly of <file:dist/abcl.jar> now works, although these
aren't completely hooked up to Maven's notion of output artifacts.

TODO:

We aren't really intercepting maven-jar-plugin default-jar goal
correctly, so the resulting <file:build/abcl-1.6.x-SNAPSHOT.jar>
artifact doesn't contain all artifacts. We probably need to correctly
define our resources to Maven, but they are currently expressed as
various Ant properties, so we need to slave the Maven goals to
appropiate Ant tasks?

Maven really wants to create all output under a single directory,
while the Ant recipe puts intermediate artifacts under <file:build/>
and final results in <file:dist/>.

Need to somehow encapsulate the existence of
<file:dist/abcl-contrib.jar> within the <file:contrib/pom.xml> Maven
description, even though its build is part of the Ant abcl.jar task.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/abcl/pom.xml

    r15476 r15588  
    22<project
    33   xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
    4    xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    5 
    6   <!-- NOT USABLE FOR BUILDS, only for installing into a repository! -->
     4   xmlns="http://maven.apache.org/POM/4.0.0"
     5   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    76
    87  <modelVersion>4.0.0</modelVersion>
     
    5857    </developer>
    5958  </developers>
    60   <dependencies />
     59  <dependencies/>
     60  <build>
     61    <directory>${project.basedir}/build</directory>
     62    <sourceDirectory>${project.basedir}/src</sourceDirectory>
     63    <plugins>
     64      <plugin>
     65  <artifactId>maven-antrun-plugin</artifactId>
     66  <version>3.0.0</version>
     67  <!-- <https://stackoverflow.com/questions/34713222/wrapping-ant-in-maven-java-home-points-to-the-jre-but-works-with-just-ant> -->
     68  <!-- Since tools.jar doesn't exist post-openjdk8, this isn't
     69       gonna work everywhere -->
     70  <dependencies>
     71    <dependency>
     72      <groupId>com.sun</groupId>
     73      <artifactId>tools</artifactId>
     74      <version>1.5.0</version>
     75      <scope>system</scope>
     76      <systemPath>${java.home}/../lib/tools.jar</systemPath>
     77    </dependency>
     78  </dependencies>
     79  <executions>
     80    <execution>
     81      <id>clean</id>
     82      <phase>clean</phase>
     83      <configuration>
     84        <target>
     85    <ant antfile="build.xml" target="abcl.clean"/>
     86        </target>
     87      </configuration>
     88      <goals>
     89        <goal>run</goal>
     90      </goals>     
     91    </execution>
     92    <execution>
     93      <id>compile</id>
     94      <phase>compile</phase>
     95      <configuration>
     96        <target>
     97    <ant antfile="build.xml" target="abcl.compile"/>
     98        </target>
     99      </configuration>
     100      <goals>
     101        <goal>run</goal>
     102      </goals>     
     103    </execution>
     104    <execution>
     105      <id>package</id>
     106      <phase>package</phase>
     107      <configuration>
     108        <target>
     109    <ant antfile="build.xml" target="abcl.jar"/>
     110        </target>
     111      </configuration>
     112      <goals>
     113        <goal>run</goal>
     114      </goals>     
     115    </execution>
     116  </executions>
     117      </plugin>
     118    </plugins>
     119  </build>
    61120</project>
Note: See TracChangeset for help on using the changeset viewer.