Coder Social home page Coder Social logo

clojure-maven-plugin's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

clojure-maven-plugin's Issues

Failed to execute goal com.theoryinpractise:clojure-maven-plugin

when compile my project and always get this error, any idea ?

[ERROR] Failed to execute goal com.theoryinpractise:clojure-maven-plugin:1.3.20:compile (compile-clojure) on project storm-core: Clojure failed. -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.theoryinpractise:clojure-maven-plugin:1.3.20:compile (compile-clojure) on project storm-core: Clojure failed.
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
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:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.plugin.MojoExecutionException: Clojure failed.
at com.theoryinpractise.clojure.AbstractClojureCompilerMojo.callClojureWith(AbstractClojureCompilerMojo.java:463)
at com.theoryinpractise.clojure.AbstractClojureCompilerMojo.callClojureWith(AbstractClojureCompilerMojo.java:379)
at com.theoryinpractise.clojure.AbstractClojureCompilerMojo.callClojureWith(AbstractClojureCompilerMojo.java:356)
at com.theoryinpractise.clojure.ClojureCompilerMojo.execute(ClojureCompilerMojo.java:40)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
... 19 more
[ERROR]
[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/MojoExecutionException
[ERROR]

File interdependency problem

Tested with Maven 2.2.1. (clojure-maven-plugin 1.3.5 and also 1.3.2 just in case).

File some.clj

(ns example.some
(:use example.someother)
)

(defn helloworld )

File someother.clj:

(ns example.someother
(:use example.some)
)

(defn sample )

A compile error "Unable to resolve helloworld in this context" is produced. However, if the two defn's are switched places, the build completes successfully.

Leiningen works, there is no error happening there. But I am not sure how robust Leiningen is vs. clojure-maven-plugin and Maven in general in other scenarios.

add plugin dependencies to classpath during compilation

I have a dependency that is in runtime scope, because it's not required by Java code, but is required by clojure code. If I put it compile scope maven-dependency-plugin:analyze complains.

Would be convenient to have an ability to add this artifact as a dependency for the clojure plugin only. The plugin should support such configuration and should add all its dependencies to classpath.

All dependencies get packaged into jar

All the classes from dependencies end up in the packaged jar. This is different than the default of maven, and not what you want when you intend to publish the project to a maven repository and consume it in another project.

Minimal pom.xml that reproduces the error:

<?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>com.fivetran</groupId>
    <artifactId>clojure-sandbox</artifactId>
    <version>1.0-SNAPSHOT</version>

    <packaging>clojure</packaging>

    <dependencies>
        <!-- Clojure language runtime -->
        <dependency>
            <groupId>org.clojure</groupId>
            <artifactId>clojure</artifactId>
            <version>1.6.0</version>
        </dependency>

        <!-- Fancy clojure JSON / Jackson wrapper -->
        <dependency>
            <groupId>cheshire</groupId>
            <artifactId>cheshire</artifactId>
            <version>5.3.1</version>
        </dependency>
    </dependencies>

    <build>
        <sourceDirectory>src</sourceDirectory>

        <testSourceDirectory>test</testSourceDirectory>

        <plugins>
            <!-- Teach maven about clojure -->
            <plugin>
                <groupId>com.theoryinpractise</groupId>
                <artifactId>clojure-maven-plugin</artifactId>
                <version>1.3.20</version>
                <extensions>true</extensions>

                <configuration>
                    <sourceDirectories>
                        <sourceDirectory>src</sourceDirectory>
                    </sourceDirectories>

                    <testSourceDirectories>
                        <testSourceDirectory>test</testSourceDirectory>
                    </testSourceDirectories>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>

Get error about "clojure" packaging when running the REPL

When I try to run "mvn clojure:repl" on my project, I get the following error message:

[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building singularity
[INFO] task-segment: [clojure:repl]
[INFO] ------------------------------------------------------------------------
[INFO] Preparing clojure:repl
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Cannot find lifecycle mapping for packaging: 'clojure'.
Component descriptor cannot be found in the component repository: org.apache.maven.lifecycle.mapping.LifecycleMappingclojure.
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: < 1 second
[INFO] Finished at: Fri Nov 19 16:40:54 MST 2010
[INFO] Final Memory: 8M/81M
[INFO] ------------------------------------------------------------------------

The "clojure:compile" task works, though.

pls mention repo for Maven

Hi, many thanks for the work!

At the place in your README where you give the maven sniplet, please add a sniplet that tells the repo. Thank you!, z.

clojars http://clojars.org/repo/

skip test execution when no testSourceDirectories

Currently, a several of our maven artifacts have clojure source, but a few dozen don't. complete build time takes a lot more time due to spawning our big clojure vms. Can you add a feature to skip the plugin when the source and or test dirs are empty?

(clojure.java.classpath/classpath) produces wrong results with plugin 1.3.20

I have code that needs to look over the class path. It gets it using:

(clojure.java.classpath/classpath)

Using clojure-maven-plugin 1.3.9 all is well that call gets me quite a large seq of files. With clojure-maven-plugin 1.3.20 I see something like the following and only the following:

(#<File /var/folders/bk/w587c61d02s2hkn5zqs4zlnm0000gs/T/clojuremavenplugin2851089989068089718jar>)

If you force that thing to be a JarFile and then look at what's in it there is one manifest file and that's it.

Kevin

clojure:swank doesn't run the replScript before starting its repl

Hi, I have a request:

If I've got runscript.clj in my pom.xml, then runscript.clj gets run
for mvn clojure:repl, but not for mvn clojure:swank

I think that either it should get run, or (possibly preferably) there should be a corresponding swankScript element that does get run before the swank repl starts.

I've no idea how to do this, but I can probably find out.

If the feature's easy for someone else it would be ever so nice to have.

If not, is it a patch that would be appreciated? If so I'll have a go. Any hints? I don't know much about either maven or swank/slime. I do speak clojure and java and emacs.

Cheers, John.

Option to include plugin dependencies on classpath for run goal

Firstly, excellent plugin. It's incredibly useful and well written!

Unfortunately I think I've found a limitation in the way the classpath is constructed when using the run goal (although I think it applies more broadly, this is the one use case I've found so far). The plugin doesn't seem to include any plugin dependencies on the classpath, and there doesn't appear to be any configuration option to change this default behaviour.

Looking at the source, it seems to only include all compile-scoped dependencies. This limits the plugin to only being used on Clojure projects.

My use case was to execute a Clojure script as part of a Maven build, but the project itself was written in pure Java. This meant I was unable to use the plugin because I wasn't happy including Clojure as a compile-scoped project dependency.

Any chance we could have the option to include plugin dependencies (and possibly even an option to exclude project dependencies) when executing the run goal? Something along the lines of what the exec-maven-plugin:java goal provides?

Thanks

Namespace discovery is too fragile

If you have a namespace declaration that doesn't have a space after the '(ns'. such as this:

(ns
  ^#{author: "blah"}
  clojure.set)

which is more common if the ns has associated metadata, then the namespace isn't discovered. Simple fix to the regex.

ClojureScript tests?

Hi,

I have a Clojure + ClojureScript project using cljc that I'd like to test using Maven. Both the Clojure and ClojureScript versions need to be tested at the same time.

Is that possible using clojure-maven-plugin?

Broken under windows

Hi, neither clojure:repl nor clojure:swank work under windows.

I made a blogpost about how maven and this plugin make it easy to start a swank server

http://learnclojure.blogspot.com/2010/03/clojure-maven-emacs-eternal-golden.html

It basically says, use the pom.xml below, and type mvn clojure:swank.

This breaks under windows.

mvn clojure:repl sort of works, but the repl is unusable (doesn't seem to echo until you press return).

There is a fix for (at least the swank bit) in issue five here:

http://github.com/talios/clojure-maven-plugin/issues/#issue/5

This makes it work under windows, but breaks it under ubuntu. Something nasty is going on with string escaping differently on the two platforms.

I've no idea what the real fix is, but Windows folks might want to use frericksm's code in the other issue for now?

Here's the demonstration pom:
mvn clojure:swank and mvn clojure:repl work fine under ubuntu, and break under Windows with this pom.

  <modelVersion>4.0.0</modelVersion>
  <groupId>com.example</groupId>
  <artifactId>hello-maven-clojure-swank</artifactId>
  <version>1.0-SNAPSHOT</version>
  <name>hello-maven</name>
  <description>maven, clojure, emacs: together at last</description>

  <repositories>
    <repository>
      <id>clojars</id>
      <url>http://clojars.org/repo/</url>
    </repository>
    <repository>
      <id>clojure</id>
      <url>http://build.clojure.org/releases</url>
    </repository>
    <repository>
      <id>central</id>
      <url>http://repo1.maven.org/maven2</url>
    </repository>
  </repositories>

  <dependencies>
    <dependency>
      <groupId>org.clojure</groupId>
      <artifactId>clojure</artifactId>
      <version>1.1.0</version>
    </dependency>
    <dependency>
      <groupId>org.clojure</groupId>
      <artifactId>clojure-contrib</artifactId>
      <version>1.1.0</version>
    </dependency>
    <dependency>
      <groupId>jline</groupId>
      <artifactId>jline</artifactId>
      <version>0.9.94</version>
    </dependency>
    <dependency>
      <groupId>swank-clojure</groupId>
      <artifactId>swank-clojure</artifactId>
      <version>1.2.0-break-SNAPSHOT</version>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>com.theoryinpractise</groupId>
        <artifactId>clojure-maven-plugin</artifactId>
        <version>1.3.2</version>
      </plugin>
    </plugins>
  </build>

</project>

Control characters in source files

Control characters (e.g. a copyright symbol) in the header of .clj files causes them to be skipped by the clojure:compile plugin. For example:

; Copyright � 2010 Foo

(ns foo...

mvn test hangs if threads were created

My test code contains several pmap calls hence new threads get created during the test execution.

It seems that this causes clojure:test to hang after the tests have been executed. Maven simply blocks for approx. 1 minute until the build continues. The output is like this (see my comment inline):

[INFO] ------------------------------------------------------------------------
[INFO] Building Ogee Library
[INFO] task-segment: [test]
[INFO] ------------------------------------------------------------------------
[INFO] [resources:resources {execution: default-resources}]
.......snip........
[INFO] [clojure:test {execution: test}]

Testing ogee.test-cop

Ran 9 tests containing 21 assertions.
0 failures, 0 errors.

<<<BLOCKS HERE FOR 60 SECS>>>

[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1 minute 5 seconds
[INFO] Finished at: Thu Jan 28 11:00:22 CET 2010
[INFO] Final Memory: 12M/77M
[INFO] ------------------------------------------------------------------------

You can find the test code here: http://github.com/romanroe/ogee/blob/master/library/src/test/clojure/ogee/test_cop.clj

Support m2e 1.1

https://jira.codehaus.org/browse/MOJO-1785

When using m-clojure-p in Eclipse with m2e you get a "Plugin execution not covered..." message from m2e. This is because it doesn't know whether to run these goals during incremental compilation or not. To enable this m2e needs a little help. I submitted a little patch to the m-less-p which you can see at the link above. They had to do some extra work but the patch has now been integrated.

Please would you consider doing this for m-clojure-p? I hope m-less-p will serve as a useful reference.

Maven 3 warns on missing plugin version for maven-compiler-plugin

When running any mvn goal in the clojure-maven-plugin project, maven 3 displays the following warning.

[WARNING] Some problems were encountered while building the effective model for com.theoryinpractise:clojure-maven-plugin:maven-plugin:1.3.7-SNAPSHOT
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. @ line 98, column 21
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.

Plugin Not Running When Java Test Fails

I have a Java, Scala, Clojure project and am using this plugin in that project. When running mvn test, if a Java or Scala test should fail, the Clojure tests never get ran.

Is this the intended behavior? I would think that the Clojure tests should be ran at the same time as the Java and Scala ones so ALL test failures can be reported at once. Whereas now, I have to fix the Java and Scala ones before seeing if I have failures in the Clojure code (or explicitly run `mvn clojure:test-with-junit).

sourceDirectories and Absolute Paths

The clojure-maven-plugin behaves differently from other plugins that allow adding source paths, even including clojure-maven-plugin's own ClojureAddSourceMojo.

In the translatePaths method of the AbstractClojureCompilerMojo class, you manually prepend baseDirectory onto the values captured in sourceDirectories, whereas the proper way seems to be calling .getAbsolutePath on File objects like ClojureAddSourceMojo does. Here are the two code examples:

https://github.com/talios/clojure-maven-plugin/blob/develop/src/main/java/com/theoryinpractise/clojure/AbstractClojureCompilerMojo.java#L231

https://github.com/talios/clojure-maven-plugin/blob/develop/src/main/java/com/theoryinpractise/clojure/ClojureAddSourceMojo.java#L15

For example, I am putting some generated Clojure code into <project>/target/src/main/clojure of my project, but if I try to configure clojure-maven-plugin's sourceDirectories -> sourceDirectory with ${project.build.directory}/src/main/clojure}, clojure-maven-plugin doesn't find my source files, whereas the equivalent configuration works fine for both the maven-build-helper-plugin and the jruby-maven-plugin, both of which take the .getAbsolutePath approach.

surefire java junit tests can't load resources from classpath

Trying to integrate some clojure namespaces into an existing java project.

There are existing java unit tests in src/test/java and test resources in src/test/resources. For example, src/test/resources/META-INF/persistence.xml is loaded from the test classpath by some tests (via hibernate).

Unfortunately though, the resources from src/test/resources are not moved to target/test-classes when the clojure-maven-plugin is in the pom. Moving the test resources to src/test/clojure/ did not help. Specifing things like testResourcePath in or also did not help.

This command reproduces the problem:

mvn clean test

This is the directory layout:
src/main/java
src/test/java
src/test/resources

It succeeds when there is no clojure-maven-plugin in the pom, and fails when it's there. Sorry for the relative brevity of this bug report, I hope to upload a demo project soon if I find the time.

testScript does not work in multi-module builds

I have a multi-module build where some modules are using the clojure-maven-plugin. When I run maven from the module's directory, everything works fine. E.g.

[INFO] [clojure:test {execution: default}]

Testing tests

Ran 1 tests containing 2 assertions.
0 failures, 0 errors.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------

When I run the build from the project's root directory, I get this error message:

[INFO] [clojure:test {execution: default}]
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] testScript is empty or does not exist!
[INFO] ------------------------------------------------------------------------

It seems that clojure-maven-plugin uses the CWD instead of the module's directory.

Could not locate leiningen/core/eval__init.class or leiningen/core/eval.clj on classpath

I installed kibit as suggested (using lein) and tried to run it:

$ lein kibit
Exception in thread "main" java.lang.reflect.InvocationTargetException
    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:601)
    at jline.ConsoleRunner.main(ConsoleRunner.java:69)
Caused by: java.io.FileNotFoundException: Could not locate leiningen/core/eval__init.class or leiningen/core/eval.clj on classpath:  (kibit.clj:1)
    at clojure.lang.Compiler.eval(Compiler.java:5440)
    at clojure.lang.Compiler.eval(Compiler.java:5415)
    at clojure.lang.Compiler.load(Compiler.java:5857)
    at clojure.lang.RT.loadResourceScript(RT.java:340)
    at clojure.lang.RT.loadResourceScript(RT.java:331)
    at clojure.lang.RT.load(RT.java:409)
    at clojure.lang.RT.load(RT.java:381)
    at clojure.core$load$fn__4519.invoke(core.clj:4915)
    at clojure.core$load.doInvoke(core.clj:4914)
    at clojure.lang.RestFn.invoke(RestFn.java:408)
    at clojure.core$load_one.invoke(core.clj:4729)
    at clojure.core$load_lib.doInvoke(core.clj:4766)
    at clojure.lang.RestFn.applyTo(RestFn.java:142)
    at clojure.core$apply.invoke(core.clj:542)
    at clojure.core$load_libs.doInvoke(core.clj:4800)
    at clojure.lang.RestFn.applyTo(RestFn.java:137)
    at clojure.core$apply.invoke(core.clj:542)
    at clojure.core$require.doInvoke(core.clj:4881)
    at clojure.lang.RestFn.invoke(RestFn.java:408)
    at leiningen.core$resolve_task.invoke(core.clj:208)
    at leiningen.core$apply_task.invoke(core.clj:258)
    at leiningen.core$_main.doInvoke(core.clj:329)
    at clojure.lang.RestFn.invoke(RestFn.java:410)
    at clojure.lang.AFn.applyToHelper(AFn.java:161)
    at clojure.lang.RestFn.applyTo(RestFn.java:132)
    at clojure.core$apply.invoke(core.clj:542)
    at leiningen.core$_main.invoke(core.clj:332)
    at user$eval42.invoke(NO_SOURCE_FILE:1)
    at clojure.lang.Compiler.eval(Compiler.java:5424)
    at clojure.lang.Compiler.eval(Compiler.java:5391)
    at clojure.core$eval.invoke(core.clj:2382)
    at clojure.main$eval_opt.invoke(main.clj:235)
    at clojure.main$initialize.invoke(main.clj:254)
    at clojure.main$script_opt.invoke(main.clj:270)
    at clojure.main$main.doInvoke(main.clj:354)
    at clojure.lang.RestFn.invoke(RestFn.java:457)
    at clojure.lang.Var.invoke(Var.java:377)
    at clojure.lang.AFn.applyToHelper(AFn.java:172)
    at clojure.lang.Var.applyTo(Var.java:482)
    at clojure.main.main(main.java:37)
    ... 5 more
Caused by: java.io.FileNotFoundException: Could not locate leiningen/core/eval__init.class or leiningen/core/eval.clj on classpath: 
    at clojure.lang.RT.load(RT.java:412)
    at clojure.lang.RT.load(RT.java:381)
    at clojure.core$load$fn__4519.invoke(core.clj:4915)
    at clojure.core$load.doInvoke(core.clj:4914)
    at clojure.lang.RestFn.invoke(RestFn.java:408)
    at clojure.core$load_one.invoke(core.clj:4729)
    at clojure.core$load_lib.doInvoke(core.clj:4766)
    at clojure.lang.RestFn.applyTo(RestFn.java:142)
    at clojure.core$apply.invoke(core.clj:542)
    at clojure.core$load_libs.doInvoke(core.clj:4800)
    at clojure.lang.RestFn.applyTo(RestFn.java:137)
    at clojure.core$apply.invoke(core.clj:542)
    at clojure.core$require.doInvoke(core.clj:4881)
    at clojure.lang.RestFn.invoke(RestFn.java:408)
    at leiningen.kibit$eval46$loading__4414__auto____47.invoke(kibit.clj:1)
    at leiningen.kibit$eval46.invoke(kibit.clj:1)
    at clojure.lang.Compiler.eval(Compiler.java:5424)
    ... 44 more

Default test script fails under Clojure 1.3

Using c-m-p 1.3.8 with Clojure 1.3-beta1 and the default test script fails with the error:

Exception in thread "main" java.lang.IllegalStateException: Can't dynamically bind non-dynamic var: clojure.test.junit/junit-report
        at clojure.lang.Var.pushThreadBindings(Var.java:339)
        at clojure.core$push_thread_bindings.invoke(core.clj:1716)
        at com.theoryinpractise.clojure.testrunner$eval10503.invoke(run-test7765525700945248109.clj:46)
        at clojure.lang.Compiler.eval(Compiler.java:6406)
        at clojure.lang.Compiler.load(Compiler.java:6843)
        at clojure.lang.Compiler.loadFile(Compiler.java:6804)
        at clojure.main$load_script.invoke(main.clj:282)
        at clojure.main$script_opt.invoke(main.clj:342)
        at clojure.main$main.doInvoke(main.clj:426)
        at clojure.lang.RestFn.invoke(RestFn.java:408)
        at clojure.lang.Var.invoke(Var.java:401)  
        at clojure.lang.AFn.applyToHelper(AFn.java:161)
        at clojure.lang.Var.applyTo(Var.java:518) 
        at clojure.main.main(main.java:37)

Running <script> tag on every goal task.

Hello. I have following maven configuration (full version of pom.xml is here):

<!-- <packaging>clojure</packaging> -->
<packaging>jar</packaging>
...
<plugin>
  <groupId>com.theoryinpractise</groupId>
  <artifactId>clojure-maven-plugin</artifactId>
  <version>1.3.10</version>
  <!-- <extensions>true</extensions> -->
  <configuration>
    <script>src/main/clojure/proxy/main.clj</script>
  </configuration>
  <executions>
    <execution>
      <id>compile</id>
      <phase>compile</phase>
      <goals>
        <goal>compile</goal>
      </goals>
    </execution>
    <execution>
      <id>test</id>
      <phase>test</phase>
      <goals>
        <goal>test</goal>
      </goals>
    </execution>
  </executions>
</plugin>
...

I try to remove block and use clojure packaging together with block. The problem is the same. When I call commands below main.clj always run and wait for user stop him.

Commands I try:

  • mvn package
  • mvn clojure:repl
  • mvn test

And on mvn clojure:run its run as necessary.

Compilation steps should recurse into source directories?

Since Clojure supports nested namespaces like Java, does it make sense to recurse into source directories and compile the .clj files in nested subdirectories instead of just the root level? It seems like the maven convention is to point the compiler at a root source folder and assume everything "under there" is code that can be compiled.

As it stands, one must override the configuration to specify each subdirectory that contains Clojure source. This isn't a huge deal given that there usually wouldn't be as much nesting as in a typical Java project due to the more coarse-grained modularity of Clojure source files. However, if the goal is to behave more like other maven plugins, I believe this proposal would move the plugin closer to the principle of least surprise.

Use AOT compiled clojure code in Java

Currently, even with packaging specified as Clojure, the maven compiler plugin is run before clojure compiler plugin, making classes generated from clojure using :gen-class unavailable for linking.

Would it be possible to generate the clojure class files first and add them to the maven java compiler classpath when it is running?

typo in the readme + question about skip test

Not really an issue ... in the readme the tag for namespaces is not closed/ended properly as namespace is missing the s at the end. It only causes a problem for lazy people. like me, that cut and paste.

Since I am here, is there a way in the configuration to skip the tests ... i tried true in the configuration section of the plugin without any success

Thanks

Thanks

gendoc doesn't work with clojure 1.3

I thought it was time to give gendoc a whirl again.

I discovered the dependency on contrib.

I tried adding contrib-1.2.0 into the plugins dependencies - no dice - it ignored it.

I tried adding it to the build dependencies - it found it, but it didn't play nicely with my newer version of Clojure :

Caused by: java.lang.NoSuchMethodError: clojure.lang.Numbers.lt(II)Z

Is there a way to run gendoc on a 1.3 build without too much hassle ? If not, is there an ETA for its provision ?

thanks for the plugin, I use it all the time,

Jules

Compile errors don't indicate where the error is in INFO level

When the clojure compile step fails, all I see is:

ERROR] Failed to execute goal com.theoryinpractise:clojure-maven-plugin:1.3.19:compile (compile) on project MyProj: Clojure failed. -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.theoryinpractise:clojure-maven-plugin:1.3.19:compile (compile) on project MyProj: Clojure failed.
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)
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:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:318)
......

If I switch to DEBUG level in Maven, I DO see the error. Can we bump up this error to a higher log level? DEBUG puts far too much crap in the logs and we should see the compilation error.

org.apache.maven:maven-toolchain:3.0-TYCHO-733848 not found

I'm having some trouble resolving the version of maven-toolchain the plugin is trying to pull in. maven is throwing warnings (and occasionally errors) when trying to resolve it.

Is this found in a different repository, or (better) would it be possible to bump it to one of the versions found on central? The build succeeds against 3.0-alpha-2.

ClojureSwankMojo.java generates a clojure expression which is wrongly escaped as java string

Situation:

  1. Using the task clojure:swank i always get an NumberFormatException while clojure is parsing the protocolVersion "2009-09-14".
  2. It seems the that the <"> around the string are vanishing
  3. Looking deeper you find: ClojureSwankMojo generates a clojure expression that is later on consumed by clojure.main as command line argument. Part of this is:
    StringBuilder sb = new StringBuilder();
    sb.append("(do ");
    sb.append("(swank.swank/ignore-protocol-version \"");
    sb.append(protocolVersion);
    sb.append("\") ");
    sb.append("(swank.swank/start-server \"");
    sb.append(swankTempFile.getAbsolutePath());
    sb.append("\" :port ");
    sb.append(Integer.toString(port));
    sb.append(" :dont-close true");
    sb.append("))");

But i should look like this:

    StringBuilder sb = new StringBuilder();
    sb.append("(do ");
    sb.append("(swank.swank/ignore-protocol-version \\\"");
    sb.append(protocolVersion);
    sb.append("\\\") ");
    sb.append("(swank.swank/start-server \\\"");
    sb.append(swankTempFile.getAbsolutePath().replace("\\", "/"));
    sb.append("\\\" :port ");
    sb.append(Integer.toString(port));
    sb.append(" :dont-close true");
    sb.append("))");
  1. The new line

    sb.append(swankTempFile.getAbsolutePath().replace("\\", "/"));
    

is necessary on windows system, where the temp-File looks like "c:\DOKUME1\J108391.V10\LOKALE~1\Temp\slime.364" with for instance \D gets wrongly interpreted.

mvn clojure:swank opens a public port rather than loopback

Using mvn clojure:swank appears to open a publicly accessible port:

$mvn clojure:swank
$lsof -i -P
java 15067 john 14r IPv6 7203722 0t0 TCP *:4005 (LISTEN)

This strikes me as an unsafe default.

This command seems to open a local loopback port, which strikes me as more reasonable.
(swank.swank/start-server "/tmp/yo" :host "localhost" :port 4005)

Otherwise you're giving everyone on your network a (very convenient) interface to execute arbitrary code.

Test script template could be modified to make the plugin compatible with alternative testing frameworks

At the moment the plugin fails a build when any tests generate a result of :error or :fail. Since it is possible to modify clojure.test's reporting, alternative test frameworks may use other keys than :error or :fail to indicate a failing test. Midje does this for example. The result is that a mvn clojure:test run will write a correct report of failing tests but doesn't fail the build.

To allow use of alternative test frameworks, that can plug into clojure.test's reporting, a build should be failed when any test does not :pass instead of failing it, when it has an :error or :fail(s).

Maven seems to compile with wrong version of Clojure

I have a project that uses Korma, which has a function "update" which now clashes with clojure.core/update, introduced in 1.7. This clash results in a compilation error in AOT projects.

There was a fix in Clojure to address this issue which recently was patched into master:
http://dev.clojure.org/jira/browse/CLJ-1604

My issue is that I have a project A which depends on a project B. Project A is compiled against the latest clojure with the fix. Project B is compiled against an earlier clojure without the fix. When I try to compile A, I get the compilation error, even if I depend on the new version of Clojure directly in A. If I remove my dependency on B, the compilation error goes away.

I've put an example project on Github:
https://github.com/deaddowney/UpdateProblem

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.