RE: Ordering of compilation

2008-01-09 Thread nicklist
In your plugin you have to start working with the maven api. To get the compile 
time dependencies as class path elements (like the compiler plugin) you would 
use project.getCompileClasspathElements(). To get the test compile as class 
path elements it would be project.getTestClasspathElements().

To get the project inside your plugin, use:

/**
 * @parameter expression="${project}"
private Project project;

To get the compile class elements directly, use:

/**
 * Project classpath.
 *
 * @parameter expression="${project.compileClasspathElements}"
 * @required
 * @readonly
 */
private List classpathElements; 

This list you have to inject in your SQLJ compiler.

Take a look at the maven-compiler-plugin source code [1]. I guess it is almost 
the same as what you're trying to do.

It works with the plexus-compiler-javac [2] and plexus-utils [3] and then 
especially the cli tools. [4]


[1] http://svn.apache.org/viewvc/maven/plugins/trunk/maven-compiler-plugin/
[2] 
https://svn.codehaus.org/plexus/plexus-components/trunk/plexus-compiler/plexus-compilers/plexus-compiler-javac/
[3] https://svn.codehaus.org/plexus/plexus-utils/trunk/
[4] 
https://svn.codehaus.org/plexus/plexus-utils/trunk/src/main/java/org/codehaus/plexus/util/cli/

I hope you have some more information to create your plugin.

With regards,

Nick Stolwijk

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

I have switched to your approach and do as follows:

Module 1: build first java package
Module 2: translate SQLJ and build second java package (with module 1
listed as a dependency within the pom)

However, whatever I seem to do, my SQLJ plugin doesn't seem to be able
to find the module1.jar on the classpath. When I echo the class path
(System.getProperty("java.class.path")) from within the plugin code at
runtime all I get is the following:

c:\maven-2.0.7/boot/classworlds-1.1.jar

Which as you can see isn't the most helpful. Do you know how to display
a list of all the actual jars which are being included in the classpath,
or do you have any other suggestions as to what might be going wrong
(incorrect installation of PLSQL packages maybe?).

Regards,

Matt

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

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:


  
maven-compiler-plugin


RE: Ordering of compilation

2008-01-09 Thread Matthew Tordoff
Hi Nick,

I have switched to your approach and do as follows:

Module 1: build first java package
Module 2: translate SQLJ and build second java package (with module 1
listed as a dependency within the pom)

However, whatever I seem to do, my SQLJ plugin doesn't seem to be able
to find the module1.jar on the classpath. When I echo the class path
(System.getProperty("java.class.path")) from within the plugin code at
runtime all I get is the following:

c:\maven-2.0.7/boot/classworlds-1.1.jar

Which as you can see isn't the most helpful. Do you know how to display
a list of all the actual jars which are being included in the classpath,
or do you have any other suggestions as to what might be going wrong
(incorrect installation of PLSQL packages maybe?).

Regards,

Matt

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

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:


  
maven-compiler-plugin


  compile-before-process-sources
  generate-sources
  compile
  
  **/**
 
com/example/package
  



 
com/example/package
  **/**

  
   


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 

RE: Ordering of compilation

2008-01-09 Thread nicklist
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:


  
maven-compiler-plugin


  compile-before-process-sources
  generate-sources
  compile
  
  **/**
 
com/example/package
  



 
com/example/package
  **/**

  
   


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

RE: Ordering of compilation

2008-01-09 Thread nicklist
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:


  
maven-compiler-plugin


  compile-before-process-sources
  generate-sources
  compile
  
  **/**
 
com/example/package
  



 
com/example/package
  **/**

  
   


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 i

RE: Ordering of compilation

2008-01-09 Thread Matthew Tordoff
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:


  
maven-compiler-plugin


  compile-before-process-sources
  generate-sources
  compile
  
  **/**
 
com/example/package
  



 
com/example/package
  **/**

  
   


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

RE: Ordering of compilation

2008-01-09 Thread nicklist
> 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:


  
maven-compiler-plugin


  compile-before-process-sources
  generate-sources
  compile
  
  **/**
  com/example/package
  



  com/example/package
  **/**

  
   


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  .