You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Lee Meador <Le...@aa.com> on 2005/11/17 00:09:10 UTC

[m2] Generating Source in Ant

I've scanned the last couple of weeks' messages and I think I see what
is happening.

I have an ant task that generates java from a wsdl using Websphere 6.0's
ant tasks to do so. It's similar to the Axis ones.

I have it generate the java into target/generated-sources/java.

The generated code doesn't get compiled when I do a 

mvn compile

I think the problem is that generated-sources doesn't get added to the
compileSourceRoots since they are being generated in ant.

So ... can I run some useless plugin with no input and get the
generated-sources added to the list of roots? Is there some other way to
get it to look there?

Thanks.

-- Lee Meador


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: [m2] Generating Source in Ant

Posted by Jesse McConnell <je...@gmail.com>.
doh, my bad...I just check on that it is readonly...don't mind me :P

On 11/16/05, Jesse McConnell <je...@gmail.com> wrote:
>
> could also add it to the compiler plugin's source root directly by
> declaring the maven-compiler-plugin in the pom and setting
> compileSourceRoots in the pluign's configuration.
>
> but that is potentially messy since you'll be overriding any others that
> might be set in that project...and not as clean as wrapping that generated
> java in a mojo, so bretts approach is definitely the better one...but in a
> pinch you might be able to get away with putting an entry in that
> compileSourceRoots list.
>
> jesse
>
> On 11/16/05, Brett Porter <br...@gmail.com> wrote:
> >
> > I'd recommend writing the plugin in Java and calling the Ant task
> > using the Java API, then add the source root. This would help to
> > encapsulate the functionality.
> >
> > - Brett
> >
> > On 11/17/05, Lee Meador < Lee.Meador@aa.com> wrote:
> > > I've scanned the last couple of weeks' messages and I think I see what
> > > is happening.
> > >
> > > I have an ant task that generates java from a wsdl using Websphere 6.0's
> >
> > > ant tasks to do so. It's similar to the Axis ones.
> > >
> > > I have it generate the java into target/generated-sources/java.
> > >
> > > The generated code doesn't get compiled when I do a
> > >
> > > mvn compile
> > >
> > > I think the problem is that generated-sources doesn't get added to the
> > > compileSourceRoots since they are being generated in ant.
> > >
> > > So ... can I run some useless plugin with no input and get the
> > > generated-sources added to the list of roots? Is there some other way
> > to
> > > get it to look there?
> > >
> > > Thanks.
> > >
> > > -- Lee Meador
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > > For additional commands, e-mail: users-help@maven.apache.org
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
>
>
> --
> jesse mcconnell




--
jesse mcconnell

Re: [m2] Generating Source in Ant

Posted by Jesse McConnell <je...@gmail.com>.
could also add it to the compiler plugin's source root directly by declaring
the maven-compiler-plugin in the pom and setting compileSourceRoots in the
pluign's configuration.

but that is potentially messy since you'll be overriding any others that
might be set in that project...and not as clean as wrapping that generated
java in a mojo, so bretts approach is definitely the better one...but in a
pinch you might be able to get away with putting an entry in that
compileSourceRoots list.

jesse

On 11/16/05, Brett Porter <br...@gmail.com> wrote:
>
> I'd recommend writing the plugin in Java and calling the Ant task
> using the Java API, then add the source root. This would help to
> encapsulate the functionality.
>
> - Brett
>
> On 11/17/05, Lee Meador <Le...@aa.com> wrote:
> > I've scanned the last couple of weeks' messages and I think I see what
> > is happening.
> >
> > I have an ant task that generates java from a wsdl using Websphere 6.0's
> > ant tasks to do so. It's similar to the Axis ones.
> >
> > I have it generate the java into target/generated-sources/java.
> >
> > The generated code doesn't get compiled when I do a
> >
> > mvn compile
> >
> > I think the problem is that generated-sources doesn't get added to the
> > compileSourceRoots since they are being generated in ant.
> >
> > So ... can I run some useless plugin with no input and get the
> > generated-sources added to the list of roots? Is there some other way to
> > get it to look there?
> >
> > Thanks.
> >
> > -- Lee Meador
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


--
jesse mcconnell

Re: [m2] Generating Source in Ant

Posted by Brett Porter <br...@gmail.com>.
You can't extend java mojos from other plugins - none of the metadata
is populated. That's why you end up with a nullpointer in the base
classes.

What I said earlier was to use the Ant Java API to run the task (so
nothing to do with the ant run plugin).

http://ant.apache.org/manual/antexternal.html

- Brett

