You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by vra5107 <ve...@gmail.com> on 2011/10/23 21:28:15 UTC

Maven Antrun doesn't compile the project well.

HI
 

           I have the following configuration for antrun. For some reason
during the build ant is unable to see the ant.jar file. How do I fix this.
Thanks for your help in advance. 


http://maven.40175.n5.nabble.com/file/n4930208/antrun_configuration
antrun_configuration 
http://maven.40175.n5.nabble.com/file/n4930208/stacktrace stacktrace 

Venkat

--
View this message in context: http://maven.40175.n5.nabble.com/Maven-Antrun-doesn-t-compile-the-project-well-tp4930208p4930208.html
Sent from the Maven - Users mailing list archive at Nabble.com.

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


Re: Maven Antrun doesn't compile the project well.

Posted by Benson Margulies <bi...@gmail.com>.
.Could this be http://jira.codehaus.org/browse/MNG-1323?

If you have multiple, conflicting, antrun configurations, and you are
using mvn 2.x, you won't get what you want.

On Wed, Oct 26, 2011 at 3:36 PM, vra5107 <ve...@gmail.com> wrote:
> Aye aye Mr Wayne
>
>  > I honestly don't care what happens when you run Ant or any other build
> tool.
>
> Fair enough! I have the following jars as dependencies listed on the plugin
> as the url below says. But, for some reason they don't show up on the
> effective pom ( Well, honestly I don't know if plugin dependencies show up
> on the effective pom ).
>
> *<dependencies>
> <dependency>
> <groupId>commons-net</groupId>
> <artifactId>commons-net</artifactId>
> <version>1.4.1</version>
> </dependency>
> <dependency>
> <groupId>ant</groupId>
> <artifactId>ant-commons-net</artifactId>
> <version>1.6.5</version>
> </dependency>
> <dependency>
> <groupId>ant</groupId>
> <artifactId>ant-nodeps</artifactId>
> <version>1.6.5</version>
> </dependency>
> </dependencies>*
>
> http://maven.apache.org/plugins/maven-antrun-plugin/examples/customTasks.html
>
> Thanks
> Venkat
>
> On Wed, Oct 26, 2011 at 9:43 AM, Wayne Fay [via Maven] <
> ml-node+s40175n4939957h8@n5.nabble.com> wrote:
>
>> >  I thought so too, but I was able to build the code well just by running
>> > ant. The problem arises when I try to build it with maven.
>>
>> I honestly don't care what happens when you run Ant or any other build
>> tool.
>> Add the dependencies to the ant artifacts in your pom and try running
>> your build again.
>> Then report back if it works or what other error messages you get.
>>
>> Wayne
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]<http://user/SendEmail.jtp?type=node&node=4939957&i=0>
>> For additional commands, e-mail: [hidden email]<http://user/SendEmail.jtp?type=node&node=4939957&i=1>
>>
>>
>>
>> ------------------------------
>>  If you reply to this email, your message will be added to the discussion
>> below:
>>
>> http://maven.40175.n5.nabble.com/Maven-Antrun-doesn-t-compile-the-project-well-tp4930208p4939957.html
>>  To unsubscribe from Maven Antrun doesn't compile the project well., click
>> here<http://maven.40175.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4930208&code=dmVua2F0cmFtLmFra2luZW5pQGdtYWlsLmNvbXw0OTMwMjA4fC0xMTk4NzA1Njk0>.
>>
>>
>
>
>
> --
> Sincerely
> Venkat R Akkineni
> 585 489 3259
>
>
> --
> View this message in context: http://maven.40175.n5.nabble.com/Maven-Antrun-doesn-t-compile-the-project-well-tp4930208p4940936.html
> Sent from the Maven - Users mailing list archive at Nabble.com.

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


Re: Maven Antrun doesn't compile the project well.

Posted by Stephen Connolly <st...@gmail.com>.
why not add a separate ant file that calls the ruby one and then forks maven
to do the install to your repo

- Stephen

---
Sent from my Android phone, so random spelling mistakes, random nonsense
words and other nonsense are a direct result of using swype to type on the
screen
On 28 Oct 2011 02:21, "vra5107" <ve...@gmail.com> wrote:

