-
Notifications
You must be signed in to change notification settings - Fork 111
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
Provide integration with ant or standalone jar #337
Comments
we'll find someone to do this task, soon |
@yegor256 the task is yours (budget is 30 mins) |
@yegor256 this task is not yours any more (took too long), please stop. I'll give you something else |
@alevohin it's yours now, please proceed keeping in mind our principles. Feel free to ask any technical questions right here in the ticket The budget here is 30 mins, which is exactly how much time will be paid for, when the task is completed |
there is a puzzle in this code |
@petromir this feature was released, tag is 0.12.1. |
@petromir this feature was released, tag is 0.12.1. |
@petromir have you tested it? I suggest it's better to close this issue and open a new one if you'll find bugs/remarks. |
Hi. Please provide a procedure for building quilice-ant-jar with required dependencies or change the example on http://www.qulice.com/qulice-ant/index.html to include them when defining the custom task: <taskdef name="qulice"
classname="com.qulice.ant.QuliceTask"
classpath="${com.qulice:qulice-ant:jar}; dependencies..."/> |
@petromir I think it's better to use something like http://ant.apache.org/ivy/ for dependency management. If you think example is wrong please provide another issue. |
@alevohin This is what I did using your example: <project name="Qulice" basedir="." default="qulice">
<taskdef name="qulice"
classname="com.qulice.ant.QuliceTask"
classpath="${basedir}/lib/qulice-ant-1.0-SNAPSHOT.jar"/>
<target name="qulice" description="Execute qulice checks">
<property name="license" value="LICENSE.txt"/>
<qulice srcdir="${basedir}/src/main/java" classesdir="${basedir}/out/production"
classpath="${basedir}/out/production:${basedir}"/>
</target>
</project> and the result is: BUILD FAILED
D:\DEV\Projects\qulice-ant-test\build.xml:4: taskdef A class needed by class com.qulice.ant.QuliceTask cannot be found: com/qulice/spi/ValidationException
using the classloader AntClassLoader[D:\DEV\Projects\qulice-ant-test\lib\qulice-ant-1.0-SNAPSHOT.jar] So what else should I put in |
@petromir if you don't use any dependency management with ant, the simplest way may be:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>test</groupId>
<artifactId>test</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>com.qulice</groupId>
<artifactId>qulice-ant</artifactId>
<version>0.12.1</version>
</dependency>
</dependencies>
</project>
<qulice srcdir="${basedir}/src/main/java" classesdir="${basedir}/out/production"
classpath="${basedir}/out/production:${basedir}/target/dependencies"/> |
@alevohin I had to change the build.xml to this: <project name="Qulice" basedir="." default="qulice">
<taskdef name="qulice"
classname="com.qulice.ant.QuliceTask">
<classpath>
<fileset dir="lib">
<include name="**/*.jar"/>
</fileset>
</classpath>
</taskdef>
<target name="qulice" description="Execute qulice checks">
<property name="license" value="LICENSE.txt"/>
<qulice srcdir="${basedir}/src/main/java" classesdir="${basedir}/out/production"
classpath="${basedir}/lib/dependencies;${basedir}/out/production">
</qulice>
</target>
</project> but now I'm getting the following exception, which I believe comes from wrong D:\DEV\Projects\qulice-ant-test\build.xml:13: java.lang.IllegalStateException: Failed to configure checker
at com.qulice.checkstyle.CheckstyleValidator.validate(CheckstyleValidator.java:88)
at com.qulice.ant.QuliceTask.validate(QuliceTask.java:146)
at com.qulice.ant.QuliceTask.execute(QuliceTask.java:102)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:435)
at org.apache.tools.ant.Target.performTasks(Target.java:456)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393)
at org.apache.tools.ant.Project.executeTarget(Project.java:1364)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1248)
at org.apache.tools.ant.Main.runBuild(Main.java:851)
at org.apache.tools.ant.Main.startAnt(Main.java:235)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
Caused by: com.puppycrawl.tools.checkstyle.api.CheckstyleException: cannot initialize module JavadocPackage - Unable to instantiate JavadocPackage
at com.puppycrawl.tools.checkstyle.Checker.setupChild(Checker.java:179)
at com.puppycrawl.tools.checkstyle.api.AutomaticBean.configure(AutomaticBean.java:184)
at com.qulice.checkstyle.CheckstyleValidator.validate(CheckstyleValidator.java:86)
... 19 more
Caused by: com.puppycrawl.tools.checkstyle.api.CheckstyleException: Unable to instantiate JavadocPackage
at com.puppycrawl.tools.checkstyle.PackageObjectFactory.createModule(PackageObjectFactory.java:155)
at com.puppycrawl.tools.checkstyle.Checker.setupChild(Checker.java:154)
... 21 more
Caused by: com.puppycrawl.tools.checkstyle.api.CheckstyleException: Unable to instantiate JavadocPackageCheck
at com.puppycrawl.tools.checkstyle.PackageObjectFactory.doMakeObject(PackageObjectFactory.java:98)
at com.puppycrawl.tools.checkstyle.PackageObjectFactory.createModule(PackageObjectFactory.java:152)
... 22 more Unfortunately I couldn't find a workaround as I did for P.S. I can send you the test project if you like. |
@petromir temporary solution:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>test</groupId>
<artifactId>test</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>com.qulice</groupId>
<artifactId>qulice-ant</artifactId>
<version>0.12.1</version>
</dependency>
</dependencies>
</project>
<project name="Qulice" basedir="." default="qulice">
<taskdef name="qulice"
classname="com.qulice.ant.QuliceTask">
</taskdef>
<target name="qulice" description="Execute qulice checks">
<property name="license" value="LICENSE.txt"/>
<qulice srcdir="${basedir}/src/main/java" classesdir="${basedir}/out/production"
classpath="${basedir}/lib/dependencies;${basedir}/out/production">
</qulice>
</target>
</project>
|
This did the job, but it's a temporary solution! I have few remarks about the entire solution:
In my opinion the process should be as follows:
Looking forward for the final solution. |
@petromir My suggestion - create new issue and close this one (read http://www.yegor256.com/2009/03/04/pdd.html) because temporary solution works, Yes, it's temporary and it's normal. We can improve it for a long time, but it must be new tasks according to PDD principles. |
@alevohin based on the article I don't see any 'numerous unknowns' that stops you to finish the issue in a way that will be more convenient for usage. @yegor256 & @davvd please advise! Anyway if you all agree that the solution covers your quality requirements, I'm ready to close the issue when the documentation reflects the workaround. |
@alevohin take a look at this article: http://www.yegor256.com/2015/02/12/top-down-design.html What do you think? |
@yegor256 I think you mean top-leveled issues like this is better to resolve in way like #339 - implement at first external API and proper packaging. My suggestion for current situation is to use @petromir advice:
@yegor256 what do you think? |
@alevohin I have nothing against this plan |
Any news and/or progress? |
@davvd this is postponed |
It would be great if Qulice can be integrated with ant or run as a standalone jar.
The text was updated successfully, but these errors were encountered: