我正在尝试使用此配置文件在 CentOS 中运行 FitNesse:
<profile>
<id>fitnesse</id>
<build>
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<id>start-fitnesse</id>
<phase>test</phase>
<configuration>
<tasks>
<echo taskname="fitnesse" message="Starting FitNesse..." />
<java classname="fitnesseMain.FitNesseMain"
classpathref="maven.runtime.classpath" fork="true">
<arg line="-p 9595" />
<arg line="-d ." />
</java>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.fitnesse.plugins</groupId>
<artifactId>maven-classpath-plugin</artifactId>
<version>1.6</version>
<scope>runtime</scope>
</dependency>
</dependencies>
</profile>
我正在使用 maven.classpath 将依赖 jar 添加到 Fitnesse 中
${maven.classpath}
但是在这种情况下我得到了
undefined variable: maven.classpath
注意:我可以看到 FitNesse wiki 页面。
最佳答案
要使用该插件,您必须确保它对 wiki 可用(我通常使用 maven 依赖插件将其复制到 wiki 的 plugins
目录)。仅将其添加为 Maven 依赖项是不够的。
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<id>copy-plugins</id>
<phase>generate-resources</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.fitnesse.plugins</groupId>
<artifactId>maven-classpath-plugin</artifactId>
<version>${maven-classpath-plugin.version}</version>
<classifier>jar-with-dependencies</classifier>
<overWrite>true</overWrite>
</artifactItem>
</artifactItems>
<outputDirectory>${project.basedir}/wiki/plugins</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
此外,您还必须(从 README 复制):
将以下行添加到 plugins.properties:
SymbolTypes = fitnesse.wikitext.widgets.MavenClasspathSymbolType
引用pom文件如下:
!pomFile/path/to/pom.xml
您可以将文件定义为
pom.xml@compile
以包含特定范围。
关于java - Fitnesse Maven Linux 运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47290913/