>
> Wayne Fay wrote:
> >
> >
> > You should ask the JRuby folks for help with this since its their code
> > that
> > you're working with. But don't be surprised when they say that they
> simply
> > do not support what you are trying to do since they officially use Ant
> for
> > builds:
> > https://github.com/jruby/jruby/wiki/DownloadAndBuildJRuby
> >
> > Do the practical thing and just build it with Ant directly. Then if you
> > want
> > to push the resulting artifacts into a Maven repo etc, use the Maven Ant
> > Tasks to do so directly from Ant. Why are doing things the hard way?
> >
> >
> >
>
> Yep, well I learned that JRuby's preferred way is Ant. But fortunately for
> me they do supply a pom which neatly installs the jar in my local repo. i
> am
> already doing this. But this would be a manual way of doing things. I
> wanted
> to automate this process but don't want to touch the jruby build file
> itself, so I am trying this way. I don't know of a way to invoke one pom
> from another other than adding one as a module of another.
>
> But the Jruby project is non existant until the file is unzipped, so it's
> not possible to add its pom as a child of the wrapper project's pom.
>
>
> Wayne
>
>
>
> --
> View this message in context:
> http://maven.40175.n5.nabble.com/Maven-Antrun-doesn-t-compile-the-project-well-tp4930208p4944667.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Maven Antrun doesn't compile the project well.

Posted by vra5107 <ve...@gmail.com>.
Wayne Fay wrote:
> 
> 
> You should ask the JRuby folks for help with this since its their code
> that
> you're working with. But don't be surprised when they say that they simply
> do not support what you are trying to do since they officially use Ant for
> builds:
> https://github.com/jruby/jruby/wiki/DownloadAndBuildJRuby
> 
> Do the practical thing and just build it with Ant directly. Then if you
> want
> to push the resulting artifacts into a Maven repo etc, use the Maven Ant
> Tasks to do so directly from Ant. Why are doing things the hard way?
> 
> 
> 

Yep, well I learned that JRuby's preferred way is Ant. But fortunately for
me they do supply a pom which neatly installs the jar in my local repo. i am
already doing this. But this would be a manual way of doing things. I wanted
to automate this process but don't want to touch the jruby build file
itself, so I am trying this way. I don't know of a way to invoke one pom
from another other than adding one as a module of another. 

But the Jruby project is non existant until the file is unzipped, so it's
not possible to add its pom as a child of the wrapper project's pom.


Wayne



--
View this message in context: http://maven.40175.n5.nabble.com/Maven-Antrun-doesn-t-compile-the-project-well-tp4930208p4944667.html
Sent from the Maven - Users mailing list archive at Nabble.com.

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


Re: Maven Antrun doesn't compile the project well.

Posted by Benson Margulies <bi...@gmail.com>.
I would add one bit of emphasis. If your goal is to build it and push
the results, use the ant tasks or ivy.

On the other hand, any execution of 'ant' that works outside of maven
should work inside of maven using antrun, so long as the dependencies
of antrun expand the classpath to include *all of the components* that
would be in your ant lib directory outside of maven.

If you really have an example in which antrun, pointed at a build.xml,
gets different results in this case, please make a SSCE and attach it
to a jira for the antrun project.


On Thu, Oct 27, 2011 at 8:43 AM, Wayne Fay <wa...@gmail.com> wrote:
>> I have tried adding the ant jars to the maven project itself, but that
>> yielded no results may be because the maven project does not compile any
>> java files itself, it delegates the responsibility to Ant via AntRun.
>
> This is kind of a ridiculous way to build a project with Maven IMO.
>
>> This is jruby code that I downloaded as a zip and it compiles fine as a
>> stand alone. The actual maven project itself doesn't compile any java
>> classes, so, no ant dependencies for the maven project. I am trying to
> unzip
>
> You should ask the JRuby folks for help with this since its their code that
> you're working with. But don't be surprised when they say that they simply
> do not support what you are trying to do since they officially use Ant for
> builds:
> https://github.com/jruby/jruby/wiki/DownloadAndBuildJRuby
>
>> missing when the ant build is triggered. So I tried adding the jars to
>> plugin hoping that maven will serve these via antrun to ant build. I know
>> there is a fallacy in understanding here but I am unable to see it.
>
> Do the practical thing and just build it with Ant directly. Then if you want
> to push the resulting artifacts into a Maven repo etc, use the Maven Ant
> Tasks to do so directly from Ant. Why are doing things the hard way?
>
> Wayne
>

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


Maven Antrun doesn't compile the project well.

Posted by Wayne Fay <wa...@gmail.com>.
> I have tried adding the ant jars to the maven project itself, but that
> yielded no results may be because the maven project does not compile any
> java files itself, it delegates the responsibility to Ant via AntRun.

This is kind of a ridiculous way to build a project with Maven IMO.

