GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add example project for GitHub Maven plugins · git171/github-maven-example@70d62b7

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • example
    • .classpath
    • .project
    • .settings
      • org.eclipse.jdt.core.prefs
    • pom.xml
    • src
      • main/java/com/github/maven/example
        • Widget.java
      • test/java/com/github/maven/example/tests
        • WidgetTest.java
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎example/.classpath‎

Copy file name to clipboard
+7Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="src" output="target/classes" path="src/main/java"/>
4+
<classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
5+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
6+
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"/>
7+
</classpath>
Collapse file

‎example/.project‎

Copy file name to clipboard
+23Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>github-maven-example</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.jdt.core.javabuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
<buildCommand>
14+
<name>org.eclipse.m2e.core.maven2Builder</name>
15+
<arguments>
16+
</arguments>
17+
</buildCommand>
18+
</buildSpec>
19+
<natures>
20+
<nature>org.eclipse.jdt.core.javanature</nature>
21+
<nature>org.eclipse.m2e.core.maven2Nature</nature>
22+
</natures>
23+
</projectDescription>
Collapse file

‎example/.settings/org.eclipse.jdt.core.prefs‎

Copy file name to clipboard
+12Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#Thu Sep 01 17:59:25 PDT 2011
2+
eclipse.preferences.version=1
3+
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
4+
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
5+
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
6+
org.eclipse.jdt.core.compiler.compliance=1.6
7+
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
8+
org.eclipse.jdt.core.compiler.debug.localVariable=generate
9+
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
10+
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
11+
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
12+
org.eclipse.jdt.core.compiler.source=1.6
Collapse file

‎example/pom.xml‎

Copy file name to clipboard
+173Lines changed: 173 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,173 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
5+
<groupId>com.github.kevinsawicki</groupId>
6+
<artifactId>github-maven-example</artifactId>
7+
<version>0.1-SNAPSHOT</version>
8+
<name>GitHub Maven Plugin Example</name>
9+
<description>Project to demonstrate GitHub Maven plugins</description>
10+
<url>https://github.com/kevinsawicki/github-maven-example</url>
11+
12+
<issueManagement>
13+
<url>https://github.com/kevinsawicki/github-maven-example/issues</url>
14+
<system>GitHub Issues</system>
15+
</issueManagement>
16+
17+
<licenses>
18+
<license>
19+
<name>MIT License</name>
20+
<url>http://www.opensource.org/licenses/mit-license.php</url>
21+
<distribution>repo</distribution>
22+
</license>
23+
</licenses>
24+
25+
<scm>
26+
<url>https://github.com/kevinsawicki/github-maven-example</url>
27+
<connection>scm:git:git://github.com/kevinsawicki/github-maven-example.git</connection>
28+
<developerConnection>scm:git:[email protected]:kevinsawicki/github-maven-example.git</developerConnection>
29+
</scm>
30+
31+
<developers>
32+
<developer>
33+
<email>[email protected]</email>
34+
<name>Kevin Sawicki</name>
35+
<url>https://github.com/kevinsawicki</url>
36+
<id>kevinsawicki</id>
37+
</developer>
38+
</developers>
39+
40+
<pluginRepositories>
41+
<pluginRepository>
42+
<id>oss-sonatype-snapshots</id>
43+
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
44+
</pluginRepository>
45+
</pluginRepositories>
46+
47+
<properties>
48+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
49+
</properties>
50+
51+
<build>
52+
<plugins>
53+
<plugin>
54+
<groupId>com.github.github</groupId>
55+
<artifactId>downloads-maven-plugin</artifactId>
56+
<version>0.1-SNAPSHOT</version>
57+
<configuration>
58+
<description>Official ${project.name} build of the ${project.version} release</description>
59+
<override>true</override>
60+
</configuration>
61+
<executions>
62+
<execution>
63+
<goals>
64+
<goal>upload</goal>
65+
</goals>
66+
<phase>install</phase>
67+
</execution>
68+
</executions>
69+
</plugin>
70+
<plugin>
71+
<groupId>com.github.github</groupId>
72+
<artifactId>site-maven-plugin</artifactId>
73+
<version>0.1-SNAPSHOT</version>
74+
<configuration>
75+
<message>building site for ${project.version}</message>
76+
<merge>true</merge>
77+
</configuration>
78+
<executions>
79+
<execution>
80+
<goals>
81+
<goal>site</goal>
82+
</goals>
83+
<phase>site</phase>
84+
</execution>
85+
</executions>
86+
</plugin>
87+
<plugin>
88+
<groupId>org.apache.maven.plugins</groupId>
89+
<artifactId>maven-site-plugin</artifactId>
90+
<version>3.0</version>
91+
<configuration>
92+
<reportPlugins>
93+
<plugin>
94+
<groupId>org.apache.maven.plugins</groupId>
95+
<artifactId>maven-project-info-reports-plugin</artifactId>
96+
<version>2.2</version>
97+
<configuration>
98+
<dependencyDetailsEnabled>true</dependencyDetailsEnabled>
99+
<dependencyLocationsEnabled>true</dependencyLocationsEnabled>
100+
</configuration>
101+
</plugin>
102+
<plugin>
103+
<groupId>org.apache.maven.plugins</groupId>
104+
<artifactId>maven-javadoc-plugin</artifactId>
105+
<version>2.7</version>
106+
</plugin>
107+
<plugin>
108+
<groupId>org.apache.maven.plugins</groupId>
109+
<artifactId>maven-surefire-report-plugin</artifactId>
110+
<version>2.6</version>
111+
</plugin>
112+
<plugin>
113+
<groupId>org.apache.maven.plugins</groupId>
114+
<artifactId>maven-checkstyle-plugin</artifactId>
115+
<version>2.6</version>
116+
</plugin>
117+
</reportPlugins>
118+
</configuration>
119+
</plugin>
120+
<plugin>
121+
<groupId>org.apache.maven.plugins</groupId>
122+
<artifactId>maven-compiler-plugin</artifactId>
123+
<configuration>
124+
<source>1.6</source>
125+
<target>1.6</target>
126+
</configuration>
127+
</plugin>
128+
<plugin>
129+
<groupId>org.apache.maven.plugins</groupId>
130+
<artifactId>maven-jar-plugin</artifactId>
131+
<configuration>
132+
<archive>
133+
<manifest>
134+
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
135+
<addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
136+
</manifest>
137+
</archive>
138+
</configuration>
139+
</plugin>
140+
<plugin>
141+
<groupId>org.apache.maven.plugins</groupId>
142+
<artifactId>maven-javadoc-plugin</artifactId>
143+
<executions>
144+
<execution>
145+
<goals>
146+
<goal>jar</goal>
147+
</goals>
148+
</execution>
149+
</executions>
150+
</plugin>
151+
<plugin>
152+
<groupId>org.apache.maven.plugins</groupId>
153+
<artifactId>maven-source-plugin</artifactId>
154+
<executions>
155+
<execution>
156+
<goals>
157+
<goal>jar</goal>
158+
</goals>
159+
</execution>
160+
</executions>
161+
</plugin>
162+
</plugins>
163+
</build>
164+
165+
<dependencies>
166+
<dependency>
167+
<groupId>junit</groupId>
168+
<artifactId>junit</artifactId>
169+
<version>4.8</version>
170+
<scope>test</scope>
171+
</dependency>
172+
</dependencies>
173+
</project>
Collapse file