On 11/18/05, Lee Meador <le...@gmail.com> wrote:
> I have this source:
>
> /**
> * Goal which runs ant and then adds some path to the compile source root
> list
> *
> * @goal run
> * @phase generate-sources
> * @description Run ant and then add a folder to the list of places that hold
> * code to compile
> */
> public class AntRunAddGenerateMojo extends AntRunMojo {
>
> /**
> * The Maven project.
> *
> * @parameter expression="${project}"
> * @required
> * @readonly
> */
> private MavenProject project;
>
> /**
> * Where the source files were put by the ant task
> *
> * @parameter expression="${project.build.directory}/generated-sources/java"
> * @required
> */
> private String compileSourceRoot;
>
> public void execute() throws MojoExecutionException {
> getLog().info("enter execute()");
> super.execute();
> getLog().info("add compileSourceRoot: " + compileSourceRoot);
> project.addCompileSourceRoot(compileSourceRoot);
> getLog().info("exit execute()");
> }
> }
>
> And I get this error:
>
> [INFO] task-segment: [compile]
> [INFO]
> ----------------------------------------------------------------------------
> [INFO] [ant-generate:run {execution: default}]
> [INFO] enter execute()
> [INFO]
> ----------------------------------------------------------------------------
> [ERROR] BUILD ERROR
> [INFO]
> ----------------------------------------------------------------------------
> [INFO] Error executing ant tasks
>
> [INFO]
> ----------------------------------------------------------------------------
> [INFO] Trace
> org.apache.maven.lifecycle.LifecycleExecutionException: Error executing ant
> tasks
> at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(
> DefaultLifecycleExecutor.java:544)
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle
> (DefaultLifecycleExecutor.java:469)
> at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(
> DefaultLifecycleExecutor.java:448)
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures
> (DefaultLifecycleExecutor.java:301)
> at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(
> DefaultLifecycleExecutor.java:268)
> at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(
> DefaultLifecycleExecutor.java:137)
> at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:316)
> at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:113)
> at org.apache.maven.cli.MavenCli.main(MavenCli.java:249)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java
> :39)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(
> DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:585)
> at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
> at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
> at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
>
> at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
> Caused by: org.apache.maven.plugin.MojoExecutionException: Error executing
> ant tasks
> at org.apache.maven.plugin.antrun.AbstractAntMojo.executeTasks(
> AbstractAntMojo.java:77)
> at org.apache.maven.plugin.antrun.AntRunMojo.execute(AntRunMojo.java:72)
>
> at com.aa.inflightsales.maven.AntRunAddGenerateMojo.execute(
> AntRunAddGenerateMojo.java:52)
> at org.apache.maven.plugin.DefaultPluginManager.executeMojo(
> DefaultPluginManager.java:399)
> at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(
> DefaultLifecycleExecutor.java:519)
> ... 16 more
> Caused by: java.lang.NullPointerException
> at org.apache.maven.plugin.antrun.AbstractAntMojo.executeTasks(
> AbstractAntMojo.java:42)
> ... 20 more
> [INFO]
> ----------------------------------------------------------------------------
> [INFO] Total time: 3 seconds
> [INFO] Finished at: Thu Nov 17 12:36:57 CST 2005
> [INFO] Final Memory: 4M/8M
> [INFO]
> ----------------------------------------------------------------------------
>
> I have no idea how to start looking at this. Do you have any strategies for
> me?
>
> Thanks.
>
> -- Lee Meador
>
> On 11/16/05, Brett Porter <br...@gmail.com> wrote:
> >
> > I'd recommend writing the plugin in Java and calling the Ant task
> > using the Java API, then add the source root. This would help to
> > encapsulate the functionality.
> >
> > - Brett
> >
> > On 11/17/05, Lee Meador <Le...@aa.com> wrote:
> > > I've scanned the last couple of weeks' messages and I think I see what
> > > is happening.
> > >
> > > I have an ant task that generates java from a wsdl using Websphere 6.0's
> > > ant tasks to do so. It's similar to the Axis ones.
> > >
> > > I have it generate the java into target/generated-sources/java.
> > >
> > > The generated code doesn't get compiled when I do a
> > >
> > > mvn compile
> > >
> > > I think the problem is that generated-sources doesn't get added to the
> > > compileSourceRoots since they are being generated in ant.
> > >
> > > So ... can I run some useless plugin with no input and get the
> > > generated-sources added to the list of roots? Is there some other way to
> > > get it to look there?
> > >
> > > Thanks.
> > >
> > > -- Lee Meador
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > > For additional commands, e-mail: users-help@maven.apache.org
> > >
> > >
> >
> >
>
>
> --
> -- Lee Meador
> Sent from gmail. My real email address is lee@leemeador.com
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: [m2] Generating Source in Ant

Posted by Lee Meador <le...@gmail.com>.
Well ... its finally in Jira.

  URL: http://jira.codehaus.org/browse/MNG-1660

There are changes to the javadocs and usage.xdoc. No changes to code, only
the docs.

-- Lee Meador

On 11/21/05, Brett Porter <br...@gmail.com> wrote:
>
> We're working on splitting them out, but for now all the issues are in
> MNG. So if you go there, and select "Create new Issue" from the top,
> it will preselect the project "Maven 2" from the dropdown (or you can
> do that manually).
>
> On the second screen, select maven-antrun-plugin in the components and
> fill in the other fields as appropriate.
>
> Hope this helps.
> Brett
>
> On 11/22/05, Lee Meador <le...@gmail.com> wrote:
> > If I go here:
> >
> > http://jira.codehaus.org/secure/Dashboard.jspa
> >
> > There is no maven-antrun-plugin project. All the other maven plugins
> seem to
> > be there. But if I go to:
> >
> >
> http://jira.codehaus.org/browse/MNG?report=com.atlassian.jira.plugin.system.project:openissues-panel
> >
> > (I got there by picking the maven2 project on the previous page and then
> > clicking the "open issues" tab.)
> >
> > Any way .. on that page it shows 3 issues unter maven-antrun-plugin.
> >
> > How do I add a Jira issue in this case? Are there more instructions
> > anywhere?
> >
> > thanks
> >
> > -- Lee Meador
> >
> > On 11/18/05, Brett Porter <br...@gmail.com> wrote:
> > >
> > > Thanks for this!
> > >
> > > On 11/19/05, Lee Meador <le...@gmail.com> wrote:
> > > > 1) Create an email
> > > > 2) Put a commit message in it
> > > > 3) Put some sort of special subject on it
> > > > 4) Attach the patch file to it or maybe include the patch as part of
> the
> > > > text of the email.
> > > >
> > > > Where do I send this email?
> > > > What should the subject look like?
> > > > Does the patch file get attached or included?
> > >
> > > I can see how that's confusing. I'd reword it as:
> > > "Attach the patch file to the jira issue (create a new one if you are
> > > working on a new issue), with a brief comment explaining what the
> > > patch does"
> > >
> > > We really prefer it sent to jira as an attached file as it is much
> > > easier to track and apply.
> > >
> > > Thanks again!
> > >
> > > Cheers,
> > > Brett
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > > For additional commands, e-mail: users-help@maven.apache.org
> > >
> > >
> >
> >
> > --
> > -- Lee Meador
> > Sent from gmail. My real email address is lee@leemeador.com
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


--
-- Lee Meador
Sent from gmail. My real email address is lee@leemeador.com

Re: [m2] Generating Source in Ant