> This is jruby code that I downloaded as a zip and it compiles fine as a
> stand alone. The actual maven project itself doesn't compile any java
> classes, so, no ant dependencies for the maven project. I am trying to
unzip

You should ask the JRuby folks for help with this since its their code that
you're working with. But don't be surprised when they say that they simply
do not support what you are trying to do since they officially use Ant for
builds:
https://github.com/jruby/jruby/wiki/DownloadAndBuildJRuby

> missing when the ant build is triggered. So I tried adding the jars to
> plugin hoping that maven will serve these via antrun to ant build. I know
> there is a fallacy in understanding here but I am unable to see it.

Do the practical thing and just build it with Ant directly. Then if you want
to push the resulting artifacts into a Maven repo etc, use the Maven Ant
Tasks to do so directly from Ant. Why are doing things the hard way?

Wayne

Re: Maven Antrun doesn't compile the project well.

Posted by vra5107 <ve...@gmail.com>.
I am using maven 3.0.3 

I have tried adding the ant jars to the maven project itself, but that
yielded no results may be because the maven project does not compile any
java files itself, it delegates the responsibility to Ant via AntRun. 


Wayne Fay wrote:
>  I don't know why you have those as plugin dependencies unless the PLUGIN
> itself requires those artifacts for it to function. 

This is jruby code that I downloaded as a zip and it compiles fine as a
stand alone. The actual maven project itself doesn't compile any java
classes, so, no ant dependencies for the maven project. I am trying to unzip
the jruby zip file and build it using this maven project. Basically trying
to create apply some patches to the juby code. So, by my understanding there
is no scope for the dependencies to go missing, but the fact is they are
missing when the ant build is triggered. So I tried adding the jars to
plugin hoping that maven will serve these via antrun to ant build. I know
there is a fallacy in understanding here but I am unable to see it. 

Thanks
Venkat

--
View this message in context: http://maven.40175.n5.nabble.com/Maven-Antrun-doesn-t-compile-the-project-well-tp4930208p4941836.html
Sent from the Maven - Users mailing list archive at Nabble.com.

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


Re: Maven Antrun doesn't compile the project well.

Posted by Benson Margulies <bi...@gmail.com>.
On Wed, Oct 26, 2011 at 5:02 PM, Wayne Fay <wa...@gmail.com> wrote:
>> It's typical to put dependencies on the antrun plugin. If you need any
>> tasks that aren't part of the stock ant artifact, you add dependencies
>> to the plugin.
>
> Yup, I use Antrun in several of my own projects. But it does not seem
> to apply in this situation, instead it seems like the problem is
> simply that Venkat is missing some compile-time dependencies since his
> code is failing to compile and giving "cannot find symbol" errors. I
> wouldn't generally expect those kinds of errors to be resolved with
> plugin dependencies, but I could be wrong.

OK, I probably wasn't following the thread closely enough.

>
>> In 2.x, then, you had to be sure that all of your plugin declarations
>> across multiple aggregated projects agree.
>
> Yup, this was an annoying bug in M2. Venkat should check his Antrun
> declarations aross all related projects and ensure the plugin
> dependencies across multiple projects "agree" as you put it.
>
> Wayne
>
> ---------------------------------------------------------------------
> 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: Maven Antrun doesn't compile the project well.

Posted by Wayne Fay <wa...@gmail.com>.
> It's typical to put dependencies on the antrun plugin. If you need any
> tasks that aren't part of the stock ant artifact, you add dependencies
> to the plugin.

Yup, I use Antrun in several of my own projects. But it does not seem
to apply in this situation, instead it seems like the problem is
simply that Venkat is missing some compile-time dependencies since his
code is failing to compile and giving "cannot find symbol" errors. I
wouldn't generally expect those kinds of errors to be resolved with
plugin dependencies, but I could be wrong.

> In 2.x, then, you had to be sure that all of your plugin declarations
> across multiple aggregated projects agree.

Yup, this was an annoying bug in M2. Venkat should check his Antrun
declarations aross all related projects and ensure the plugin
dependencies across multiple projects "agree" as you put it.

Wayne

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


Re: Maven Antrun doesn't compile the project well.

Posted by Benson Margulies <bi...@gmail.com>.
It's typical to put dependencies on the antrun plugin. If you need any
tasks that aren't part of the stock ant artifact, you add dependencies
to the plugin.

In 2.x, then, you had to be sure that all of your plugin declarations
across multiple aggregated projects agree.

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


Re: Maven Antrun doesn't compile the project well.

