Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 912708

Summary: Errai build fails on Errai::Codegen::GWT
Product: [Retired] JBoss Enterprise WFK Platform 2 Reporter: Stefan Miklosovic <smikloso>
Component: ErraiAssignee: Pavel SLegr <pslegr>
Status: CLOSED CURRENTRELEASE QA Contact: Stefan Miklosovic <smikloso>
Severity: high Docs Contact:
Priority: high    
Version: 2.2.0CC: cbrock, csadilek, jfuerth, mnovotny, oskutka, pslegr
Target Milestone: ER1   
Target Release: 2.2.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-05-14 14:55:05 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
building of errai is errorneous
none
even compilation is successful, these errors appears none

Description Stefan Miklosovic 2013-02-19 13:31:58 UTC
Created attachment 699456 [details]
building of errai is errorneous

Description of problem:
When trying to build errai sources from scratch there is the error while doing so, please check attachment in order to be more specific.

Version-Release number of selected component (if applicable):
jboss-wfk-2.2.0-SNAPSHOT
  
Actual results:
Build is faling to compile sources.

Expected results:
Build is not failing.

Comment 2 Jonathan Fuerth 2013-02-19 17:49:59 UTC
As Marek found, the problem is that Maven doesn't see the test-jar dependency from the errai-codegen module during a reactor build.

You can work around this problem without commenting out the dependency by first doing a mvn install (or mvn deploy) on errai-codegen (only), and then running the whole reactor build again. This workaround needs to be performed once every time the Errai version number changes. :-(

The fundamental problem is that errai-codegen-gwt needs access to the test-scoped classes (and their sources) in errai-codegen. If you know a better way to do this, please let me know!

Comment 3 Karel Piwko 2013-02-20 11:32:54 UTC
Jonathan, 

I think that Marek's workaround should be sound an correct. Maven should see <type>test-jar</type> from reactor.

You should simply attach test-jar execution goal to jar plugin.

More details here:

http://maven.apache.org/guides/mini/guide-attached-tests.html

Comment 4 Marek Novotny 2013-02-20 12:44:18 UTC
Well I can't see that maven has got any issue with visibility of test jar. 

Jonathan, your local environment is affected by this issue?

Just to be clear, that issue came from WFK 2.2.0.DR2 testing and I was aware of it, but I fixed sources following day and it is not available for QE yet - ER1 is the target.

Comment 5 Jonathan Fuerth 2013-02-20 14:35:11 UTC
Karel, thanks for the pointer. I actually used that mini-guide from the Maven site to set this up in the first place. If you look at the configuration in errai-codegen, you will see it is identical: 

  https://github.com/errai/errai/blob/master/errai-codegen/pom.xml#L89

Marek, I originally read your diff backwards. I see now that your change was to reinstate the test-jar dependency from errai-codegen-gwt to errai-codegen, which brings the product branch back in line with the upstream project.

To answer your question, yes, we have a problem with visibility of the test-jar in reactor builds. Every time we change errai.version in the root pom, the first full build fails at errai-codegen-gwt on a missing dependency. Whoever originally commented out that test-jar dependency in the product repo probably did so because of this missing dependency error.

STEPS TO REPRODUCE:

1. Set the errai.version property in errai-parent pom.xml to a new value that has never been used before
2. Execute 'mvn install' on the errai-parent project

ACTUAL OUTCOME:

Build fails in the errai-codegen-gwt module on missing test-jar dependency.

WORKAROUND:

Run 'mvn install' in the errai-codegen module, then go back to errai-parent and build again.

Comment 6 Jonathan Fuerth 2013-02-20 15:02:26 UTC
My STEPS TO REPRODUCE above are incorrect. Sorry about that. Here are the steps I should have specified:

1. From the errai-parent root directory, execute 'mvn versions:set -DnewVersion=3.0-buildtest1'
2. Build everything, with tests enabled: 'mvn clean install -Pintegration-test -Dgwt.compiler.skip'

But the crazy thing is, I can't reproduce the problem by following these steps! Mike and Christian and I have all run into exactly this dependency problem when we have updated the Errai version in the past. Apparently someone else did too when working with the product build (hence the commented-out dependency in errai-codegen-gwt/pom.xml). But now it's working just fine for me. I don't know why.

I've double checked the changelog for both poms, and nothing has changed since our last release, when we definitely ran into the problem I'm describing. Anyway, seems everything is magically delicious now!

Comment 7 Marek Novotny 2013-02-20 16:22:08 UTC
I would check and blame older version of Maven, we currently use 3.0.3 in MEAD or 3.0.4 on jenkins CI and in local environment too. And I recall that early releases of 3.0.x had similar issue you were describing.

Comment 8 Jonathan Fuerth 2013-02-21 22:14:00 UTC
Yes, I'm on 3.0.4.. but I haven't updated in some time. And maven-jar-plugin is version-pinned in the pom too. Perhaps Maven self-updated the internal component that's responsible for deciding which plugin executions to perform. Can it do that?

Yesterday, Christian tried to reproduce this on his machine, and I tried again on my machine with Errai's 2.2 branch, and neither of us could reproduce the dependency resolution problem. So the problem is "fixed" here too, but the mystery remains!

Comment 10 Stefan Miklosovic 2013-02-27 13:08:28 UTC
Created attachment 703427 [details]
even compilation is successful, these errors appears

Comment 11 Stefan Miklosovic 2013-02-27 13:11:34 UTC
Comment on attachment 703427 [details]
even compilation is successful, these errors appears

Compilation of the Errai sources from scratch is successful but errors in the attachments are shown and some tests are failing. Since I do not have a clue how serious these failures are, the reporting of it is definitely the way to go.

Please give me some feedback if I can close this issue as "verified" or other actions have to be taken.

Comment 12 Marek Novotny 2013-02-27 13:29:12 UTC
Stefan, create a new issue for those failing tests, grouping different issues into one is not good approach.

Comment 14 Karel Piwko 2013-05-14 14:55:05 UTC
Closed as CURRENTRELEASE, part of WFK 2.2.0 distributables.