You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Smiley, David W." <ds...@mitre.org> on 2011/05/04 23:41:45 UTC

Improvements to the maven build

Steve Row,

I thought I'd put together a list of interesting differences between the ant build output and the maven build output.  Before each build I did a full clean and then after the build I saved a file listing to a text file so that I could diff it.

I'm using svn revision 1087373 (March 31st).

1. The ant build invokes a JSP compiler to validate them.  The maven build does not.
2. Maven seems(?) to compile more modules' tests than the ant build does.
3. The ant build builds the tools module.  The maven build does not.  Probably fine it stays this way?
4. Ant doesn't build the benchmark module; maven will by default.  A problem for the ant build?
5. The ant build artifacts tend to have a leading "apache-" in front of them. But the maven artifactId does not have this so the artifacts file names are different, trivially so any way.
6. The ant solr build puts all its final artifacts into the solr/dist directory, the maven build does not--it leaves all of them in their build directory. Not a big deal but maybe there's a way to have the output file go someplace else?  Not sure.

There were two issues that seemed like clear bugs to me that I fixed with an attached patch.
1. solrj's build directory and compile output directory were the same directory, but that's problematic since building the output jar will result in an error if it sees its own jar file as an input file to its output jar.  So I added a "classes" directory.  This will result in a different directory than where the ant builds, though.
2. The dataimporthandler-extras output location was specified such that there was a redundant path: /extras/extras/, so I fixed this.

By the way, I think it would be really nice to have a maven build instructions file that is put into place when the get-maven-poms task is run.  The file would have the essential instructions, it would explain some of the relevant differences to the ant build (notably output file placement, file name differences), and it would include tips such as how to install the sources and javadoc jar files into your local repo.  

~ David Smiley

RE: Improvements to the maven build

Posted by Steven A Rowe <sa...@syr.edu>.
A correction:

I wrote:
> The full artifact name would be org.apache.solr:apache-solr:<version>, 
> which seems weird to me in the double inclusion of "maven".

s/"maven"/"apache"/


RE: Improvements to the maven build

Posted by Steven A Rowe <sa...@syr.edu>.
Hi David,

On 5/6/2011 at 9:46 AM, David W. Smiley wrote:
> On May 4, 2011, at 6:43 PM, Steven A Rowe wrote:
> > I meant to keep the Maven build output location the same as the Ant
> > build output location.  I think the Solr modules' POMs can and should
> > be changed to eliminate this difference.
> 
> I'm a little unclear on what you mean by "I think the Solr modules' POMs
> can and should be changed to eliminate this difference".  Do you mean we
> should ensure there is no difference in build output locations between
> the maven and ant builds?

Yes, that's the ideal I have in mind.  This may not be possible for various reasons, but that's the ideal.

> If so then how do we deal with the fact that the ant builds wants
> to put the solrj jar into a compilation output directory?

The solrj jar is created in the Ant build (exclusively, AFAICT) via the 'dist-solrj' target, which places the solrj jar file under solr/dist/, not under the compilation output directory solr/build/solrj/.  Maybe you are referring to something other than the binary jar?

> You committed my patch that puts the compilation output directory
> one more level in under "classes" -- this creates a difference
> between the builds.

That's true, your change makes the builds less similar, not more.  I figured, though, that practical concerns trump theory in the short term ("progress not perfection"), and that in the medium term, we can change the build to more closely resemble the Ant build.

Thanks again for reviewing the Maven build - I really appreciate it.

Steve


Re: Improvements to the maven build

Posted by "Smiley, David W." <ds...@mitre.org>.
On May 4, 2011, at 6:43 PM, Steven A Rowe wrote:

>> 
>> 6. The ant solr build puts all its final artifacts into the solr/dist
>> directory, the maven build does not--it leaves all of them in their build
>> directory. Not a big deal but maybe there's a way to have the output file
>> go someplace else?  Not sure.
> 
> I meant to keep the Maven build output location the same as the Ant build output location.  I think the Solr modules' POMs can and should be changed to eliminate this difference.

I'm a little unclear on what you mean by "I think the Solr modules' POMs can and should be changed to eliminate this difference".  Do you mean we should ensure there is no difference in build output locations between the maven and ant builds?  If so then how do we deal with the fact that the ant builds wants to put the solrj jar into a compilation output directory?  You committed my patch that puts the compilation output directory one more level in under "classes" -- this creates a difference between the builds.

