Skip to content
Browse files

Made sure tests are compiled by docs:install.

  • Loading branch information...
1 parent 94e0489 commit 0271f1c5afe99ed61b457a52e63e6c5fa329d150 @nawroth nawroth committed Jan 13, 2012
View
17 pom.xml
@@ -16,13 +16,17 @@
including executing a documentation-generating test
and then install the assembled docs in the local repo.</description>
<url>components.neo4j.org</url>
+ <inceptionYear>2011</inceptionYear>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <maven.build.timestamp.format>yyyy</maven.build.timestamp.format>
+ <currentYear>${maven.build.timestamp}</currentYear>
<skinGroupId>org.neo4j.maven.skins</skinGroupId>
<skinArtifactId>default-skin</skinArtifactId>
<skinVersion>4</skinVersion>
- <licensesVersion>6</licensesVersion>
+ <licensesVersion>7</licensesVersion>
<license-text.header>AGPL-3-header.txt</license-text.header>
<docs.url>http://docs.neo4j.org/</docs.url>
</properties>
@@ -375,6 +379,10 @@
<include>src/**/*.java</include>
<include>src/**/*.xml</include>
</includes>
+ <properties>
+ <inceptionYear>${project.inceptionYear}</inceptionYear>
+ <currentYear>${currentYear}</currentYear>
+ </properties>
</configuration>
</plugin>
</plugins>
@@ -385,18 +393,18 @@
<dependency>
<groupId>org.twdata.maven</groupId>
<artifactId>mojo-executor</artifactId>
- <version>[2.0]</version>
+ <version>2.0</version>
</dependency>
<dependency>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-filtering</artifactId>
- <version>[1.0]</version>
+ <version>1.0</version>
</dependency>
<!-- testing -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
- <version>[4.10]</version>
+ <version>4.10</version>
<scope>test</scope>
</dependency>
<!-- lock down versions -->
@@ -477,7 +485,6 @@
</dependency>
</dependencies>
</dependencyManagement>
-
<profiles>
<profile>
<id>enable-docs-plugin-dogfooding</id>
View
35 readme.txt
@@ -1,35 +0,0 @@
-Maven plugin to package docs
-============================
-
-After installing it, add it to the project:
-
-<plugin>
- <artifactId>docs-maven-plugin</artifactId>
- <groupId>org.neo4j.build.plugins</groupId>
- <version>0.1-SNAPSHOT</version>
- <!-- the directories below will be added by default,
- using the config element will _replace_ the defaults.
- <configuration>
- <sourceDirectories>
- <sourceDirectory>${basedir}/src/docs</sourceDirectory>
- <sourceDirectory>${project.build.directory}/docs</sourceDirectory>
- </sourceDirectories>
- </configuration>
- -->
-</plugin>
-
-There's two new commands you can use:
-
-mvn docs:assembly
-- creates the docs.jar
-- attaches the created jar to the project
-- mvn2 and mvn3
-
-mvn docs:install
-- creates and then installs the docs.jar
-- mvn3 only
-- CLI only
-
-mvn docs:install -Dtest=DocsTest
-- executes test, then assembles and installs docs.
-- needs more work, but the basic functionality is there
View
2 src/main/java/org/neo4j/build/plugins/docs/AbstractDocsMojo.java
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2002-2011 "Neo Technology,"
+ * Copyright (c) 2011-2012 "Neo Technology,"
* Network Engine for Objects in Lund AB [http://neotechnology.com]
*
* This file is part of Neo4j.
View
2 src/main/java/org/neo4j/build/plugins/docs/AssembleMojo.java
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2002-2011 "Neo Technology,"
+ * Copyright (c) 2011-2012 "Neo Technology,"
* Network Engine for Objects in Lund AB [http://neotechnology.com]
*
* This file is part of Neo4j.
View
9 src/main/java/org/neo4j/build/plugins/docs/DocsAssembler.java
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2002-2011 "Neo Technology,"
+ * Copyright (c) 2011-2012 "Neo Technology,"
* Network Engine for Objects in Lund AB [http://neotechnology.com]
*
* This file is part of Neo4j.
@@ -124,6 +124,13 @@ private File createArchive( final List<File> directories )
final String filename = project.getArtifactId() + "-"
+ project.getVersion() + "-" + CLASSIFIER + "."
+ TYPE;
+ File targetDirectory = new File( project.getBuild()
+ .getDirectory() );
+ if ( !targetDirectory.exists() && !targetDirectory.mkdir() )
+ {
+ throw new MojoExecutionException(
+ "Could not create: " + targetDirectory.getAbsolutePath() );
+ }
final File destFile = new File( project.getBuild()
.getDirectory(), filename );
if ( destFile.exists() && !destFile.delete() )
View
17 src/main/java/org/neo4j/build/plugins/docs/InstallMojo.java
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2002-2011 "Neo Technology,"
+ * Copyright (c) 2011-2012 "Neo Technology,"
* Network Engine for Objects in Lund AB [http://neotechnology.com]
*
* This file is part of Neo4j.
@@ -49,6 +49,8 @@
private static final String SUREFIRE_PLUGIN_VERSION = "2.11";
+ private static final String COMPILE_PLUGIN_VERSION = "2.3.2";
+
/**
* Test to execute.
*
@@ -79,8 +81,14 @@ private void executeTest() throws MojoExecutionException
{
executeMojo(
plugin( groupId( "org.apache.maven.plugins" ),
- artifactId( "maven-surefire-plugin" ), version( SUREFIRE_PLUGIN_VERSION ) ),
- goal( "test" ),
+ artifactId( "maven-compiler-plugin" ),
+ version( COMPILE_PLUGIN_VERSION ) ),
+ goal( "testCompile" ), configuration(),
+ executionEnvironment( project, session, pluginManager ) );
+ executeMojo(
+ plugin( groupId( "org.apache.maven.plugins" ),
+ artifactId( "maven-surefire-plugin" ),
+ version( SUREFIRE_PLUGIN_VERSION ) ), goal( "test" ),
configuration( element( name( "test" ), test ) ),
executionEnvironment( project, session, pluginManager ) );
}
@@ -101,7 +109,8 @@ private void assembleInstall() throws MojoExecutionException
final String generatePom = "false";
executeMojo(
plugin( groupId( "org.apache.maven.plugins" ),
- artifactId( "maven-install-plugin" ), version( INSTALL_PLUGIN_VERSION ) ),
+ artifactId( "maven-install-plugin" ),
+ version( INSTALL_PLUGIN_VERSION ) ),
goal( "install-file" ),
configuration( element( name( "file" ), file ),
element( name( "pomFile" ), pomFile ),
View
2 src/site/site.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
- Copyright (c) 2002-2011 "Neo Technology,"
+ Copyright (c) 2011-2012 "Neo Technology,"
Network Engine for Objects in Lund AB [http://neotechnology.com]
This file is part of Neo4j.
View
19 src/test/java/org/neo4j/build/plugins/docs/DocsTest.java
@@ -1,3 +1,22 @@
+/**
+ * Copyright (c) 2011-2012 "Neo Technology,"
+ * Network Engine for Objects in Lund AB [http://neotechnology.com]
+ *
+ * This file is part of Neo4j.
+ *
+ * Neo4j is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
package org.neo4j.build.plugins.docs;
/**
* Copyright (c) 2002-2011 "Neo Technology,"

0 comments on commit 0271f1c

Please sign in to comment.
Something went wrong with that request. Please try again.