docs pom packaging breaks Eclipse integration and causes Java non-compilation
Description
Environment
Activity

codehaus April 10, 2015 at 2:52 PM
CodeHaus Comment From: bencaradocdavies - Time: Tue, 14 Jun 2011 02:35:37 -0500
---------------------
A bit more from #geotools.2011-06-14.log, for the record:
[2011-06-14 15:07:11] <bencaradocdavies> jgarnett, I would like to change docs to use jar packaging so "mvn eclipse:eclipse" works again. aaime changed it to pom and isn't so keen: <a href="http://jira.codehaus.org/browse/GEOT-3650">http://jira.codehaus.org/browse/GEOT-3650</a>
[2011-06-14 15:07:37] <jgarnett> bencaradocdavies: I caught that in IRC yesterday
[2011-06-14 15:07:42] <jgarnett> but mvn eclipse:eclipse works for me ...
[2011-06-14 15:07:47] <jgarnett> so I am confused...
[2011-06-14 15:08:12] <bencaradocdavies> Try mvn eclipse:clean mvn eclipse:eclipse and see if the timestamps changed.
[2011-06-14 15:08:40] <jgarnett> reading ...
[2011-06-14 15:08:43] <bencaradocdavies> I think you like I had stale .project etc from before aaime made the change
[2011-06-14 15:08:51] <jgarnett> so could we cheat?
[2011-06-14 15:08:59] <jgarnett> copy the source code to "test" or something?
[2011-06-14 15:09:15] <jgarnett> or make use of assembly and ask it to package up nothing?
[2011-06-14 15:09:25] <bencaradocdavies> Nope
[2011-06-14 15:09:35] <bencaradocdavies> Just make it jar packaging.
[2011-06-14 15:09:36] <jgarnett> darn
[2011-06-14 15:09:49] <bencaradocdavies> Takes 1.2 more seconds. Not the four I told aaime yesterday.
[2011-06-14 15:10:00] <jgarnett> well I really do want the java source code to be compiled; and to break the build ...
[2011-06-14 15:10:04] <bencaradocdavies> Four I could understand being a problem, but one is not too bad.
[2011-06-14 15:10:10] <jgarnett> for 1.2 seconds it is worth it
[2011-06-14 15:10:32] <jgarnett> only other option is to separate out the code into a "sub module" ....
[2011-06-14 15:10:58] <jgarnett> or otherwise play silly games ...
[2011-06-14 15:11:03] <bencaradocdavies> I don't see the problem.
[2011-06-14 15:11:18] <bencaradocdavies> I think aaime is just sore we are using maven at all for docs.
[2011-06-14 15:11:24] <jgarnett> let me comment on the bug; and you can go ahead ...
[2011-06-14 15:11:45] <bencaradocdavies> OK, I just needed a bit of support before defying aaime.
[2011-06-14 15:11:57] <bencaradocdavies> And you are the module maintainer.
[2011-06-14 15:12:15] <bencaradocdavies> His changes reduce the build time from >40 seconds to 7 second
[2011-06-14 15:12:27] <bencaradocdavies> for a recompile with no clean
[2011-06-14 15:12:40] <bencaradocdavies> so almost all of his changes are still there.
[2011-06-14 15:13:22] <bencaradocdavies> jgarnett, we could break out the code into a docs-examples module, but that would be super-overkill for a one-second speedup
[2011-06-14 15:15:33] <jgarnett> yep
[2011-06-14 15:15:42] <jgarnett> Q: what are we trying to make fast?
[2011-06-14 15:15:45] <jgarnett> "mvn install"
[2011-06-14 15:15:52] <jgarnett> "mvn install -Dall"
[2011-06-14 15:15:56] <jgarnett> ?
[2011-06-14 15:16:44] <jgarnett> We could try and do a profile so that the sphinx docs are only build when -Pwps is used ...
[2011-06-14 15:16:50] <jgarnett> sorry
[2011-06-14 15:16:53] <jgarnett> -Pdocs is used
[2011-06-14 15:18:51] -->| jgarnett1 (~<a href='jodyg@101.169.173.107'>jodyg@101.169.173.107</a>) has joined #geotools
[2011-06-14 15:20:19] <CIA-44> ^C03bencaradocdavies^O * r^B37432^O ^C10^O/trunk/docs/pom.xml^B:^O <a href="https://jira.codehaus.org/browse/GEOT-3650" title="docs pom packaging breaks Eclipse integration and causes Java non-compilation" class="issue-link" data-issue-key="GEOT-3650"><strike>GEOT-3650</strike></a>: docs pom packaging breaks Eclipse integration and causes Java non-compilation
[2011-06-14 15:21:27] |<-- jgarnett has left freenode (Ping timeout: 252 seconds)
[2011-06-14 15:21:53] <bencaradocdavies> I think what aaime wanted was "mvn -o compile" to be fast on subsequent runs.
[2011-06-14 15:22:29] <bencaradocdavies> I've just set the packaging back to jar.
[2011-06-14 15:22:45] <bencaradocdavies> As noted in: <a href="http://jira.codehaus.org/browse/GEOT-3650">http://jira.codehaus.org/browse/GEOT-3650</a>
[2011-06-14 15:23:20] <bencaradocdavies> setting the docs to jar packaging makes "mvn -o compile" take 7.8 seconds instead on 6.6 seconds.
[2011-06-14 15:23:32] <jgarnett1> bencaradocdavies: thanks muchly
[2011-06-14 15:23:55] <jgarnett1> (this may explain some confusion I had the other weak with "docs" not showing up when a new user set up their development environment with mvn eclipse:eclipse )

