我是Maven的新人,甚至是Clojure的新人.作为学习语言的练习,我正在写一个蜘蛛纸牌播放器程序.我还计划在Scala中编写类似的程序来比较实现(请参阅我的帖子/sf/ask/179988721/).
我已经配置了一个包含通常的src/main/clojure和src/test/clojure目录的Maven目录结构.我的pom.xml文件包含clojure-maven-plugin.当我运行"mvn test"时,它显示"没有运行测试",尽管我在src/test/clojure目录中有测试代码.当我误解了什么?这是我的pom.xml文件:
<?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>SpiderPlayer</groupId>
<artifactId>SpiderPlayer</artifactId>
<version>1.0.0-SNAPSHOT</version>
<inceptionYear>2010</inceptionYear>
<packaging>jar</packaging>
<properties>
<maven.build.timestamp.format>yyMMdd.HHmm</maven.build.timestamp.format>
<main.dir>org/dogdaze/spider_player</main.dir>
<main.package>org.dogdaze.spider_player</main.package>
<main.class>${main.package}.Main</main.class>
</properties>
<build>
<sourceDirectory>src/main/clojure</sourceDirectory>
<testSourceDirectory>src/test/clojure</testSourceDirectory>
<plugins>
<plugin>
<groupId>com.theoryinpractise</groupId>
<artifactId>clojure-maven-plugin</artifactId>
<version>1.3.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.3</version>
<executions>
<execution>
<goals>
<goal>run</goal>
</goals>
<phase>generate-sources</phase>
<configuration>
<tasks>
<echo file="${project.build.sourceDirectory}/${main.dir}/Version.clj"
message="(ns ${main.package})${line.separator}"/>
<echo file="${project.build.sourceDirectory}/${main.dir}/Version.clj" append="true"
message="(def version "${maven.build.timestamp}")${line.separator}"/>
</tasks>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.1</version>
<executions>
<execution>
<goals>
<goal>single</goal>
</goals>
<phase>package</phase>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<archive>
<manifest>
<mainClass>${main.class}</mainClass>
</manifest>
</archive> …Run Code Online (Sandbox Code Playgroud)