maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <nickl...@planet.nl>
Subject RE: Ordering of compilation
Date Wed, 09 Jan 2008 10:14:59 GMT
> I am looking at building the initial java code in a separate module,
> then importing it and unpacking it as a dependency and then continuing
> with the build as previously designed, packing everything up in a single
> JAR at the end.

I would go for this way. Even not unpacking the dependency, but just stay dependent on it
at runtime.

> The reason for the mail is that I would like to avoid creating another
> module if possible, and was wondering if anyone had found a way in which
> the compilation plugin could be attached to a different phase of the
> build (as opposed to compile).

This is possible. You can configure another execution of the compiler plugin:
<build>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <executions>
            <execution>
              <id>compile-before-process-sources</id>
              <phase>generate-sources</phase>
              <goals><goal>compile</goal></goals>
              <configuration>
                  <excludes><exclude>**/**</exclude></excludes>
                  <includes><include>com/example/package</include></includes>
              </configuration>
            </execution>
        </executions>
        <configuration>
                  <excludes><exclude>com/example/package</exclude></excludes>
                  <includes><include>**/**</include></includes>
        </configuration>
      </plugin>
   </plugins>
</build>

Then bind your sqlj plugin to the process sources phase.

This is untested, but I guess with a little tweaking you can make it work.

Hth,

Nick Stolwijk

-----Original Message-----
From: Matthew Tordoff [mailto:matthew.tordoff@markit.com]
Sent: Wed 1/9/2008 10:50 AM
To: Maven Users List
Subject: Ordering of compilation
 
Hi all,
 
I have the need to impose a specific ordering of compilation of some
source code I have. I need to achieve the following:
 
1 - compile some Java
2 - translate SQLJ (dependent on above compilation)
3 - compile some further Java (dependent on translated SQLJ)
 
To translate the SQLJ I have created my own plugin which is attached to
the validate-sources phase of the build. All of my java code is not
building until the compile phase, and thus the build is breaking because
some of the code needs to have been built before the SQLJ translation.
 
I am looking at building the initial java code in a separate module,
then importing it and unpacking it as a dependency and then continuing
with the build as previously designed, packing everything up in a single
JAR at the end.
 
The reason for the mail is that I would like to avoid creating another
module if possible, and was wondering if anyone had found a way in which
the compilation plugin could be attached to a different phase of the
build (as opposed to compile).
 
I am also open to other suggestions as to how I may solve my problem.
 
Feedback would be greatly appreciated.
 
Regards,
 
Matt



The content of this e-mail is confidential and may be privileged. It may be read, copied and
used only by the intended recipient and may not be disclosed, copied or distributed. If you
received this email in error, please contact the sender immediately by return e-mail or by
telephoning +44 20 7260 2000, delete it and do not disclose its contents to any person. You
should take full responsibility for checking this email for viruses. Markit reserves the right
to monitor all e-mail communications through its network.
Markit and its affiliated companies make no warranty as to the accuracy or completeness of
any information contained in this message and hereby exclude any liability of any kind for
the information contained herein. Any opinions expressed in this message are those of the
author and do not necessarily reflect the opinions of Markit.
For full details about Markit, its offerings and legal terms and conditions, please see Markit's
website at http://www.markit.com <http://www.markit.com/> .


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message