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

Description

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.

Environment

None

Activity

Show:
codehaus
April 10, 2015, 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)

codehaus
April 10, 2015, 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, 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, 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, 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] &lt;bencaradocdavies&gt; jgarnett, I would like to change docs to use jar packaging so &quot;mvn eclipse:eclipse&quot; works again. aaime changed it to pom and isn&#39;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] &lt;jgarnett&gt; bencaradocdavies: I caught that in IRC yesterday

[2011-06-14 15:07:42] &lt;jgarnett&gt; but mvn eclipse:eclipse works for me ...

[2011-06-14 15:07:47] &lt;jgarnett&gt; so I am confused...

[2011-06-14 15:08:12] &lt;bencaradocdavies&gt; Try mvn eclipse:clean mvn eclipse:eclipse and see if the timestamps changed.

[2011-06-14 15:08:40] &lt;jgarnett&gt; reading ...

[2011-06-14 15:08:43] &lt;bencaradocdavies&gt; I think you like I had stale .project etc from before aaime made the change

[2011-06-14 15:08:51] &lt;jgarnett&gt; so could we cheat?

[2011-06-14 15:08:59] &lt;jgarnett&gt; copy the source code to &quot;test&quot; or something?

[2011-06-14 15:09:15] &lt;jgarnett&gt; or make use of assembly and ask it to package up nothing?

[2011-06-14 15:09:25] &lt;bencaradocdavies&gt; Nope

[2011-06-14 15:09:35] &lt;bencaradocdavies&gt; Just make it jar packaging.

[2011-06-14 15:09:36] &lt;jgarnett&gt; darn

[2011-06-14 15:09:49] &lt;bencaradocdavies&gt; Takes 1.2 more seconds. Not the four I told aaime yesterday.

[2011-06-14 15:10:00] &lt;jgarnett&gt; well I really do want the java source code to be compiled; and to break the build ...

[2011-06-14 15:10:04] &lt;bencaradocdavies&gt; Four I could understand being a problem, but one is not too bad.

[2011-06-14 15:10:10] &lt;jgarnett&gt; for 1.2 seconds it is worth it

[2011-06-14 15:10:32] &lt;jgarnett&gt; only other option is to separate out the code into a &quot;sub module&quot; ....

[2011-06-14 15:10:58] &lt;jgarnett&gt; or otherwise play silly games ...

[2011-06-14 15:11:03] &lt;bencaradocdavies&gt; I don&#39;t see the problem.

[2011-06-14 15:11:18] &lt;bencaradocdavies&gt; I think aaime is just sore we are using maven at all for docs.

[2011-06-14 15:11:24] &lt;jgarnett&gt; let me comment on the bug; and you can go ahead ...

[2011-06-14 15:11:45] &lt;bencaradocdavies&gt; OK, I just needed a bit of support before defying aaime.

[2011-06-14 15:11:57] &lt;bencaradocdavies&gt; And you are the module maintainer.

[2011-06-14 15:12:15] &lt;bencaradocdavies&gt; His changes reduce the build time from &gt;40 seconds to 7 second

[2011-06-14 15:12:27] &lt;bencaradocdavies&gt; for a recompile with no clean

[2011-06-14 15:12:40] &lt;bencaradocdavies&gt; so almost all of his changes are still there.

[2011-06-14 15:13:22] &lt;bencaradocdavies&gt; 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] &lt;jgarnett&gt; yep

[2011-06-14 15:15:42] &lt;jgarnett&gt; Q: what are we trying to make fast?

[2011-06-14 15:15:45] &lt;jgarnett&gt; &quot;mvn install&quot;

[2011-06-14 15:15:52] &lt;jgarnett&gt; &quot;mvn install -Dall&quot;

[2011-06-14 15:15:56] &lt;jgarnett&gt; ?

[2011-06-14 15:16:44] &lt;jgarnett&gt; 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] &lt;jgarnett&gt; sorry

[2011-06-14 15:16:53] &lt;jgarnett&gt; -Pdocs is used

[2011-06-14 15:18:51] --&gt;| jgarnett1 (~<a href='jodyg@101.169.173.107'>jodyg@101.169.173.107</a>) has joined #geotools

[2011-06-14 15:20:19] &lt;CIA-44&gt; ^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] |&lt;-- jgarnett has left freenode (Ping timeout: 252 seconds)

[2011-06-14 15:21:53] &lt;bencaradocdavies&gt; I think what aaime wanted was &quot;mvn -o compile&quot; to be fast on subsequent runs.

[2011-06-14 15:22:29] &lt;bencaradocdavies&gt; I&#39;ve just set the packaging back to jar.

[2011-06-14 15:22:45] &lt;bencaradocdavies&gt; 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] &lt;bencaradocdavies&gt; setting the docs to jar packaging makes &quot;mvn -o compile&quot; take 7.8 seconds instead on 6.6 seconds.

[2011-06-14 15:23:32] &lt;jgarnett1&gt; bencaradocdavies: thanks muchly

[2011-06-14 15:23:55] &lt;jgarnett1&gt; (this may explain some confusion I had the other weak with &quot;docs&quot; not showing up when a new user set up their development environment with mvn eclipse:eclipse )

Assignee

Unassigned

Reporter

codehaus

Triage

None

Components

Fix versions

Affects versions

Priority

Medium
Configure