As an afterthought, I would still recommend two modules:

module 1: compile and process-classes (which is a phase, to bind your sqlj 
plugin to)
module 2: dependency on module 1 and compile

This is much easier to understand for other developers and inline with the 
maven thought.

Hth,

Nick Stolwijk

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Wed 1/9/2008 1:17 PM
To: Maven Users List
Subject: RE: Ordering of compilation
 
The target/classes directory is in the classpath (check with mvn -X clean 
compile). Did you generate classes or java files? If you generated classes they 
should be in target/classes, if you generated java files, you'll need the 
maven-build-helper-plugin [1].

Hth,

Nick Stolwijk

[1] http://mojo.codehaus.org/build-helper-maven-plugin/index.html

-----Original Message-----
From: Matthew Tordoff [mailto:[EMAIL PROTECTED]
Sent: Wed 1/9/2008 12:30 PM
To: Maven Users List
Subject: RE: Ordering of compilation
 
Hi Nick,

Thanks for your response. I actually decided to follow your second
option of configuring a second execution of the compiler plugin. The
only problem is that when the build gets to the main compilation it
doesn't appear to have the target folder on the classpath and thus can't
find the code I compiled in the generate-sources phase. I know that you
can pass command-line arguments to the compiler, but I would want to
append to the classpath and not overwrite it completely. Do you have any
ideas for a solution?

Thanks again,

Matt 

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: 09 January 2008 10:15
To: Maven Users List
Subject: RE: Ordering of compilation

> 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:[EMAIL PROTECTED]
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/> .




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/> .

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to