Posted by Brett Porter <br...@gmail.com>.
We're working on splitting them out, but for now all the issues are in
MNG. So if you go there, and select "Create new Issue" from the top,
it will preselect the project "Maven 2" from the dropdown (or you can
do that manually).

On the second screen, select maven-antrun-plugin in the components and
fill in the other fields as appropriate.

Hope this helps.
Brett

On 11/22/05, Lee Meador <le...@gmail.com> wrote:
> If I go here:
>
> http://jira.codehaus.org/secure/Dashboard.jspa
>
> There is no maven-antrun-plugin project. All the other maven plugins seem to
> be there. But if I go to:
>
> http://jira.codehaus.org/browse/MNG?report=com.atlassian.jira.plugin.system.project:openissues-panel
>
> (I got there by picking the maven2 project on the previous page and then
> clicking the "open issues" tab.)
>
> Any way .. on that page it shows 3 issues unter maven-antrun-plugin.
>
> How do I add a Jira issue in this case? Are there more instructions
> anywhere?
>
> thanks
>
> -- Lee Meador
>
> On 11/18/05, Brett Porter <br...@gmail.com> wrote:
> >
> > Thanks for this!
> >
> > On 11/19/05, Lee Meador <le...@gmail.com> wrote:
> > > 1) Create an email
> > > 2) Put a commit message in it
> > > 3) Put some sort of special subject on it
> > > 4) Attach the patch file to it or maybe include the patch as part of the
> > > text of the email.
> > >
> > > Where do I send this email?
> > > What should the subject look like?
> > > Does the patch file get attached or included?
> >
> > I can see how that's confusing. I'd reword it as:
> > "Attach the patch file to the jira issue (create a new one if you are
> > working on a new issue), with a brief comment explaining what the
> > patch does"
> >
> > We really prefer it sent to jira as an attached file as it is much
> > easier to track and apply.
> >
> > Thanks again!
> >
> > Cheers,
> > Brett
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
>
>
> --
> -- Lee Meador
> Sent from gmail. My real email address is lee@leemeador.com
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: [m2] Generating Source in Ant

Posted by Lee Meador <le...@gmail.com>.
If I go here:

http://jira.codehaus.org/secure/Dashboard.jspa

There is no maven-antrun-plugin project. All the other maven plugins seem to
be there. But if I go to:

http://jira.codehaus.org/browse/MNG?report=com.atlassian.jira.plugin.system.project:openissues-panel

(I got there by picking the maven2 project on the previous page and then
clicking the "open issues" tab.)

Any way .. on that page it shows 3 issues unter maven-antrun-plugin.

How do I add a Jira issue in this case? Are there more instructions
anywhere?

thanks

-- Lee Meador

On 11/18/05, Brett Porter <br...@gmail.com> wrote:
>
> Thanks for this!
>
> On 11/19/05, Lee Meador <le...@gmail.com> wrote:
> > 1) Create an email
> > 2) Put a commit message in it
> > 3) Put some sort of special subject on it
> > 4) Attach the patch file to it or maybe include the patch as part of the
> > text of the email.
> >
> > Where do I send this email?
> > What should the subject look like?
> > Does the patch file get attached or included?
>
> I can see how that's confusing. I'd reword it as:
> "Attach the patch file to the jira issue (create a new one if you are
> working on a new issue), with a brief comment explaining what the
> patch does"
>
> We really prefer it sent to jira as an attached file as it is much
> easier to track and apply.
>
> Thanks again!
>
> Cheers,
> Brett
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


--
-- Lee Meador
Sent from gmail. My real email address is lee@leemeador.com

Re: [m2] Generating Source in Ant

Posted by Brett Porter <br...@gmail.com>.
Thanks for this!

On 11/19/05, Lee Meador <le...@gmail.com> wrote:
> 1) Create an email
> 2) Put a commit message in it
> 3) Put some sort of special subject on it
> 4) Attach the patch file to it or maybe include the patch as part of the
> text of the email.
>
> Where do I send this email?
> What should the subject look like?
> Does the patch file get attached or included?

I can see how that's confusing. I'd reword it as:
"Attach the patch file to the jira issue (create a new one if you are
working on a new issue), with a brief comment explaining what the
patch does"

We really prefer it sent to jira as an attached file as it is much
easier to track and apply.

Thanks again!

Cheers,
Brett

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: [m2] Generating Source in Ant

Posted by Lee Meador <le...@gmail.com>.
So, I have done the following:

1) Changed the .java file to add some descriptions to the parameters
2) Changed the xdoc file to add some more description about the two
otherwise unmentioned tags.
3) Used svn to create a patch file that shows the changes.
4) Given it a name with XXX as the issue number because I don't have time
today to figure out Jira.

Now, as best I can decipher from the docs, I need to:

1) Create an email
2) Put a commit message in it
3) Put some sort of special subject on it
4) Attach the patch file to it or maybe include the patch as part of the
text of the email.

Where do I send this email?
What should the subject look like?
Does the patch file get attached or included?

Thanks.

-- Lee Meador

