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

mvn qulice:check -Pqulice fails to read license #400

Closed
asaen opened this issue Feb 9, 2015 · 23 comments
Closed

mvn qulice:check -Pqulice fails to read license #400

asaen opened this issue Feb 9, 2015 · 23 comments
Assignees
Labels

Comments

@asaen
Copy link

asaen commented Feb 9, 2015

Running locally under windows 7 mvn qulice:check -Pqulice -e on a project with LICENSE.txt inside the project folder leads to the following error:

[INFO] --- qulice-maven-plugin:0.12:check (default-cli) @ aProject ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6.774 s
[INFO] Finished at: 2015-02-10T01:30:57+03:00
[INFO] Final Memory: 15M/308M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.qulice:qulice-maven-plugin:0.12:check (default-cli) on project aProject: Execution default-cli of goal com.qulice:qulice-maven-plugin:0.12:check failed: Failed to read license: Unknown host D -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.qulice:qulice-maven-plugin:0.12:check (default-cli) on project aProject: Execution default-cli of goal com.qulice:qulice-maven-plugin:0.12:check failed: Failed to read license
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:224)
        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:120)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:355)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:216)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:160)
        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.PluginExecutionException: Execution default-cli of goal com.qulice:qulice-maven-plugin:0.12:check failed: Failed to read license
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:143)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
        ... 19 more
Caused by: java.lang.IllegalStateException: Failed to read license
        at com.qulice.checkstyle.CheckstyleValidator.header(CheckstyleValidator.java:151)
        at com.qulice.checkstyle.CheckstyleValidator.configuration(CheckstyleValidator.java:120)
        at com.qulice.checkstyle.CheckstyleValidator.validate(CheckstyleValidator.java:86)
        at com.qulice.maven.CheckMojo.run(CheckMojo.java:83)
        at com.qulice.maven.CheckMojo.doExecute(CheckMojo.java:59)
        at com.qulice.maven.AbstractQuliceMojo.execute(AbstractQuliceMojo.java:175)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)
        ... 20 more
Caused by: java.net.UnknownHostException: D
        at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:178)
        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)
        at java.net.Socket.connect(Socket.java:579)
        at java.net.Socket.connect(Socket.java:528)
        at sun.net.ftp.impl.FtpClient.doConnect(FtpClient.java:958)
        at sun.net.ftp.impl.FtpClient.tryConnect(FtpClient.java:918)
        at sun.net.ftp.impl.FtpClient.connect(FtpClient.java:1013)
        at sun.net.ftp.impl.FtpClient.connect(FtpClient.java:999)
        at sun.net.www.protocol.ftp.FtpURLConnection.connect(FtpURLConnection.java:294)
        at sun.net.www.protocol.ftp.FtpURLConnection.getInputStream(FtpURLConnection.java:393)
        at java.net.URL.openStream(URL.java:1037)
        at com.qulice.checkstyle.CheckstyleValidator.header(CheckstyleValidator.java:148)
        ... 26 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/PluginExecutionException

It seems that the method com.qulice.checkstyle.CheckstyleValidator.header(Environment) builds a wrong URL.

@yegor256
Copy link
Owner

yegor256 commented Feb 9, 2015

isn't it a duplicate of #397?

@asaen
Copy link
Author

asaen commented Feb 9, 2015

@yegor256 they are probably different sides of the same coin. Let's wait till #397 is resolved and check this one again.

@asaen
Copy link
Author

asaen commented Aug 26, 2015

@yegor256 it is still reproducible with qulice version 0.12.1 even when #397 is closed. I would say they are not duplicates, aren't they?

@yegor256
Copy link
Owner

@darkled ok, let's try to fix this separately

@davvd
Copy link

davvd commented Aug 27, 2015

@darkled this task will get someone's attention soon

@davvd
Copy link

davvd commented Aug 27, 2015

@krzyk this task is yours, go ahead

@davvd davvd added the DEV label Aug 27, 2015
@davvd davvd added the 30 mins label Aug 27, 2015
@davvd
Copy link

davvd commented Aug 27, 2015

@darkled thanks for tis bug, I topped your account for 15 mins, transaction 63938954

