Skip to content

Commit e180ab1

Browse files
committed
Add the README's example as a separate project
This provides a minimal test executable for quickly trying out JAnsi. Run it like $ mvn --projects example exec:java
1 parent 25ed28f commit e180ab1

File tree

3 files changed

+56
-0
lines changed

3 files changed

+56
-0
lines changed

example/pom.xml

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<parent>
6+
<artifactId>jansi-project</artifactId>
7+
<groupId>org.fusesource.jansi</groupId>
8+
<version>1.13-SNAPSHOT</version>
9+
</parent>
10+
<modelVersion>4.0.0</modelVersion>
11+
12+
<artifactId>example</artifactId>
13+
14+
<dependencies>
15+
<dependency>
16+
<groupId>org.fusesource.jansi</groupId>
17+
<artifactId>jansi</artifactId>
18+
<version>${project.parent.version}</version>
19+
</dependency>
20+
</dependencies>
21+
22+
<build>
23+
<plugins>
24+
<plugin>
25+
<groupId>org.apache.maven.plugins</groupId>
26+
<artifactId>maven-compiler-plugin</artifactId>
27+
<configuration>
28+
<source>1.5</source>
29+
<target>1.5</target>
30+
</configuration>
31+
</plugin>
32+
<plugin>
33+
<groupId>org.codehaus.mojo</groupId>
34+
<artifactId>exec-maven-plugin</artifactId>
35+
<version>1.4.0</version>
36+
<configuration>
37+
<mainClass>org.fusesource.jansi.Main</mainClass>
38+
</configuration>
39+
</plugin>
40+
</plugins>
41+
</build>
42+
43+
</project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package org.fusesource.jansi;
2+
3+
import static org.fusesource.jansi.Ansi.*;
4+
import static org.fusesource.jansi.Ansi.Color.*;
5+
6+
public class Main {
7+
public static void main(String[] args) {
8+
AnsiConsole.systemInstall();
9+
System.out.println( ansi().eraseScreen().fg(RED).a("Hello").fg(GREEN).a(" World").reset() );
10+
AnsiConsole.systemUninstall();
11+
}
12+
}

pom.xml

+1
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,7 @@
316316

317317
<modules>
318318
<module>jansi</module>
319+
<module>example</module>
319320
<!--
320321
<module>jansi-website</module>
321322
-->

0 commit comments

Comments
 (0)