On 11/17/05, Brett Porter <br...@gmail.com> wrote:
>
> To edit this page:
> http://maven.apache.org/plugins/maven-antrun-plugin/run-mojo.html
>
> you edit the javadoc descriptions here:
>
> https://svn.apache.org/repos/asf/maven/plugins/trunk/maven-antrun-plugin/src/main/java/org/apache/maven/plugin/antrun/AntRunMojo.java
>
> To edit this page:
> http://maven.apache.org/plugins/maven-antrun-plugin/usage.html
>
> You would edit:
>
> https://svn.apache.org/repos/asf/maven/plugins/trunk/maven-antrun-plugin/src/site/apt/usage.apt
>
> As you can see, it is very straightforward. To generate the
> documentation, run "mvn site" and look at target/site/index.html.
>
> Here is info on how to submit it and more:
>
> http://maven.apache.org/guides/development/guide-m2-development.html#Creating%20and%20submitting%20a%20patch
>
> HTH,
> Brett
>
> On 11/18/05, Lee Meador <le...@gmail.com> wrote:
> > Thanks for the help. It seems to be working for me.
> >
> > http://maven.apache.org/plugins/maven-antrun-plugin/run-mojo.html
> >
> > Thats where it tells about the config stuff for the antrun plugin.
> >
> > The testSourceRoot attribute is missing and there is no description on
> the
> > others.
> >
> > I'm willing to think about fixing such a thing in the documentation but
> have
> > no clue how to do so. I could spend an hour or two on it including ramp
> up
> > time. So ... since I'm counting the cost ... what is the cost in time to
> do
> > this. I guess I need to know before volunteering.
> >
> > Thanks.
> >
> > -- Lee Meador
> >
> > On 11/17/05, Brett Porter <br...@gmail.com> wrote:
> > >
> > > On 11/18/05, Lee Meador <le...@gmail.com> wrote:
> > > > 1) It took me a while to find and load the plugin sources. I found
> no
> > > > reference in the docs. The page that tells how to build the source
> does
> > > not
> > > > load the plugin source from subversion. Its at:
> > > >
> > > > http://maven.apache.org/guides/development/guide-building-m2.html
> > >
> > > My bad - I moved it and haven't gotten to update that page yet.
> > >
> > > > Then I just use the <sourceRoot> tag (or <testSourceRoot> for test
> code)
> > > to
> > > > tell maven2 to compile the stuff in the folder that I put in there.
> I
> > > don't
> > > > know if you can put more than one relative path in there. I doubt it
> but
> > > > don't understand the implications of what's in the java source very
> > > well.
> > >
> > > Neat. This also needs to be documented, as does the
> > > .dependency.classpath feature and the inclusion of optional task
> > > dependencies inside the plugin tag. Anyone?
> > >
> > > > Question: Is there a way to parameterize the folder in that tag so
> that
> > > I
> > > > don't put "target" but put something that will use whatever the
> build
> > > > directory should be?
> > >
> > > ${project.build.directory}
> > >
> > > Cheers,
> > > Brett
> > >
> > >
> >
> >
> > --
> > -- Lee Meador
> > Sent from gmail. My real email address is lee@leemeador.com
> >
> >
>
>


--
-- Lee Meador
Sent from gmail. My real email address is lee@leemeador.com

Re: [m2] Generating Source in Ant

Posted by Brett Porter <br...@gmail.com>.
To edit this page:
http://maven.apache.org/plugins/maven-antrun-plugin/run-mojo.html

you edit the javadoc descriptions here:
https://svn.apache.org/repos/asf/maven/plugins/trunk/maven-antrun-plugin/src/main/java/org/apache/maven/plugin/antrun/AntRunMojo.java

To edit this page:
http://maven.apache.org/plugins/maven-antrun-plugin/usage.html

You would edit:
https://svn.apache.org/repos/asf/maven/plugins/trunk/maven-antrun-plugin/src/site/apt/usage.apt

As you can see, it is very straightforward. To generate the
documentation, run "mvn site" and look at target/site/index.html.

Here is info on how to submit it and more:
http://maven.apache.org/guides/development/guide-m2-development.html#Creating%20and%20submitting%20a%20patch

HTH,
Brett

On 11/18/05, Lee Meador <le...@gmail.com> wrote:
> Thanks for the help. It seems to be working for me.
>
> http://maven.apache.org/plugins/maven-antrun-plugin/run-mojo.html
>
> Thats where it tells about the config stuff for the antrun plugin.
>
> The testSourceRoot attribute is missing and there is no description on the
> others.
>
> I'm willing to think about fixing such a thing in the documentation but have
> no clue how to do so. I could spend an hour or two on it including ramp up
> time. So ... since I'm counting the cost ... what is the cost in time to do
> this. I guess I need to know before volunteering.
>
> Thanks.
>
> -- Lee Meador
>
> On 11/17/05, Brett Porter <br...@gmail.com> wrote:
> >
> > On 11/18/05, Lee Meador <le...@gmail.com> wrote:
> > > 1) It took me a while to find and load the plugin sources. I found no
> > > reference in the docs. The page that tells how to build the source does
> > not
> > > load the plugin source from subversion. Its at:
> > >
> > > http://maven.apache.org/guides/development/guide-building-m2.html
> >
> > My bad - I moved it and haven't gotten to update that page yet.
> >
> > > Then I just use the <sourceRoot> tag (or <testSourceRoot> for test code)
> > to
> > > tell maven2 to compile the stuff in the folder that I put in there. I
> > don't
> > > know if you can put more than one relative path in there. I doubt it but
> > > don't understand the implications of what's in the java source very
> > well.
> >
> > Neat. This also needs to be documented, as does the
> > .dependency.classpath feature and the inclusion of optional task
> > dependencies inside the plugin tag. Anyone?
> >
> > > Question: Is there a way to parameterize the folder in that tag so that
> > I
> > > don't put "target" but put something that will use whatever the build
> > > directory should be?
> >
> > ${project.build.directory}
> >
> > Cheers,
> > Brett
> >
> >
>
>
> --
> -- Lee Meador
> Sent from gmail. My real email address is lee@leemeador.com
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: [m2] Generating Source in Ant

Posted by Lee Meador <le...@gmail.com>.
Thanks for the help. It seems to be working for me.

http://maven.apache.org/plugins/maven-antrun-plugin/run-mojo.html

Thats where it tells about the config stuff for the antrun plugin.

The testSourceRoot attribute is missing and there is no description on the
others.

I'm willing to think about fixing such a thing in the documentation but have
no clue how to do so. I could spend an hour or two on it including ramp up
time. So ... since I'm counting the cost ... what is the cost in time to do
this. I guess I need to know before volunteering.

Thanks.

-- Lee Meador

