Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jcabi-matchers is a runtime dependency #38

Closed
wants to merge 1 commit into from
Closed

jcabi-matchers is a runtime dependency #38

wants to merge 1 commit into from

Conversation

nicoulaj
Copy link

@nicoulaj nicoulaj commented Sep 8, 2017

Not sure if I'm missing something, but it seems to me jcabi-matchers is a runtime dependency and not just a test one.

It is used by DefaultHtmlValidator:

java.lang.NoClassDefFoundError: com/jcabi/matchers/XhtmlMatchers
	at com.jcabi.http.response.XmlResponse.assertXPath(XmlResponse.java:142)
	at com.jcabi.w3c.DefaultHtmlValidator.validate(DefaultHtmlValidator.java:87)

Not sure if I'm missing something, but it seems to me `jcabi-matchers` is a runtime dependency and not just a test one.

It is used by `DefaultHtmlValidator`:
```
java.lang.NoClassDefFoundError: com/jcabi/matchers/XhtmlMatchers
	at com.jcabi.http.response.XmlResponse.assertXPath(XmlResponse.java:142)
	at com.jcabi.w3c.DefaultHtmlValidator.validate(DefaultHtmlValidator.java:87)
```
@0crat
Copy link

0crat commented Sep 8, 2017

@yegor256 please, pay attention to this pull request

@0crat
Copy link

0crat commented Sep 8, 2017

Job gh:jcabi/jcabi-w3c#38 is in scope.

@yegor256
Copy link
Member

yegor256 commented Sep 8, 2017

@rultor merge

@rultor
Copy link
Contributor

rultor commented Sep 8, 2017

@rultor merge

@yegor256 OK, I'll try to merge now. You can check the progress of the merge here

@rultor
Copy link
Contributor

rultor commented Sep 8, 2017

@rultor merge

@nicoulaj @yegor256 Oops, I failed. You can see the full log here (spent 10min)

Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-invoker/2.0.11/maven-invoker-2.0.11.jar
             
Downloaded: https://repo.maven.apache.org/maven2/commons-digester/commons-digester/1.6/commons-digester-1.6.jar (0 B at 0.0 KB/sec)
             
Downloaded: https://repo.maven.apache.org/maven2/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.jar (0 B at 0.0 KB/sec)
             
Downloaded: https://repo.maven.apache.org/maven2/xml-apis/xml-apis/1.0.b2/xml-apis-1.0.b2.jar (0 B at 0.0 KB/sec)
             
Downloaded: https://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-invoker/2.0.11/maven-invoker-2.0.11.jar (0 B at 0.0 KB/sec)
             
Downloaded: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/2.0.2/plexus-utils-2.0.2.jar (0 B at 0.0 KB/sec)
[INFO] Calling org.codehaus.mojo:cobertura-maven-plugin:2.5.1:check...
[INFO] Cannot perform check, instrumentation not performed - skipping.
[WARNING] Unused declared dependencies found:
	com.jcabi:jcabi-matchers:jar:1.3:compile
[INFO] Read our quality policy: http://www.qulice.com/quality.html
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 07:49 min
[INFO] Finished at: 2017-09-08T13:51:03+00:00
[INFO] Final Memory: 60M/557M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.qulice:qulice-maven-plugin:0.17.1:check (jcabi-check) on project jcabi-w3c: Failure: 1 dependency problem(s) found -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.qulice:qulice-maven-plugin:0.17.1:check (jcabi-check) on project jcabi-w3c: Failure
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
	at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
	at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
	at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
	at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
	at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
	at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoFailureException: Failure
	at com.qulice.maven.CheckMojo.doExecute(CheckMojo.java:72)
	at com.qulice.maven.AbstractQuliceMojo.execute(AbstractQuliceMojo.java:172)
	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
	... 20 more
Caused by: com.qulice.spi.ValidationException: 1 dependency problem(s) found
	at com.qulice.maven.DependenciesValidator.validate(DependenciesValidator.java:100)
	at com.qulice.maven.CheckMojo.run(CheckMojo.java:125)
	at com.qulice.maven.CheckMojo.doExecute(CheckMojo.java:66)
	... 23 more
[ERROR] 
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
container c3ddad1c94c2bd3b980e5a0580544f530cef9de1e2519019ebb88f270127e572 is dead
Fri Sep  8 15:51:30 CEST 2017

@yegor256
Copy link
Member

@nicoulaj I think we need runtime scope

@nicoulaj
Copy link
Author

@yegor256: After giving a closer look, the correct dependency chain is jcabi-w3c -> jcabi-http -> jcabi-matchers in my opinion, and the source of the issue is in jcabi-http, which has a lot of dependencies marked as provided+optional: jcabi/jcabi-http@a3a8644
Any idea why ?

@yegor256
Copy link
Member

@nicoulaj jcabi-http has many "optional" dependencies, because the core functionality of the library doesn't require them. For example, you can use jcabi-http without jcabi-matchers. Only when you start using assert*() methods that jcabi-matchers will become necessary.

@nicoulaj
Copy link
Author

Optional dependencies are not a really good pattern, the result is that as an end user I have to go through your dependency tree to understand how to use the library...
A cleaner way is to split the librairies in modules.

@0crat
Copy link

0crat commented Apr 12, 2018

@yegor256/z everybody who has role DEV are banned at this job; I won't be able to assign anyone automatically; consider assigning someone manually or invite more people to the project, as explained in §51

@yegor256
Copy link
Member

@nicoulaj well, maybe. But that's the way it works now. To merge this PR we need to set the dependency into runtime scope.

@nicoulaj nicoulaj closed this Apr 13, 2018
@0crat
Copy link

0crat commented Apr 13, 2018

The job #38 is now out of scope

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants