Page 1 of 4

Build Failure on Linux - EnforcerRuleException

Posted: Mon May 08, 2017 3:00 am
by J.L.C.
Hi,

I'm wondering if anyone can help me sort out an issue with compiling UMS on Fedora 24

Code: Select all

$ mvn -version
Apache Maven 3.3.9 (NON-CANONICAL_2016-04-07T23:15:34Z_mockbuild; 2016-04-07T19:15:34-04:00)
Maven home: /usr/share/maven
Java version: 1.8.0_131, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.131-1.b12.fc24.x86_64/jre
Default locale: en_CA, platform encoding: UTF-8
OS name: "linux", version: "4.10.11-100.fc24.x86_64", arch: "amd64", family: "unix"
I have been building UMS on this system for a couple of years now, but all of a sudden with 6.6.1, I get a convergence error:

Code: Select all

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.301 s
[INFO] Finished at: 2017-05-07T10:56:00-04:00
[INFO] Final Memory: 13M/217M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:1.4.1:enforce (enforce) on project ums: Some Enforcer rules have failed. Look above for specific messages explaining why the rule failed. -> [Help 1]
I have attached a log taken using mvn -X package
edit: it seems the "board attachment quota has been reached, so I have copied the log to pastebin: https://pastebin.com/187yMuiu

Any help getting this resolved would be greatly appreciated!

Re: Build Failure on Linux - EnforcerRuleException

Posted: Mon May 08, 2017 5:05 am
by Nadahar

Code: Select all

Dependency convergence error for com.jgoodies:jgoodies-common:1.4.0 paths to dependency are:
+-net.pms:ums:6.6.1-SNAPSHOT
  +-com.jgoodies:jgoodies-forms:1.6.0
    +-com.jgoodies:jgoodies-common:1.4.0
and
+-net.pms:ums:6.6.1-SNAPSHOT
  +-com.jgoodies:jgoodies-looks:2.7.0
    +-com.jgoodies:jgoodies-common:1.8.1
]
There's some problem with the jgoodies versions, but I'm not sure exactly what. valib recently did some changes to the POM which I guess is causing this. I'll notify him.

Re: Build Failure on Linux - EnforcerRuleException

Posted: Mon May 08, 2017 5:56 am
by Sami32
http://maven.apache.org/enforcer/enforc ... gence.html
http://stackoverflow.com/questions/1610 ... nce-issues

That was my 2 cents contribution ;-)

EDIT: That's said, i don't understand why this issue appear with Linux and not with Windows...

Re: Build Failure on Linux - EnforcerRuleException

Posted: Mon May 08, 2017 8:45 am
by valib
J.L.C. I also don't understand why it works on Windows not on Linux. You can try two things.
1. we are using the latest Maven version 3.5.0 so please try to install the latest Maven and test it again. You use version 3.3.9
2. if it would not solve the problem please try to change in the pom.xml

Code: Select all

		<dependency>
			<groupId>com.jgoodies</groupId>
			<artifactId>jgoodies-forms</artifactId>
			<version>${jgoodies-forms-version}</version>
		</dependency>
to

Code: Select all

		<dependency>
			<groupId>com.jgoodies</groupId>
			<artifactId>jgoodies-forms</artifactId>
			<version>${jgoodies-forms-version}</version>
			<exclusions>
				<exclusion>
					<groupId>com.jgoodies</groupId>
					<artifactId>jgoodies-common</artifactId>
				</exclusion>
			</exclusions>
		</dependency>
and report the result.
Maybe it could also solve the problem I see in you log like

Code: Select all

[DEBUG] Error releasing shared lock for resolution tracking file: /root/.m2/repository/org/slf4j/slf4j-api/resolver-status.properties
java.nio.channels.ClosedChannelException
    at sun.nio.ch.FileLockImpl.release(FileLockImpl.java:58)
    at org.apache.maven.repository.legacy.DefaultUpdateCheckManager.read(DefaultUpdateCheckManager.java:396)
    ......

Re: Build Failure on Linux - EnforcerRuleException

Posted: Tue May 09, 2017 7:47 am
by J.L.C.
Thanks for the assistance.

I have upgraded maven to version 3.5.0 and made the suggested change to the pom.xml, but the build still fails.

Now with a surefire error:

Code: Select all

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 14.369 s
[INFO] Finished at: 2017-05-08T15:44:49-04:00
[INFO] Final Memory: 37M/486M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test (default-test) on project ums: There are test failures.
[ERROR] 
[ERROR] Please refer to /usr/local/UMS/ums-latest/universalmediaserver/target/surefire-reports for the individual test results.
Here is a log of the failed build after making the above changes:
https://pastebin.com/BMYCjPZf


The 6.6.1 snapshot does compile without error on my Ubuntu 16.04 system. These problems seem to be specific to my Fedora machine.

Re: Build Failure on Linux - EnforcerRuleException

Posted: Tue May 09, 2017 9:35 am
by valib
So see that the problem is not in the Dependency convergence error but it could be in your Java instalation. Please try to reinstall the Java.

Re: Build Failure on Linux - EnforcerRuleException

Posted: Tue May 09, 2017 9:43 am
by Sami32
J.L.C. I think Ubuntu use Java OpenJDK by default, and your Fedora is Oracle one, could that be related to this issue ?

A dirty work around for build UMS should be to add

Code: Select all

-DskipTests
to your Maven command line.

Code: Select all

-DfailIfNoTests=false
instead could eventually give us more informations on this issue, but not necessary be able to compile it.

Re: Build Failure on Linux - EnforcerRuleException

Posted: Tue May 09, 2017 9:52 am
by Nadahar
I'm pretty sure this is due to the latest changes in the POM. This must be figured out or the changes must be reversed as I see it. There's no need for a "workaround".

@valib "Installing" Java isn't the same on Linux as on Windows, installations are maintained by the system's package manager. You should focus on the changes made to the Enforcer plugin configuration and what the consequences of these changes might be.

Re: Build Failure on Linux - EnforcerRuleException

Posted: Fri May 12, 2017 5:16 am
by J.L.C.
Sami32 wrote:J.L.C. I think Ubuntu use Java OpenJDK by default, and your Fedora is Oracle one, could that be related to this issue ?

A dirty work around for build UMS should be to add

Code: Select all

-DskipTests
to your Maven command line.

Code: Select all

-DfailIfNoTests=false
instead could eventually give us more informations on this issue, but not necessary be able to compile it.
As you suspected, I was able to successfully build using

Code: Select all

 -DskipTests 
To provide more information, I also ran the build with

Code: Select all

-DfailIfNoTests=false
The resulting log of errors is here:
https://pastebin.com/u1WtB31R

Thanks for the assistance!

Re: Build Failure on Linux - EnforcerRuleException

Posted: Fri May 12, 2017 5:23 am
by Nadahar
It's fine that you can build when you disable tests, but that doesn't solve the problem. The build should succeed with either Oracle or OpenJDK. Our Travis-CI builds use Oracle Java 7 and 8 and OpenJDK 7. The reason we don't have an OpenJDK 8 automated test is that OpenJDK isn't available in Ubuntu 12.04 which Travis uses for their VMs. That doesn't mean that it shouldn't build on OpenJDK 8 without errors.