~ David
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


RE: Improvements to the maven build

Posted by Steven A Rowe <sa...@syr.edu>.
Hi David,

> I thought I'd put together a list of interesting differences between the
> ant build output and the maven build output.  Before each build I did a
> full clean and then after the build I saved a file listing to a text file
> so that I could diff it.

Cool!  Thanks for the effort.

> 1. The ant build invokes a JSP compiler to validate them.  The maven
> build does not.

My take on the Maven build is that it should ensure the POMs are in sync with the artifacts produced.  I don't think the Maven build needs to perform all of the validity checks that the Ant build performs (e.g. also javadocs).  I'd like to keep the build simple, so that maintenance is easier and keeping the POMs in sync is thereby more likely.

> 2. Maven seems(?) to compile more modules' tests than the ant build does.

Not sure why this would be, but I don't think it's necessarily a problem (for the Maven build).

> 3. The ant build builds the tools module.  The maven build does not.
> Probably fine it stays this way?

In general, code under tools is used to generate other code, the results of  which is kept checked in.  So I agree, the Maven build doesn't need to support this, KISS principlishly.

> 4. Ant doesn't build the benchmark module; maven will by default.  A
> problem for the ant build?

I don't think it's necessary to enable this by default in Ant.  For the Maven build, it's just simpler to include every module - that way, every module's POM is checked.

> 5. The ant build artifacts tend to have a leading "apache-" in front of
> them. But the maven artifactId does not have this so the artifacts file
> names are different, trivially so any way.

This different naming of artifacts has always been so, as far as I can tell, as long as Solr has released Maven artifacts.  

The conventional Maven artifact name template is <artifactId>-<version>[-<classifier>].jar, where -<classifier> is optional; <artifactId> would have to be "apache-solr" in order to make this change.  The full artifact name would be org.apache.solr:apache-solr:<version>, which seems weird to me in the double inclusion of "maven". I'm guessing this also seemed weird to whoever first put the Maven artifact naming scheme in place.  

Specifying "finalName" in the maven-jar-plugin might alternatively do the trick?  If this were done, though, the Maven naming convention would not be followed, and that's fairly predictably an omen of Bad Things To Come.

(BTW, Lucene's Maven artifacts are the same as the regular ones - this is a Solr-only issue.)

> 6. The ant solr build puts all its final artifacts into the solr/dist
> directory, the maven build does not--it leaves all of them in their build
> directory. Not a big deal but maybe there's a way to have the output file
> go someplace else?  Not sure.

I meant to keep the Maven build output location the same as the Ant build output location.  I think the Solr modules' POMs can and should be changed to eliminate this difference.

> There were two issues that seemed like clear bugs to me that I fixed with
> an attached patch.
> 1. solrj's build directory and compile output directory were the same
> directory, but that's problematic since building the output jar will
> result in an error if it sees its own jar file as an input file to its
> output jar.  So I added a "classes" directory.  This will result in a
> different directory than where the ant builds, though.
> 2. The dataimporthandler-extras output location was specified such that
> there was a redundant path: /extras/extras/, so I fixed this.

Thanks, I agree with these changes.  I committed your patch.

> By the way, I think it would be really nice to have a maven build
> instructions file that is put into place when the get-maven-poms task is
> run.  The file would have the essential instructions, it would explain
> some of the relevant differences to the ant build (notably output file
> placement, file name differences), and it would include tips such as how
> to install the sources and javadoc jar files into your local repo.

+1.  I've hesitated to include these instructions with other build instructions, since it might confuse users into thinking that the Maven build is officially supported.  (It's not.  Ant is the only official build.)

Steve


Re: Improvements to the maven build

Posted by Ryan McKinley <ry...@gmail.com>.
>
> I agree in principle, but again, I'll continue to use my own judgment ...
>

This is always good policy!

I was mostly reacting to sending a patch to the mailing list.

ryan

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


RE: Improvements to the maven build

Posted by Steven A Rowe <sa...@syr.edu>.
Hi Ryan,