codehaus April 10, 2015 at 2:52 PM
CodeHaus Comment From: bencaradocdavies - Time: Tue, 14 Jun 2011 02:21:09 -0500
---------------------
Thanks, Jody. Committed in r37432 on trunk.

codehaus April 10, 2015 at 2:52 PM
CodeHaus Comment From: jgarnett - Time: Tue, 14 Jun 2011 02:18:40 -0500
---------------------
Tough tough call
So if the jar takes the 1.2 seconds reported on IRC chat just now then it is really worth it - we want to catch regressions in the Java code. This is the main point of us using live code examples.
If we really want to save some time; we could set it so the sphinx docs only are build when "mvn install -Pdocs" is called.

codehaus April 10, 2015 at 2:52 PM
CodeHaus Comment From: jgarnett - Time: Tue, 14 Jun 2011 02:17:27 -0500
---------------------
Tough tough call
So if the jar takes the 1.2 seconds reported on IRC chat just now then it is really worth it - we want to catch regressions in the Java code. This is the main point of us using live code examples.
If we really want to save some time; we could set it so the sphinx docs only are build when "mvn install -Pdocs" is called.

codehaus April 10, 2015 at 2:52 PM
CodeHaus Comment From: bencaradocdavies - Time: Mon, 13 Jun 2011 23:30:46 -0500
---------------------
Except from #geotools.2011-06-13.log:
[2011-06-13 16:29:51] <bencaradocdavies> aaime, On 15 May in r37194 you changed packaging for docs from pom to jar. This prevents mvn eclipse:eclipse from processing the module. Do you mind if I change it back to jar packaging?
[2011-06-13 16:30:19] <aaime> slows down the build, so I mind
[2011-06-13 16:30:35] <aaime> please ask around
[2011-06-13 16:36:21] <bencaradocdavies> aaime, how does it slow the build?
[2011-06-13 16:36:30] <aaime> it has to build and install a jar
[2011-06-13 16:36:50] <aaime> while you're trying to compile the docs
[2011-06-13 16:37:08] <aaime> If you write documentation that gets into the write/build/check cycle
[2011-06-13 16:37:11] <aaime> very annoying
[2011-06-13 16:37:33] <bencaradocdavies> didn't think that was a big overhead. Will test.
[2011-06-13 16:37:52] <aaime> geotools build is already significantly slower than gs one
[2011-06-13 16:38:00] <aaime> (we don't use maven in gs)
On 15 May in r37194 "Speedup repeated doc builds", Andrea changed packaging for docs from jar to pom. This saves a little time in the build (in addition to the huge repeated-build speedup implemented by Andrea), but prevents mvn eclipse:eclipse from processing the module (it will not process projects with pom packaging). Furthermore, with pom packaging, the Java in docs is not compiled. This defeats the purpose of having Java in the module, and having declared dependencies in the project pom. Compiling the Java is important because it detects errors and gives docs developers the ability to test their examples in Eclipse.
"mvn -o clean install" takes about 47 seconds for jar versus about 43 seconds for pom packaging. On #geotools I asked Andrea if I could revert to jar packaging at the cost of an extra four seconds; Andrea did not support this change. But things are not quite this bad: most of the extra time is taken "Compiling 69 source files" and a little for building and installing the jars.
We can skip the java compilation by not using clean. Once an initial build has been made:
"mvn -o install" takes about 9.3 seconds for jar versus about 8.3 seconds for pom packaging.
We can skip the jar building by running the compile target instead:
"mvn -o compile" takes about 7.8 seconds for jar versus about 6.6 seconds for pom packaging.
So what I'm really asking for is an extra 1.2 seconds per "mvn -o compile" so we can get Eclipse integration and Java compilation working again.