On 11/17/05, Brett Porter <br...@gmail.com> wrote:
>
> On 11/18/05, Lee Meador <le...@gmail.com> wrote:
> > 1) It took me a while to find and load the plugin sources. I found no
> > reference in the docs. The page that tells how to build the source does
> not
> > load the plugin source from subversion. Its at:
> >
> > http://maven.apache.org/guides/development/guide-building-m2.html
>
> My bad - I moved it and haven't gotten to update that page yet.
>
> > Then I just use the <sourceRoot> tag (or <testSourceRoot> for test code)
> to
> > tell maven2 to compile the stuff in the folder that I put in there. I
> don't
> > know if you can put more than one relative path in there. I doubt it but
> > don't understand the implications of what's in the java source very
> well.
>
> Neat. This also needs to be documented, as does the
> .dependency.classpath feature and the inclusion of optional task
> dependencies inside the plugin tag. Anyone?
>
> > Question: Is there a way to parameterize the folder in that tag so that
> I
> > don't put "target" but put something that will use whatever the build
> > directory should be?
>
> ${project.build.directory}
>
> Cheers,
> Brett
>
>


--
-- Lee Meador
Sent from gmail. My real email address is lee@leemeador.com

Re: [m2] Generating Source in Ant

Posted by Brett Porter <br...@gmail.com>.
On 11/18/05, Lee Meador <le...@gmail.com> wrote:
> 1) It took me a while to find and load the plugin sources. I found no
> reference in the docs. The page that tells how to build the source does not
> load the plugin source from subversion. Its at:
>
> http://maven.apache.org/guides/development/guide-building-m2.html

My bad - I moved it and haven't gotten to update that page yet.

> Then I just use the <sourceRoot> tag (or <testSourceRoot> for test code) to
> tell maven2 to compile the stuff in the folder that I put in there. I don't
> know if you can put more than one relative path in there. I doubt it but
> don't understand the implications of what's in the java source very well.

Neat. This also needs to be documented, as does the
.dependency.classpath feature and the inclusion of optional task
dependencies inside the plugin tag. Anyone?

> Question: Is there a way to parameterize the folder in that tag so that I
> don't put "target" but put something that will use whatever the build
> directory should be?

${project.build.directory}

Cheers,
Brett

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: [m2] Generating Source in Ant

Posted by Douglas Ferguson <do...@epsiia.com>.
Does the sourceRoot defined in the antRun get added to the
maven-compiler-plugin source path?


