• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

pallet/zi: Maven plugin for clojure

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

pallet/zi

开源软件地址(OpenSource Url):

https://github.com/pallet/zi

开源编程语言(OpenSource Language):

Clojure 90.1%

开源软件介绍(OpenSource Introduction):

Zi

Zi is a maven plugin for clojure. It does something similar to clojure-maven-plugin, but does so differently.

It uses the maven pom sourceDirectory and testSourceDirectory settings to locate source, which by default means that it uses src/main/clojure and src/test/clojure. The goals should work with a pom.xml generated by leiningen.

From an implementation perspecitve, most of the goals are written in clojure.

Zi requires maven 3.0.4.

Available goals

  • zi:resources
  • zi:testResources
  • zi:compile
  • zi:ritz
  • zi:ritz-nrepl
  • zi:swank-clojure
  • zi:test
  • zi:codox
  • zi:marginalia
  • zi:ring-genfiles

Install

Globally installing the plugin allows you to run the goals without modifying a project's pom file.

To globally enable the zi plugin, you need to add pluginGroup and pluginRepository configuration to your ~/.m2/settings.xml file.

    <pluginGroups>
      <pluginGroup>org.cloudhoist.plugin</pluginGroup>
    </pluginGroups>
    <profiles>
      <profile>
        <id>clojure-dev</id>
        <pluginRepositories>
          <pluginRepository>
            <id>sonatype-snapshots</id>
            <url>http://oss.sonatype.org/content/repositories/releases</url>
          </pluginRepository>
        </pluginRepositories>
      </profile>
    </profiles>

    <activeProfiles>
      <activeProfile>clojure-dev</activeProfile>
    </activeProfiles>

To enable zi in a project pom, without globally enabling the plugin, you will need to add a pluginRepositories entry to your pom:

    <pluginRepositories>
      <pluginRepository>
        <id>sonatype-snapshots</id>
        <url>http://oss.sonatype.org/content/repositories/releases</url>
      </pluginRepository>
    </pluginRepositories>

Configuration

It uses the maven pom sourceDirectory and testSourceDirectory settings to locate source, which by default means that it uses src/main/clojure and src/test/clojure.

Goals

resources

The resources goal copies clojure source to the target. This is probably what you need to make sure that your clj source files end up in your jar file.

    <build>
      <plugins>
        <plugin>
          <groupId>org.cloudhoist.plugin</groupId>
          <artifactId>zi</artifactId>
          <version>0.5.5</version>
          <executions>
            <execution>
              <id>default-resources</id>
              <phase>process-resources</phase>
              <goals>
                <goal>resources</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
      </plugins>
    </build>

testResources

The testResources goal copies clojure test source to the target. This is probably what you need to make sure that your clj source files end up in your test-jar file.

    <build>
      <plugins>
        <plugin>
          <groupId>org.cloudhoist.plugin</groupId>
          <artifactId>zi</artifactId>
          <version>0.5.5</version>
          <executions>
            <execution>
              <id>default-test-resources</id>
              <phase>process-test-resources</phase>
              <goals>
                <goal>test-resources</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
      </plugins>
    </build>

compile

The compile goal AOT compiles clojure source.

    <build>
      <plugins>
        <plugin>
          <groupId>org.cloudhoist.plugin</groupId>
          <artifactId>zi</artifactId>
          <version>0.5.5</version>
          <executions>
            <execution>
              <id>default-compile</id>
              <goals>
                <goal>compile</goal>
              </goals>
            </execution>
          </executions>
          <configuration>
            <excludes>
              <exclude>**/test.clj</exclude>
            </excludes>
          </configuration>
        </plugin>
      </plugins>
    </build>
Property Variable Default Description
includes **/*.clj A set of source patterns to include
excludes A set of source patterns to exclude

ritz

The ritz goal starts a ritz server.

Property Variable Default Description
port clojure.swank.port 4005 The swank server port
encoding clojure.swank.encoding iso-8859-1 The swank encoding to use

The ritz, ritz-nrepl and swank-clojure goals all recognise sub-projects linked in a checkouts directory, and adds their sources and resources to the the classpath.

The ritz and ritz-nrepl goals also adds source jars to the classpath if they are available in the local repository. You can resolve the source jars using mvn dependency:sources.

ritz-nrepl

The ritz-nrepl goal starts a ritz nREPL server.

Property Variable Default Description
port clojure.nrepl.port 4005 The nrepl server port

swank-clojure

The swank-clojure goal starts a swank-clojure server.

Property Variable Default Description
port clojure.swank.port 4005 The swank server port
encoding clojure.swank.encoding iso-8859-1 The swank encoding to use

test

The test goal runs clojure.test tests.

Property Variable Default Description
initScript clojure.initScript A clojure source string that is run before the tests

codox

The codox goal creates codox generated API documentation in the doc directory.

Property Variable Default Description
codoxTargetDirectory ${project.build.directory}/doc The directory where codox should write its output

marginalia

The marginalia goal creates a marginalia annotated source page.

Property Variable Default Description
marginaliaTargetDirectory ${project.build.directory} The directory where marginalia should write uberdoc.html

ring-genfiles

The ring-genfiles goal creates files required for a war packaging. See lein-ring plugin.

Property Default Description
ringServletClass The name of the servlet class
ringServletName The name of the servlet
ringListenerClass The name of the ServletContextListener class
ringHandler The name of the ring handler
ringInit The name of an initialisation hook function
ringDestroy The name of a shutdown hook function
ringUrlPattern The url pattern of the servlet mapping (in web.xml). Defaults to "/*".

Zi, the builder

Zi was a builder in northern mythology.

License

Licensed under EPL

Copyright 2011 Hugo Duncan.




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap