RE: Accessing maven.compile.src.set and maven.final.name

2003-08-25 Thread dion
Leo Sutic [EMAIL PROTECTED] wrote on 23/08/2003 10:38:50 PM:

 Thanks, however I think that the torque plugin does things a bit
 differently than what I want to achieve. In particular:
 
  + Must be run explicitely, and not as a preGoal to java:compile.
Ok, so add your stuff as a preGoal to compile.

  + Generates into the src/java directory, and not a temporary directory:
 
 torque-data-model
   contextProperties=${torque.contextProperties}
   controlTemplate=${torque.template.om}
   outputDirectory=${torque.java.dir}
Bad for the torque plugin, not recommended


 If this is the only way to go with Maven then I'll just get with the
 program, but I was hoping for something better.
Nope. I think someone's already pointed out the antlr plugin.

 Another question: When specifying a java source path, can I specify
 multiple paths, i.e.:
 
 sourceDirectory${basedir}/src/java/sourceDirectory
 sourceDirectory${basedir}/src/my-generated-stuff/sourceDirectory
No.

 or:
 sourceDirectory${basedir}/src/java;${basedir}/src/my-generated-
 stuff/sourceDirectory
No.

--
dIon Gillard, Multitask Consulting
Blog:  http://blogs.codehaus.org/people/dion/




Accessing maven.compile.src.set and maven.final.name

2003-08-23 Thread Leo Sutic
Hi all,

I have been trying Maven for the past week, and come up against two major
difficulties:


CODE GENERATOR
--
I have a code-generator task written for Ant that I'm trying to turn into
a Maven plugin. Since it is a code generator, I need to do the following:

 1. Run the code generator.

 2. Compile the java source files and the files generated in step (1).

I thought that defining a preoal for java:compile would do the trick, and
this actually worked:

 1. Use the maven.compile.src.set path to find source files, and feed
these to the code generator.

 2. The code generator uses the maven.build.dir property to output a
temporary source tree to ${maven.build.dir}/generated

 3. Add the ${maven.build.dir}/generated path to the maven.compile.src.set
path via maven:addPath/.

Then the java:compile goal will kick in and compile the original java
source files along with the newly generated ones. So far so good, then -
but then I moved the above code into a plugin (I had had it in the
maven.xml of my project first), and suddenly I discovered the following:

 + maven.compile.src.set no longer available.

 + Adding the ${maven.build.dir}/generated path to the
maven.compile.src.set path via maven:addPath/ doesn't work. When
java:compile kicks in the change has been rolled back.

So my questions are:

 1. How can I access the maven.compile.src.set property from a plugin?

 2. How can I modify the maven.compile.src.set property from a plugin?


JAR TOOL

I also have a tool that operates on the produced JAR file. So I defined a
postGoal for jar:jar, and figured I'd use the
${maven.build.dir}/${maven.final.name}.jar path to find the jar that was
just produced. However, this turned out not to work in the case when
jar:jar was called from jar:snapshot. The j:set/ done in jar:snapshot to
set the jar's name to the snapshotSignature isn't visible from the
postGoal.

So my questions are:

 1. Is there an easy way to add any post-processing of the jar file
created by jar:jar?

 2. Is there any way to find out the path of the jar created in jar:jar?

/LS

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



Re: Accessing maven.compile.src.set and maven.final.name

2003-08-23 Thread Jason van Zyl
On Sat, 2003-08-23 at 06:49, Leo Sutic wrote:
 Hi all,
 
 I have been trying Maven for the past week, and come up against two major
 difficulties:
 
 
 CODE GENERATOR
 --
 I have a code-generator task written for Ant that I'm trying to turn into
 a Maven plugin. Since it is a code generator, I need to do the following:
 
  1. Run the code generator.
 
  2. Compile the java source files and the files generated in step (1).
 
 I thought that defining a preoal for java:compile would do the trick, and
 this actually worked:
 
  1. Use the maven.compile.src.set path to find source files, and feed
 these to the code generator.
 
  2. The code generator uses the maven.build.dir property to output a
 temporary source tree to ${maven.build.dir}/generated
 
  3. Add the ${maven.build.dir}/generated path to the maven.compile.src.set
 path via maven:addPath/.
 
 Then the java:compile goal will kick in and compile the original java
 source files along with the newly generated ones. So far so good, then -
 but then I moved the above code into a plugin (I had had it in the
 maven.xml of my project first), and suddenly I discovered the following:
 
  + maven.compile.src.set no longer available.
 
  + Adding the ${maven.build.dir}/generated path to the
 maven.compile.src.set path via maven:addPath/ doesn't work. When
 java:compile kicks in the change has been rolled back.
 
 So my questions are:
 
  1. How can I access the maven.compile.src.set property from a plugin?
 
  2. How can I modify the maven.compile.src.set property from a plugin?

Look at the antlr plugin, there are examples of modifying
maven.compile.src.set. Basically antlr generates the specified sources
from a grammar and then appends the path containing the generated
sources to maven.compile.src.set.

 
 JAR TOOL
 
 I also have a tool that operates on the produced JAR file. So I defined a
 postGoal for jar:jar, and figured I'd use the
 ${maven.build.dir}/${maven.final.name}.jar path to find the jar that was
 just produced. However, this turned out not to work in the case when
 jar:jar was called from jar:snapshot. The j:set/ done in jar:snapshot to
 set the jar's name to the snapshotSignature isn't visible from the
 postGoal.
 
 So my questions are:
 
  1. Is there an easy way to add any post-processing of the jar file
 created by jar:jar?

You can do a postGoal. Do you want to modify the contents before the JAR
is produced? Or didn't the JAR once it has been produced?

  2. Is there any way to find out the path of the jar created in jar:jar?

It is always:

 basedir/target/${pom.artifactId}-${pom.currentVersion}.jar


 /LS
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
-- 
jvz.

Jason van Zyl
[EMAIL PROTECTED]
http://tambora.zenplex.org

In short, man creates for himself a new religion of a rational
and technical order to justify his work and to be justified in it.
  
  -- Jacques Ellul, The Technological Society


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



RE: Accessing maven.compile.src.set and maven.final.name

2003-08-23 Thread Leo Sutic
On Sat, 23 Aug 2003, O'Fallon, Paul (MAN-Corporate) wrote:
 ...

Thanks!

/LS

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