Lee Meador-2 wrote:
> 
> Never mind. But I do have a question down there ...
> 
> Although I had fun poking around into maven2 and creating a plugin of my
> own
> that would compile, load and run (even though it did die with a NPE), two
> things:
> 
> 1) It took me a while to find and load the plugin sources. I found no
> reference in the docs. The page that tells how to build the source does
> not
> load the plugin source from subversion. Its at:
> 
> http://maven.apache.org/guides/development/guide-building-m2.html
> 
> I don't really know how it should be documented. I've only been looking at
> this since yesterday. Maybe a sibling page that tells how to download
> source
> and build/install/etc the plugin source.
> 
> The command to load the plugin source is:
> 
> svn co https://svn.apache.org/repos/asf/maven/plugins/trunk maven-plugins
> 
> All the plugins will get put under the 'maven-plugins' folder.
> 
> 2) The antrun plugin has what I need already. I found that out when I
> looked
> at the AntRunMojo.java file.
> 
> For what I am working on, I need to run Ant to generate my Websphere
> 6.0java from a wsdl. Then I need the generated code to be compiled.
> The default
> case doesn't find the generated code. (I don't know why I thought it would
> but maven seems to read minds sometimes.)
> 
> I have the ant build put the code it creates in
> target/generated-sources/java.
> 
> Then I just use the <sourceRoot> tag (or <testSourceRoot> for test code)
> to
> tell maven2 to compile the stuff in the folder that I put in there. I
> don't
> know if you can put more than one relative path in there. I doubt it but
> don't understand the implications of what's in the java source very well.
> 
> This is the plugin tag from my POM.
> 
> <plugin>
> <artifactId>maven-antrun-plugin</artifactId>
> <executions>
> <execution>
> <phase>generate-sources</phase>
> <configuration>
> <tasks>
> <ant antfile="build.xml" dir="." target="wasWsdl2Java" inheritRefs="true"
> />
> </tasks>
> <sourceRoot>/target/generated-sources/java</sourceRoot>
> </configuration>
> <goals>
> <goal>run</goal>
> </goals>
> </execution>
> </executions>
> </plugin>
> 
> 
> Question: Is there a way to parameterize the folder in that tag so that I
> don't put "target" but put something that will use whatever the build
> directory should be?
> 
> Thanks.
> 
> -- Lee Meador
> 
> On 11/17/05, Lee Meador <le...@gmail.com> wrote:
>>
>> I have this source:
>>
>> /**
>> * Goal which runs ant and then adds some path to the compile source root
>> list
>> *
>> * @goal run
>> * @phase generate-sources
>> * @description Run ant and then add a folder to the list of places that
>> hold
>> * code to compile
>> */
>> public class AntRunAddGenerateMojo extends AntRunMojo {
>>
>> /**
>> * The Maven project.
>> *
>> * @parameter expression="${project}"
>> * @required
>> * @readonly
>> */
>> private MavenProject project;
>>
>> /**
>> * Where the source files were put by the ant task
>> *
>> * @parameter expression="${project.build.directory
>> }/generated-sources/java"
>> * @required
>> */
>> private String compileSourceRoot;
>>
>> public void execute() throws MojoExecutionException {
>> getLog().info("enter execute()");
>> super.execute();
>> getLog().info("add compileSourceRoot: " + compileSourceRoot);
>> project.addCompileSourceRoot(compileSourceRoot);
>> getLog().info("exit execute()");
>> }
>> }
>>
>> And I get this error:
>>
>> [INFO] task-segment: [compile]
>> [INFO]
>> ----------------------------------------------------------------------------
>> [INFO] [ant-generate:run {execution: default}]
>> [INFO] enter execute()
>> [INFO]
>> ----------------------------------------------------------------------------
>> [ERROR] BUILD ERROR
>> [INFO]
>> ----------------------------------------------------------------------------
>> [INFO] Error executing ant tasks
>>
>> [INFO]
>> ----------------------------------------------------------------------------
>> [INFO] Trace
>> org.apache.maven.lifecycle.LifecycleExecutionException: Error executing
>> ant tasks
>> at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(
>> DefaultLifecycleExecutor.java:544)
>> at
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle
>> (DefaultLifecycleExecutor.java:469)
>> at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(
>> DefaultLifecycleExecutor.java:448)
>> at
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures
>> (DefaultLifecycleExecutor.java:301)
>> at
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments
>> (DefaultLifecycleExecutor.java:268)
>> at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(
>> DefaultLifecycleExecutor.java:137)
>> at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:316)
>> at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:113)
>> at org.apache.maven.cli.MavenCli.main(MavenCli.java:249)
>> at sun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)
>> at sun.reflect.NativeMethodAccessorImpl.invoke(
>> NativeMethodAccessorImpl.java:39)
>> at sun.reflect.DelegatingMethodAccessorImpl.invoke(
>> DelegatingMethodAccessorImpl.java:25)
>> at java.lang.reflect.Method.invoke(Method.java:585)
>> at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
>> at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
>> at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
>>
>> at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
>> Caused by: org.apache.maven.plugin.MojoExecutionException: Error
>> executing
>> ant tasks
>> at org.apache.maven.plugin.antrun.AbstractAntMojo.executeTasks(
>> AbstractAntMojo.java:77)
>> at org.apache.maven.plugin.antrun.AntRunMojo.execute(AntRunMojo.java:72)
>>
>> at com.aa.inflightsales.maven.AntRunAddGenerateMojo.execute(
>> AntRunAddGenerateMojo.java:52)
>> at org.apache.maven.plugin.DefaultPluginManager.executeMojo(
>> DefaultPluginManager.java:399)
>> at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(
>> DefaultLifecycleExecutor.java:519)
>> ... 16 more
>> Caused by: java.lang.NullPointerException
>> at org.apache.maven.plugin.antrun.AbstractAntMojo.executeTasks(
>> AbstractAntMojo.java:42)
>> ... 20 more
>> [INFO]
>> ----------------------------------------------------------------------------
>> [INFO] Total time: 3 seconds
>> [INFO] Finished at: Thu Nov 17 12:36:57 CST 2005
>> [INFO] Final Memory: 4M/8M
>> [INFO]
>> ----------------------------------------------------------------------------
>>
>> I have no idea how to start looking at this. Do you have any strategies
>> for me?
>>
>> Thanks.
>>
>> -- Lee Meador
>>
>> On 11/16/05, Brett Porter <br...@gmail.com> wrote:
>> >
>> > I'd recommend writing the plugin in Java and calling the Ant task
>> > using the Java API, then add the source root. This would help to
>> > encapsulate the functionality.
>> >
>> > - Brett
>> >
>> > On 11/17/05, Lee Meador < Lee.Meador@aa.com> wrote:
>> > > I've scanned the last couple of weeks' messages and I think I see
>> what
>> > > is happening.
>> > >
>> > > I have an ant task that generates java from a wsdl using Websphere
>> 6.0's
>> >
>> > > ant tasks to do so. It's similar to the Axis ones.
>> > >
>> > > I have it generate the java into target/generated-sources/java.
>> > >
>> > > The generated code doesn't get compiled when I do a
>> > >
>> > > mvn compile
>> > >
>> > > I think the problem is that generated-sources doesn't get added to
>> the
>> > > compileSourceRoots since they are being generated in ant.
>> > >
>> > > So ... can I run some useless plugin with no input and get the
>> > > generated-sources added to the list of roots? Is there some other way
>> > to
>> > > get it to look there?
>> > >
>> > > Thanks.
>> > >
>> > > -- Lee Meador
>> > >
>> > >
>> > > ---------------------------------------------------------------------
>> > > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> > > For additional commands, e-mail: users-help@maven.apache.org
>> > >
>> > >
>> >
>> >
>>
>>
>> --
>> -- Lee Meador
>> Sent from gmail. My real email address is lee@leemeador.com
> 
> 
> 
> 
> --
> -- Lee Meador
> Sent from gmail. My real email address is lee@leemeador.com
> 
> 

-- 
View this message in context: http://www.nabble.com/-m2--Generating-Source-in-Ant-tf567623.html#a6098498
Sent from the Maven - Users forum at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: [m2] Generating Source in Ant

Posted by Lee Meador <le...@gmail.com>.
Never mind. But I do have a question down there ...

Although I had fun poking around into maven2 and creating a plugin of my own
that would compile, load and run (even though it did die with a NPE), two
things:

1) It took me a while to find and load the plugin sources. I found no
reference in the docs. The page that tells how to build the source does not
load the plugin source from subversion. Its at:

http://maven.apache.org/guides/development/guide-building-m2.html

I don't really know how it should be documented. I've only been looking at
this since yesterday. Maybe a sibling page that tells how to download source
and build/install/etc the plugin source.

The command to load the plugin source is:

svn co https://svn.apache.org/repos/asf/maven/plugins/trunk maven-plugins

All the plugins will get put under the 'maven-plugins' folder.

2) The antrun plugin has what I need already. I found that out when I looked
at the AntRunMojo.java file.

For what I am working on, I need to run Ant to generate my Websphere
6.0java from a wsdl. Then I need the generated code to be compiled.
The default
case doesn't find the generated code. (I don't know why I thought it would
but maven seems to read minds sometimes.)

I have the ant build put the code it creates in
target/generated-sources/java.

Then I just use the <sourceRoot> tag (or <testSourceRoot> for test code) to
tell maven2 to compile the stuff in the folder that I put in there. I don't
know if you can put more than one relative path in there. I doubt it but
don't understand the implications of what's in the java source very well.

This is the plugin tag from my POM.

<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<phase>generate-sources</phase>
<configuration>
<tasks>
<ant antfile="build.xml" dir="." target="wasWsdl2Java" inheritRefs="true" />
</tasks>
<sourceRoot>/target/generated-sources/java</sourceRoot>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>


Question: Is there a way to parameterize the folder in that tag so that I
don't put "target" but put something that will use whatever the build
directory should be?

Thanks.