On 5/4/2011 at 7:14 PM, Ryan McKinley wrote:
> As a rule, everything should go through JIRA on its way to svn -- this
> is important so that we have somewhere to point for why we did things.
>  Even small things.

Your phrase "As a rule" provides wiggle room that we all use.  "Even small things."  Um, I don't think so.  E.g. no-one is going to go through JIRA for a small typo fix.  This judgment about what's big enough to warrant a JIRA issue is one each committer has to make.  As a result, this argument (David's patch should have gone through JIRA because everything should go through JIRA) doesn't work for me.

> With patches from contributors it is especially important they are
> added to JIRA because they need to grant the license to ASF.  Also
> attachments are often stripped from mailing list archives, so down the
> road its really hard to know what happened.

These are both excellent points.  Non-trivial non-committer patches should definitely go through JIRA for these reasons.

> I understand the desire to keep maven support low key -- but we should
> do that with a good README in dev-tools.

I agree that the Maven build should be documented - I plan on putting something together soon, as suggested by David.  This seems completely orthogonal to me, though, to the question of using JIRA issues for Maven build changes.

> Even as officially non-official tools, it still gets into svn so
> we need a trail of where it came from and hopefully a log of why
> we thought it was important.

I agree in principle, but again, I'll continue to use my own judgment about whether to use JIRA for small changes, especially to stuff under dev-tools/.

Steve


Re: Improvements to the maven build

Posted by Ryan McKinley <ry...@gmail.com>.
On Fri, May 6, 2011 at 9:48 AM, Smiley, David W. <ds...@mitre.org> wrote:
>
> On May 4, 2011, at 7:14 PM, Ryan McKinley wrote:
>
>> As a rule, everything should go through JIRA on its way to svn -- this
>> is important so that we have somewhere to point for why we did things.
>> Even small things.
>
> Even "small" things?! It would be a royal pain in the ass to submit an issue for every last stupid typo, reformat, and minor thing.  I would also hope that if a committer authored a chunk of code that he believed, after the first iteration has already been committed, could use some "minor" tweak that lets say improves the clarity of the logic or has a better private method name, that he could just go ahead and commit the minor tweak.  I hope that you guys are not burdened by JIRA for such things!
>

Again, I did not mean to make a huge deal out of this -- my reaction
to seeing a patch posted as an attachment is "this belongs in JIRA" --
I don't care how trivial it is.  If the patch were in the message
text, i would feel differently.

ryan

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Re: Improvements to the maven build

Posted by Chris Hostetter <ho...@fucit.org>.
: Even "small" things?! It would be a royal pain in the ass to submit an 
: issue for every last stupid typo, reformat, and minor thing.  I would 

a rough rule of thumb: "if you can describe the problem in fewer bytes 
then the patch would take, don't bother with a jira issue"

if someone says in an email "hey i noticed a typo in these javadocs [URL]" 
or "hey i think there's an off by one error in Yak.fooBar() because of "<" 
instead of "<=" you don't need to tell them "thanks for pointing that out, 
but i can't change that until you create a patch and attach it to jira"

if someone creates a patch and sends it in an email (or attaches a 
new/modified source file) you should usually ask them to attach it to 
jira.

the main differentiator (as i understand it) is not not "size" of 
contribution, but "significance" ... something that's an obvious 
bug/mistake/typo once someone points you to a line number can just be 
fixed.  you (the committer) are writing the code to fix a bug pointed out 
by a contributor -- but when a contributor submits a "significant" chunk 
of code/functionality, we need Jira to track that they "Grant license to ASF 
for inclusion in ASF works (as per the Apache License §5)"


-Hoss

Re: Improvements to the maven build

Posted by "Smiley, David W." <ds...@mitre.org>.
On May 4, 2011, at 7:14 PM, Ryan McKinley wrote:

> As a rule, everything should go through JIRA on its way to svn -- this
> is important so that we have somewhere to point for why we did things.
> Even small things.

Even "small" things?! It would be a royal pain in the ass to submit an issue for every last stupid typo, reformat, and minor thing.  I would also hope that if a committer authored a chunk of code that he believed, after the first iteration has already been committed, could use some "minor" tweak that lets say improves the clarity of the logic or has a better private method name, that he could just go ahead and commit the minor tweak.  I hope that you guys are not burdened by JIRA for such things! 

~ David
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Re: Improvements to the maven build

Posted by Ryan McKinley <ry...@gmail.com>.
As a rule, everything should go through JIRA on its way to svn -- this
is important so that we have somewhere to point for why we did things.
 Even small things.

With patches from contributors it is especially important they are
added to JIRA because they need to grant the license to ASF.  Also
attachments are often stripped from mailing list archives, so down the
road its really hard to know what happened.

I understand the desire to keep maven support low key -- but we should
do that with a good README in dev-tools.  Even as officially
non-official tools, it still gets into svn so we need a trail of where
it came from and hopefully a log of why we thought it was important.

ryan



On Wed, May 4, 2011 at 6:52 PM, Steven A Rowe <sa...@syr.edu> wrote:
> Hi Ryan,
>
>> Do you want to make a JIRA issue with a patch?
>>
>> This is a good example of a patch that is easy to get committed
>> quickly because it is simple, clear, and understandable.
>
> Earlier today on #lucene IRC, David described the changes he had in mind, and asked me where to put the patch, and I told him that if the patch was small, the mailing list might make sense.
>
> I also told him that JIRA issues are generally a good idea, but that for the officially-non-official Maven stuff, I haven't been using JIRA, since it seemed to me like the attendant noise to signal ratio would be too high.  (Maven appears to be appreciated by Lucene/Solr users way more than the devs, and the users don't generally follow JIRA.)
>
> That said, I'm open to being convinced otherwise.
>
> Steve
>
>> On Wed, May 4, 2011 at 5:41 PM, Smiley, David W. <ds...@mitre.org>
>> wrote:
>> > Steve Row,
>> >
>> > I thought I'd put together a list of interesting differences between
>> the ant build output and the maven build output.  Before each build I did
>> a full clean and then after the build I saved a file listing to a text
>> file so that I could diff it.
>> >
>> > I'm using svn revision 1087373 (March 31st).
>> >
>> > 1. The ant build invokes a JSP compiler to validate them.  The maven
>> build does not.
>> > 2. Maven seems(?) to compile more modules' tests than the ant build
>> does.
>> > 3. The ant build builds the tools module.  The maven build does
>> not.  Probably fine it stays this way?
>> > 4. Ant doesn't build the benchmark module; maven will by default.  A
>> problem for the ant build?
>> > 5. The ant build artifacts tend to have a leading "apache-" in front of
>> them. But the maven artifactId does not have this so the artifacts file
>> names are different, trivially so any way.
>> > 6. The ant solr build puts all its final artifacts into the solr/dist
>> directory, the maven build does not--it leaves all of them in their build
>> directory. Not a big deal but maybe there's a way to have the output file
>> go someplace else?  Not sure.
>> >
>> > There were two issues that seemed like clear bugs to me that I fixed
>> with an attached patch.
>> > 1. solrj's build directory and compile output directory were the same
>> directory, but that's problematic since building the output jar will
>> result in an error if it sees its own jar file as an input file to its
>> output jar.  So I added a "classes" directory.  This will result in a
>> different directory than where the ant builds, though.
>> > 2. The dataimporthandler-extras output location was specified such that
>> there was a redundant path: /extras/extras/, so I fixed this.
>> >
>> > By the way, I think it would be really nice to have a maven build
>> instructions file that is put into place when the get-maven-poms task is
>> run.  The file would have the essential instructions, it would explain
>> some of the relevant differences to the ant build (notably output file
>> placement, file name differences), and it would include tips such as how
>> to install the sources and javadoc jar files into your local repo.
>> >
>> > ~ David Smiley
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