‎example/src/main/java/com/github/maven/example/Widget.java‎

Copy file name to clipboard
+36Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
package com.github.maven.example;
2+
3+
/**
4+
* Simple wigdet class that can be enabled or disabled
5+
*/
6+
public class Widget {
7+
8+
private boolean enabled;
9+
10+
/**
11+
* Create new enabled widget
12+
*/
13+
public Widget() {
14+
enabled = true;
15+
}
16+
17+
/**
18+
* Is the widget currently enabled?
19+
*
20+
* @return true if enabled, false otherwise
21+
*/
22+
public boolean isEnabled() {
23+
return enabled;
24+
}
25+
26+
/**
27+
* Set the widget enable state
28+
*
29+
* @param enabled
30+
* @return this widget
31+
*/
32+
public Widget setEnabled(boolean enabled) {
33+
this.enabled = enabled;
34+
return this;
35+
}
36+
}
Collapse file

‎example/src/test/java/com/github/maven/example/tests/WidgetTest.java‎

Copy file name to clipboard
+35Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
package com.github.maven.example.tests;
2+
3+
import static org.junit.Assert.assertFalse;
4+
import static org.junit.Assert.assertTrue;
5+
6+
import com.github.maven.example.Widget;
7+
8+
import org.junit.Test;
9+
10+
/**
11+
* Unit tests of {@link Widget} class
12+
*/
13+
public class WidgetTest {
14+
15+
/**
16+
* Test default enable state of {@link Widget}
17+
*/
18+
@Test
19+
public void defaultState() {
20+
Widget widget = new Widget();
21+
assertTrue(widget.isEnabled());
22+
}
23+
24+
/**
25+
* Test enabling and disabling a {@link Widget}
26+
*/
27+
@Test
28+
public void updateEnableState() {
29+
Widget widget = new Widget();
30+
widget.setEnabled(false);
31+
assertFalse(widget.isEnabled());
32+
widget.setEnabled(true);
33+
assertTrue(widget.isEnabled());
34+
}
35+
}

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.