-- Lee Meador

On 11/17/05, Lee Meador <le...@gmail.com> wrote:
>
> I have this source:
>
> /**
> * Goal which runs ant and then adds some path to the compile source root
> list
> *
> * @goal run
> * @phase generate-sources
> * @description Run ant and then add a folder to the list of places that
> hold
> * code to compile
> */
> public class AntRunAddGenerateMojo extends AntRunMojo {
>
> /**
> * The Maven project.
> *
> * @parameter expression="${project}"
> * @required
> * @readonly
> */
> private MavenProject project;
>
> /**
> * Where the source files were put by the ant task
> *
> * @parameter expression="${project.build.directory
> }/generated-sources/java"
> * @required
> */
> private String compileSourceRoot;
>
> public void execute() throws MojoExecutionException {
> getLog().info("enter execute()");
> super.execute();
> getLog().info("add compileSourceRoot: " + compileSourceRoot);
> project.addCompileSourceRoot(compileSourceRoot);
> getLog().info("exit execute()");
> }
> }
>
> And I get this error:
>
> [INFO] task-segment: [compile]
> [INFO]
> ----------------------------------------------------------------------------
> [INFO] [ant-generate:run {execution: default}]
> [INFO] enter execute()
> [INFO]
> ----------------------------------------------------------------------------
> [ERROR] BUILD ERROR
> [INFO]
> ----------------------------------------------------------------------------
> [INFO] Error executing ant tasks
>
> [INFO]
> ----------------------------------------------------------------------------
> [INFO] Trace
> org.apache.maven.lifecycle.LifecycleExecutionException: Error executing
> ant tasks
> at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(
> DefaultLifecycleExecutor.java:544)
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle
> (DefaultLifecycleExecutor.java:469)
> at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(
> DefaultLifecycleExecutor.java:448)
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures
> (DefaultLifecycleExecutor.java:301)
> at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments
> (DefaultLifecycleExecutor.java:268)
> at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(
> DefaultLifecycleExecutor.java:137)
> at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:316)
> at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:113)
> at org.apache.maven.cli.MavenCli.main(MavenCli.java:249)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)
> at sun.reflect.NativeMethodAccessorImpl.invoke(
> NativeMethodAccessorImpl.java:39)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(
> DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:585)
> at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
> at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
> at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
>
> at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
> Caused by: org.apache.maven.plugin.MojoExecutionException: Error executing
> ant tasks
> at org.apache.maven.plugin.antrun.AbstractAntMojo.executeTasks(
> AbstractAntMojo.java:77)
> at org.apache.maven.plugin.antrun.AntRunMojo.execute(AntRunMojo.java:72)
>
> at com.aa.inflightsales.maven.AntRunAddGenerateMojo.execute(
> AntRunAddGenerateMojo.java:52)
> at org.apache.maven.plugin.DefaultPluginManager.executeMojo(
> DefaultPluginManager.java:399)
> at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(
> DefaultLifecycleExecutor.java:519)
> ... 16 more
> Caused by: java.lang.NullPointerException
> at org.apache.maven.plugin.antrun.AbstractAntMojo.executeTasks(
> AbstractAntMojo.java:42)
> ... 20 more
> [INFO]
> ----------------------------------------------------------------------------
> [INFO] Total time: 3 seconds
> [INFO] Finished at: Thu Nov 17 12:36:57 CST 2005
> [INFO] Final Memory: 4M/8M
> [INFO]
> ----------------------------------------------------------------------------
>
> I have no idea how to start looking at this. Do you have any strategies
> for me?
>
> Thanks.
>
> -- Lee Meador
>
> On 11/16/05, Brett Porter <br...@gmail.com> wrote:
> >
> > I'd recommend writing the plugin in Java and calling the Ant task
> > using the Java API, then add the source root. This would help to
> > encapsulate the functionality.
> >
> > - Brett
> >
> > On 11/17/05, Lee Meador < Lee.Meador@aa.com> wrote:
> > > I've scanned the last couple of weeks' messages and I think I see what
> > > is happening.
> > >
> > > I have an ant task that generates java from a wsdl using Websphere 6.0's
> >
> > > ant tasks to do so. It's similar to the Axis ones.
> > >
> > > I have it generate the java into target/generated-sources/java.
> > >
> > > The generated code doesn't get compiled when I do a
> > >
> > > mvn compile
> > >
> > > I think the problem is that generated-sources doesn't get added to the
> > > compileSourceRoots since they are being generated in ant.
> > >
> > > So ... can I run some useless plugin with no input and get the
> > > generated-sources added to the list of roots? Is there some other way
> > to
> > > get it to look there?
> > >
> > > Thanks.
> > >
> > > -- Lee Meador
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > > For additional commands, e-mail: users-help@maven.apache.org
> > >
> > >
> >
> >
>
>
> --
> -- Lee Meador
> Sent from gmail. My real email address is lee@leemeador.com




--
-- Lee Meador
Sent from gmail. My real email address is lee@leemeador.com

Re: [m2] Generating Source in Ant

Posted by Lee Meador <le...@gmail.com>.
I have this source:

/**
* Goal which runs ant and then adds some path to the compile source root
list
*
* @goal run
* @phase generate-sources
* @description Run ant and then add a folder to the list of places that hold
* code to compile
*/
public class AntRunAddGenerateMojo extends AntRunMojo {

/**
* The Maven project.
*
* @parameter expression="${project}"
* @required
* @readonly
*/
private MavenProject project;

/**
* Where the source files were put by the ant task
*
* @parameter expression="${project.build.directory}/generated-sources/java"
* @required
*/
private String compileSourceRoot;

public void execute() throws MojoExecutionException {
getLog().info("enter execute()");
super.execute();
getLog().info("add compileSourceRoot: " + compileSourceRoot);
project.addCompileSourceRoot(compileSourceRoot);
getLog().info("exit execute()");
}
}

And I get this error:

[INFO] task-segment: [compile]
[INFO]
----------------------------------------------------------------------------
[INFO] [ant-generate:run {execution: default}]
[INFO] enter execute()
[INFO]
----------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO]
----------------------------------------------------------------------------
[INFO] Error executing ant tasks