RE: Improvements to the maven build

Posted by Steven A Rowe <sa...@syr.edu>.
Hi Ryan,

> Do you want to make a JIRA issue with a patch?
> 
> This is a good example of a patch that is easy to get committed
> quickly because it is simple, clear, and understandable.

Earlier today on #lucene IRC, David described the changes he had in mind, and asked me where to put the patch, and I told him that if the patch was small, the mailing list might make sense.

I also told him that JIRA issues are generally a good idea, but that for the officially-non-official Maven stuff, I haven't been using JIRA, since it seemed to me like the attendant noise to signal ratio would be too high.  (Maven appears to be appreciated by Lucene/Solr users way more than the devs, and the users don't generally follow JIRA.)

That said, I'm open to being convinced otherwise.

Steve

> On Wed, May 4, 2011 at 5:41 PM, Smiley, David W. <ds...@mitre.org>
> wrote:
> > Steve Row,
> >
> > I thought I'd put together a list of interesting differences between
> the ant build output and the maven build output.  Before each build I did
> a full clean and then after the build I saved a file listing to a text
> file so that I could diff it.
> >
> > I'm using svn revision 1087373 (March 31st).
> >
> > 1. The ant build invokes a JSP compiler to validate them.  The maven
> build does not.
> > 2. Maven seems(?) to compile more modules' tests than the ant build
> does.
> > 3. The ant build builds the tools module.  The maven build does
> not.  Probably fine it stays this way?
> > 4. Ant doesn't build the benchmark module; maven will by default.  A
> problem for the ant build?
> > 5. The ant build artifacts tend to have a leading "apache-" in front of
> them. But the maven artifactId does not have this so the artifacts file
> names are different, trivially so any way.
> > 6. The ant solr build puts all its final artifacts into the solr/dist
> directory, the maven build does not--it leaves all of them in their build
> directory. Not a big deal but maybe there's a way to have the output file
> go someplace else?  Not sure.
> >
> > There were two issues that seemed like clear bugs to me that I fixed
> with an attached patch.
> > 1. solrj's build directory and compile output directory were the same
> directory, but that's problematic since building the output jar will
> result in an error if it sees its own jar file as an input file to its
> output jar.  So I added a "classes" directory.  This will result in a
> different directory than where the ant builds, though.
> > 2. The dataimporthandler-extras output location was specified such that
> there was a redundant path: /extras/extras/, so I fixed this.
> >
> > By the way, I think it would be really nice to have a maven build
> instructions file that is put into place when the get-maven-poms task is
> run.  The file would have the essential instructions, it would explain
> some of the relevant differences to the ant build (notably output file
> placement, file name differences), and it would include tips such as how
> to install the sources and javadoc jar files into your local repo.
> >
> > ~ David Smiley