Posted by Wayne Fay <wa...@gmail.com>.
> Fair enough! I have the following jars as dependencies listed on the plugin
> as the url below says. But, for some reason they don't show up on the
> effective pom ( Well, honestly I don't know if plugin dependencies show up
> on the effective pom ).

I don't know why you have those as plugin dependencies unless the
PLUGIN itself requires those artifacts for it to function.

Otherwise, if you need those artifacts for your OWN CODE to compile,
then they should be regular DEPENDENCIES.

This is what I am guessing you have wrong. Move the dependencies.

Wayne

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


Re: Maven Antrun doesn't compile the project well.

Posted by vra5107 <ve...@gmail.com>.
Aye aye Mr Wayne

  > I honestly don't care what happens when you run Ant or any other build
tool.

Fair enough! I have the following jars as dependencies listed on the plugin
as the url below says. But, for some reason they don't show up on the
effective pom ( Well, honestly I don't know if plugin dependencies show up
on the effective pom ).

*<dependencies>
<dependency>
<groupId>commons-net</groupId>
<artifactId>commons-net</artifactId>
<version>1.4.1</version>
</dependency>
<dependency>
<groupId>ant</groupId>
<artifactId>ant-commons-net</artifactId>
<version>1.6.5</version>
</dependency>
<dependency>
<groupId>ant</groupId>
<artifactId>ant-nodeps</artifactId>
<version>1.6.5</version>
</dependency>
</dependencies>*

http://maven.apache.org/plugins/maven-antrun-plugin/examples/customTasks.html

Thanks
Venkat

On Wed, Oct 26, 2011 at 9:43 AM, Wayne Fay [via Maven] <
ml-node+s40175n4939957h8@n5.nabble.com> wrote:

> >  I thought so too, but I was able to build the code well just by running
> > ant. The problem arises when I try to build it with maven.
>
> I honestly don't care what happens when you run Ant or any other build
> tool.
> Add the dependencies to the ant artifacts in your pom and try running
> your build again.
> Then report back if it works or what other error messages you get.
>
> Wayne
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]<http://user/SendEmail.jtp?type=node&node=4939957&i=0>
> For additional commands, e-mail: [hidden email]<http://user/SendEmail.jtp?type=node&node=4939957&i=1>
>
>
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://maven.40175.n5.nabble.com/Maven-Antrun-doesn-t-compile-the-project-well-tp4930208p4939957.html
>  To unsubscribe from Maven Antrun doesn't compile the project well., click
> here<http://maven.40175.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4930208&code=dmVua2F0cmFtLmFra2luZW5pQGdtYWlsLmNvbXw0OTMwMjA4fC0xMTk4NzA1Njk0>.
>
>



-- 
Sincerely
Venkat R Akkineni
585 489 3259


--
View this message in context: http://maven.40175.n5.nabble.com/Maven-Antrun-doesn-t-compile-the-project-well-tp4930208p4940936.html
Sent from the Maven - Users mailing list archive at Nabble.com.

Re: Maven Antrun doesn't compile the project well.

Posted by Wayne Fay <wa...@gmail.com>.
>  I thought so too, but I was able to build the code well just by running
> ant. The problem arises when I try to build it with maven.

I honestly don't care what happens when you run Ant or any other build tool.
Add the dependencies to the ant artifacts in your pom and try running
your build again.
Then report back if it works or what other error messages you get.

Wayne

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


Re: Maven Antrun doesn't compile the project well.

Posted by vra5107 <ve...@gmail.com>.
Thanks for the quick reply Wayne. I must not have selected the checkbox below
the post which is why I never got the prompt when you replied.

  I thought so too, but I was able to build the code well just by running
ant. The problem arises when I try to build it with maven.

  The project has a pom as well. I want to be able to build using the pom if
possible. Not sure my search string was not upto the mark but google search
doesn't yield any results.

Any help is appreciated.

Thanks
Venkat

--
View this message in context: http://maven.40175.n5.nabble.com/Maven-Antrun-doesn-t-compile-the-project-well-tp4930208p4938791.html
Sent from the Maven - Users mailing list archive at Nabble.com.

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


Re: Maven Antrun doesn't compile the project well.

Posted by Wayne Fay <wa...@gmail.com>.
>           I have the following configuration for antrun. For some reason
> during the build ant is unable to see the ant.jar file. How do I fix this.
> Thanks for your help in advance.

It looks like your code has an undeclared dependency on ant itself.
Add the missing dependency and try again.

Wayne

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