[INFO]
----------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Error executing ant
tasks
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(
DefaultLifecycleExecutor.java:544)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle
(DefaultLifecycleExecutor.java:469)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(
DefaultLifecycleExecutor.java:448)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures
(DefaultLifecycleExecutor.java:301)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(
DefaultLifecycleExecutor.java:268)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(
DefaultLifecycleExecutor.java:137)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:316)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:113)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:249)
at sun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java
:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)

at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.MojoExecutionException: Error executing
ant tasks
at org.apache.maven.plugin.antrun.AbstractAntMojo.executeTasks(
AbstractAntMojo.java:77)
at org.apache.maven.plugin.antrun.AntRunMojo.execute(AntRunMojo.java:72)

at com.aa.inflightsales.maven.AntRunAddGenerateMojo.execute(
AntRunAddGenerateMojo.java:52)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(
DefaultPluginManager.java:399)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(
DefaultLifecycleExecutor.java:519)
... 16 more
Caused by: java.lang.NullPointerException
at org.apache.maven.plugin.antrun.AbstractAntMojo.executeTasks(
AbstractAntMojo.java:42)
... 20 more
[INFO]
----------------------------------------------------------------------------
[INFO] Total time: 3 seconds
[INFO] Finished at: Thu Nov 17 12:36:57 CST 2005
[INFO] Final Memory: 4M/8M
[INFO]
----------------------------------------------------------------------------

I have no idea how to start looking at this. Do you have any strategies for
me?

Thanks.

-- Lee Meador

On 11/16/05, Brett Porter <br...@gmail.com> wrote:
>
> I'd recommend writing the plugin in Java and calling the Ant task
> using the Java API, then add the source root. This would help to
> encapsulate the functionality.
>
> - Brett
>
> On 11/17/05, Lee Meador <Le...@aa.com> wrote:
> > I've scanned the last couple of weeks' messages and I think I see what
> > is happening.
> >
> > I have an ant task that generates java from a wsdl using Websphere 6.0's
> > ant tasks to do so. It's similar to the Axis ones.
> >
> > I have it generate the java into target/generated-sources/java.
> >
> > The generated code doesn't get compiled when I do a
> >
> > mvn compile
> >
> > I think the problem is that generated-sources doesn't get added to the
> > compileSourceRoots since they are being generated in ant.
> >
> > So ... can I run some useless plugin with no input and get the
> > generated-sources added to the list of roots? Is there some other way to
> > get it to look there?
> >
> > Thanks.
> >
> > -- Lee Meador
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
>
>


--
-- Lee Meador
Sent from gmail. My real email address is lee@leemeador.com

Re: [m2] Generating Source in Ant

Posted by Brett Porter <br...@gmail.com>.
I'd recommend writing the plugin in Java and calling the Ant task
using the Java API, then add the source root. This would help to
encapsulate the functionality.

- Brett

On 11/17/05, Lee Meador <Le...@aa.com> wrote:
> I've scanned the last couple of weeks' messages and I think I see what
> is happening.
>
> I have an ant task that generates java from a wsdl using Websphere 6.0's
> ant tasks to do so. It's similar to the Axis ones.
>
> I have it generate the java into target/generated-sources/java.
>
> The generated code doesn't get compiled when I do a
>
> mvn compile
>
> I think the problem is that generated-sources doesn't get added to the
> compileSourceRoots since they are being generated in ant.
>
> So ... can I run some useless plugin with no input and get the
> generated-sources added to the list of roots? Is there some other way to
> get it to look there?
>
> Thanks.
>
> -- Lee Meador
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: [m2] Generating Source in Ant

Posted by Brett Porter <br...@gmail.com>.
... as a workaround, but as Jesse was saying, we don't recommend this
in general as it will throw off the representation of what the project
is.

The best solution is still to have a plugin add the compile source root.

- Brett

On 11/17/05, John Tolentino <jt...@exist.com> wrote:
> Hi Lee,
>
> Include target/generated-sources/java in your pom.xml's
> |<sourceDirectory>|
> (http://maven.apache.org/maven-model/maven.html#class_build).
>
> Regards,
> John
>
> Lee Meador wrote:
>
> >I've scanned the last couple of weeks' messages and I think I see what
> >is happening.
> >
> >I have an ant task that generates java from a wsdl using Websphere 6.0's
> >ant tasks to do so. It's similar to the Axis ones.
> >
> >I have it generate the java into target/generated-sources/java.
> >
> >The generated code doesn't get compiled when I do a
> >
> >mvn compile
> >
> >I think the problem is that generated-sources doesn't get added to the
> >compileSourceRoots since they are being generated in ant.
> >
> >So ... can I run some useless plugin with no input and get the
> >generated-sources added to the list of roots? Is there some other way to
> >get it to look there?
> >
> >Thanks.
> >
> >-- Lee Meador
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >For additional commands, e-mail: users-help@maven.apache.org
> >
> >
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: [m2] Generating Source in Ant

Posted by John Tolentino <jt...@exist.com>.
Hi Lee,

Include target/generated-sources/java in your pom.xml's 
|<sourceDirectory>|  
(http://maven.apache.org/maven-model/maven.html#class_build).

Regards,
John

Lee Meador wrote:

>I've scanned the last couple of weeks' messages and I think I see what
>is happening.
>
>I have an ant task that generates java from a wsdl using Websphere 6.0's
>ant tasks to do so. It's similar to the Axis ones.
>
>I have it generate the java into target/generated-sources/java.
>
>The generated code doesn't get compiled when I do a 
>
>mvn compile
>
>I think the problem is that generated-sources doesn't get added to the
>compileSourceRoots since they are being generated in ant.
>
>So ... can I run some useless plugin with no input and get the
>generated-sources added to the list of roots? Is there some other way to
>get it to look there?
>
>Thanks.
>
>-- Lee Meador
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>For additional commands, e-mail: users-help@maven.apache.org
>
>
>  
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org