Re: Improvements to the maven build

Posted by Ryan McKinley <ry...@gmail.com>.
Do you want to make a JIRA issue with a patch?

This is a good example of a patch that is easy to get committed
quickly because it is simple, clear, and understandable.

ryan


On Wed, May 4, 2011 at 5:41 PM, Smiley, David W. <ds...@mitre.org> wrote:
> Steve Row,
>
> I thought I'd put together a list of interesting differences between the ant build output and the maven build output.  Before each build I did a full clean and then after the build I saved a file listing to a text file so that I could diff it.
>
> I'm using svn revision 1087373 (March 31st).
>
> 1. The ant build invokes a JSP compiler to validate them.  The maven build does not.
> 2. Maven seems(?) to compile more modules' tests than the ant build does.
> 3. The ant build builds the tools module.  The maven build does not.  Probably fine it stays this way?
> 4. Ant doesn't build the benchmark module; maven will by default.  A problem for the ant build?
> 5. The ant build artifacts tend to have a leading "apache-" in front of them. But the maven artifactId does not have this so the artifacts file names are different, trivially so any way.
> 6. The ant solr build puts all its final artifacts into the solr/dist directory, the maven build does not--it leaves all of them in their build directory. Not a big deal but maybe there's a way to have the output file go someplace else?  Not sure.
>
> There were two issues that seemed like clear bugs to me that I fixed with an attached patch.
> 1. solrj's build directory and compile output directory were the same directory, but that's problematic since building the output jar will result in an error if it sees its own jar file as an input file to its output jar.  So I added a "classes" directory.  This will result in a different directory than where the ant builds, though.
> 2. The dataimporthandler-extras output location was specified such that there was a redundant path: /extras/extras/, so I fixed this.
>
> By the way, I think it would be really nice to have a maven build instructions file that is put into place when the get-maven-poms task is run.  The file would have the essential instructions, it would explain some of the relevant differences to the ant build (notably output file placement, file name differences), and it would include tips such as how to install the sources and javadoc jar files into your local repo.
>
> ~ David Smiley
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: dev-help@lucene.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org