@krzyk
Copy link
Collaborator

krzyk commented Aug 28, 2015

@darkled could you share pom.xml and the full path name you use for the project?
I tried it in few projects that use qulice 0.12, and all succeed under windows.

@asaen
Copy link
Author

asaen commented Aug 30, 2015

@krzyk I think they succeed because your pom.xml's has configured license:

<license>file:${basedir}/LICENSE.txt</license>

In my case qulice has the default configuration for the license and its configuration looks like:

<profile>
    <id>qulice</id>
    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>com.jcabi</groupId>
                    <artifactId>jcabi-maven-plugin</artifactId>
                    <dependencies>
                        <dependency>
                            <groupId>org.hibernate</groupId>
                            <artifactId>hibernate-validator</artifactId>
                            <version>${hibernate.validator}</version>
                            <scope>runtime</scope>
                        </dependency>
                    </dependencies>
                </plugin>
                <plugin>
                    <groupId>com.qulice</groupId>
                    <artifactId>qulice-maven-plugin</artifactId>
                    <version>0.12.1</version>
                    <configuration>
                        <license>file://${basedir}/LICENSE.txt</license>
                        <excludes combine.children="append">
                            <exclude>findbugs:.*</exclude>
                            <exclude>checkstyle:/src/main/resources/com/sigzig/.*</exclude>
                        </excludes>
                    </configuration>
                    <dependencies>
                        <dependency>
                            <groupId>org.hibernate</groupId>
                            <artifactId>hibernate-validator</artifactId>
                            <version>${hibernate.validator}</version>
                            <scope>runtime</scope>
                        </dependency>
                    </dependencies>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>
</profile>

@krzyk
Copy link
Collaborator

krzyk commented Aug 30, 2015

@darkled In your example profile, license is defined as <license>file://${basedir}/LICENSE.txt</license>, does it work when you remove the //?

@krzyk
Copy link
Collaborator

krzyk commented Aug 30, 2015

@darkled also, why override license configuration, and add // after file:? Is this just a mistake, or is it done on purpose?

@krzyk
Copy link
Collaborator

krzyk commented Sep 1, 2015

@davvd please give me more time

@davvd
Copy link

davvd commented Sep 1, 2015

@davvd please give me more time

@krzyk agreed, take your time

@asaen
Copy link
Author

asaen commented Sep 1, 2015

@krzyk you're right, when if I remove // it works fine. I am not sure about the reason of overriding default configuration, this pom.xml is taken from another teamed's project. Could you please put some short note about the correct way of configuration of license as well as it's default value into readme.md ?

@krzyk
Copy link
Collaborator

krzyk commented Sep 5, 2015

@darkled actually there is already info about correct configuration on www.qulice.com, let me know if you think we should add more info there

@krzyk
Copy link
Collaborator

krzyk commented Sep 5, 2015

@darkled also the same configuration is in the README.md

@asaen
Copy link
Author

asaen commented Sep 5, 2015

@krzyk it looks very confusing, I think we need to say it explicitly in one or two sentences.

@asaen
Copy link
Author

asaen commented Sep 5, 2015

@krzyk e.g. The path to license has to be declared in the following format: "file:${basedir}/LICENSE.txt", it's the default value, one can use any full path instead of ${basedir}.

krzyk pushed a commit to krzyk/qulice that referenced this issue Sep 5, 2015
@krzyk
Copy link
Collaborator

krzyk commented Sep 5, 2015

@davvd please see PR #458

@davvd
Copy link

davvd commented Sep 7, 2015

@davvd please see PR #458

@krzyk thank you, I will check it

@krzyk
Copy link
Collaborator

krzyk commented Sep 7, 2015

@darkled I've added explanation to the README, please close this issue

@asaen
Copy link
Author

asaen commented Sep 7, 2015

@krzyk thanks!

@asaen asaen closed this as completed Sep 7, 2015
@davvd
Copy link

davvd commented Sep 8, 2015

@krzyk 30 mins was added to your account, many thanks for your contribution (payment 64780896)! The task took 265 hours and 50 mins.. added +30 to your rating, now it is equal to +3944

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

No branches or pull requests

4 participants