Skip to content
Browse files

Added documentation. Changed license. Made sure artifact lists are me…

…rged line by line.
  • Loading branch information...
1 parent a903b9e commit 7712df032fa140c7aa8bbea9a2d70ca66ecd7d37 @nawroth nawroth committed May 8, 2012
View
6 plugin/pom.xml
@@ -25,7 +25,7 @@
<skinArtifactId>default-skin</skinArtifactId>
<skinVersion>4</skinVersion>
<licensesVersion>7</licensesVersion>
- <license-text.header>AGPL-3-header.txt</license-text.header>
+ <license-text.header>ApacheLicense-2.0-header.txt</license-text.header>
<docs.url>http://docs.neo4j.org/</docs.url>
</properties>
@@ -53,8 +53,8 @@
<licenses>
<license>
- <name>GNU Affero General Public License, Version 3</name>
- <url>http://www.gnu.org/licenses/agpl-3.0-standalone.html</url>
+ <name>Apache License Version 2.0</name>
+ <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
</license>
</licenses>
View
57 plugin/src/main/java/org/neo4j/build/plugins/ease/AggregateMojo.java
@@ -1,21 +1,20 @@
/**
- * Copyright (c) 2012-2012 "Neo Technology,"
- * Network Engine for Objects in Lund AB [http://neotechnology.com]
+ * Licensed to Neo Technology under one or more contributor
+ * license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright
+ * ownership. Neo Technology licenses this file to you under
+ * the Apache License, Version 2.0 (the "License"); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * This file is part of Neo4j.
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * 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/>.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.neo4j.build.plugins.ease;
@@ -24,8 +23,8 @@
import java.util.HashSet;
import java.util.List;
import java.util.Set;
-import java.util.SortedMap;
-import java.util.TreeMap;
+import java.util.SortedSet;
+import java.util.TreeSet;
import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.factory.ArtifactFactory;
@@ -47,7 +46,15 @@
import org.codehaus.plexus.util.FileUtils;
/**
- * Goal which prepares artifacts for install or deploy.
+ * Aggregates multiple artifact lists into a single list and attaches it to the
+ * project.
+ *
+ * The lists to aggregate are found by traversing the dependency tree of the
+ * project, and apply filters on the result. If no configuration is given, all
+ * dependencies (including transitive) will be included.
+ *
+ * Note: Every included dependency must have an -artifacts.txt file, or the
+ * plugin will fail the build.
*
* @goal aggregate
* @phase verify
@@ -133,7 +140,7 @@
@Override
public void execute() throws MojoExecutionException
{
- SortedMap<String, String> aggregate = new TreeMap<String, String>();
+ SortedSet<String> aggregate = new TreeSet<String>();
for ( Artifact dependency : getDependencies() )
{
Artifact findArtifactsArtifact = artifactFactory.createArtifactWithClassifier(
@@ -157,12 +164,16 @@ public void execute() throws MojoExecutionException
throw new MojoExecutionException(
"Could not read artifact list for: " + dependency, ioe );
}
- aggregate.put( dependency.getId(), artifactList );
+ for ( String line : artifactList.split( "\n" ) )
+ {
+ aggregate.add( line );
+ }
}
- StringBuilder builder = new StringBuilder( aggregate.size() * 512 );
- for ( String artifactList : aggregate.values() )
+ StringBuilder builder = new StringBuilder( aggregate.size() * 64 );
+ for ( String artifactLine : aggregate )
{
- builder.append( artifactList );
+ builder.append( artifactLine )
+ .append( '\n' );
}
EaseHelper.writeAndAttachArtifactList( builder, project, projectHelper,
getLog() );
View
90 plugin/src/main/java/org/neo4j/build/plugins/ease/AttachMojo.java
@@ -1,21 +1,20 @@
/**
- * Copyright (c) 2012-2012 "Neo Technology,"
- * Network Engine for Objects in Lund AB [http://neotechnology.com]
+ * Licensed to Neo Technology under one or more contributor
+ * license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright
+ * ownership. Neo Technology licenses this file to you under
+ * the Apache License, Version 2.0 (the "License"); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * This file is part of Neo4j.
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * 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/>.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.neo4j.build.plugins.ease;
@@ -49,7 +48,6 @@
*
* @parameter expression="${artifactListLocation}"
* @required
- * @readonly
*/
private String artifactListLocation;
@@ -59,7 +57,6 @@
* local repository.
*
* @parameter expression="${artifactRepositoryLocation}"
- * @readonly
*/
private String artifactRepositoryLocation;
@@ -112,10 +109,34 @@ public void execute() throws MojoExecutionException
+ artifactListLocation );
}
- if ( artifactRepositoryLocation != null )
+ artifactRepository = setupArtifactRepository( localRepository,
+ artifactRepositoryLocation );
+
+ getLog().info(
+ "Loading artifacts from repository at: "
+ + artifactRepository.getBasedir() );
+
+ for ( String artifactString : lines )
+ {
+ Artifact findArtifact = createArtifact( artifactString );
+ if ( findArtifact == null )
+ {
+ throw new MojoExecutionException(
+ "Could not create artifact from coordinates: "
+ + artifactString );
+ }
+ findAndAttachExternalArtifact( findArtifact, artifactRepository );
+ }
+ }
+
+ private static ArtifactRepository setupArtifactRepository(
+ ArtifactRepository localRepo, String separateRepoLocation )
+ throws MojoExecutionException
+ {
+ if ( separateRepoLocation != null )
{
String url;
- File artifactRepositoryDirectory = FileUtils.getFile( artifactRepositoryLocation );
+ File artifactRepositoryDirectory = FileUtils.getFile( separateRepoLocation );
try
{
url = artifactRepositoryDirectory.toURI()
@@ -126,14 +147,14 @@ public void execute() throws MojoExecutionException
{
throw new MojoExecutionException(
"Could not parse repository location: "
- + artifactRepositoryLocation, mue );
+ + separateRepoLocation, mue );
}
if ( !artifactRepositoryDirectory.exists() )
{
throw new MojoExecutionException(
"The repository location does not exist: "
- + artifactRepositoryLocation );
+ + separateRepoLocation );
}
String id = "ease-source-repo";
@@ -144,34 +165,19 @@ public void execute() throws MojoExecutionException
ArtifactRepositoryPolicy releasesPolicy = new ArtifactRepositoryPolicy(
true, ArtifactRepositoryPolicy.UPDATE_POLICY_NEVER,
ArtifactRepositoryPolicy.CHECKSUM_POLICY_FAIL );
- artifactRepository = new MavenArtifactRepository( id, url, layout,
- snapshotsPolicy, releasesPolicy );
- if ( artifactRepository.getBasedir()
- .equals( localRepository.getBasedir() ) )
+ ArtifactRepository separateArtifactRepository = new MavenArtifactRepository(
+ id, url, layout, snapshotsPolicy, releasesPolicy );
+ if ( separateArtifactRepository.getBasedir()
+ .equals( localRepo.getBasedir() ) )
{
throw new MojoExecutionException(
"It is not allowed to point artifactRepositoryLocation to the location of the local repository." );
}
+ return separateArtifactRepository;
}
else
{
- artifactRepository = localRepository;
- }
-
- getLog().info(
- "Loading artifacts from repository at: "
- + artifactRepository.getBasedir() );
-
- for ( String artifactString : lines )
- {
- Artifact findArtifact = createArtifact( artifactString );
- if ( findArtifact == null )
- {
- throw new MojoExecutionException(
- "Could not create artifact from coordinates: "
- + artifactString );
- }
- findAndAttachExternalArtifact( findArtifact, artifactRepository );
+ return localRepo;
}
}
View
29 plugin/src/main/java/org/neo4j/build/plugins/ease/EaseHelper.java
@@ -1,21 +1,20 @@
/**
- * Copyright (c) 2012-2012 "Neo Technology,"
- * Network Engine for Objects in Lund AB [http://neotechnology.com]
+ * Licensed to Neo Technology under one or more contributor
+ * license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright
+ * ownership. Neo Technology licenses this file to you under
+ * the Apache License, Version 2.0 (the "License"); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * This file is part of Neo4j.
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * 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/>.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.neo4j.build.plugins.ease;
View
36 plugin/src/main/java/org/neo4j/build/plugins/ease/FreezeMojo.java
@@ -1,21 +1,20 @@
/**
- * Copyright (c) 2012-2012 "Neo Technology,"
- * Network Engine for Objects in Lund AB [http://neotechnology.com]
+ * Licensed to Neo Technology under one or more contributor
+ * license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright
+ * ownership. Neo Technology licenses this file to you under
+ * the Apache License, Version 2.0 (the "License"); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * This file is part of Neo4j.
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * 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/>.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.neo4j.build.plugins.ease;
@@ -30,7 +29,12 @@
import org.codehaus.plexus.util.FileUtils;
/**
- * Goal which records artifacts.
+ * Lists all attached artifacts and attaches that list to to the project.
+ *
+ * Attached artifacts are the pom.xml file, default jar file, source jar etc. --
+ * whatever has been attached to the project. The list is attached as the
+ * -artifacts.txt artifact and will be included when performing install or
+ * deploy.
*
* @goal freeze
* @requiresProject true
View
29 plugin/src/site/site.xml
@@ -1,23 +1,22 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
- Copyright (c) 2012-2012 "Neo Technology,"
- Network Engine for Objects in Lund AB [http://neotechnology.com]
+ Licensed to Neo Technology under one or more contributor
+ license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright
+ ownership. Neo Technology licenses this file to you under
+ the Apache License, Version 2.0 (the "License"); you may
+ not use this file except in compliance with the License.
+ You may obtain a copy of the License at
- This file is part of Neo4j.
+ http://www.apache.org/licenses/LICENSE-2.0
- 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/>.
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
-->
<project name="${project.artifactId}">
View
6 pom.xml
@@ -24,7 +24,7 @@
<skinArtifactId>default-skin</skinArtifactId>
<skinVersion>4</skinVersion>
<licensesVersion>7</licensesVersion>
- <license-text.header>AGPL-3-header.txt</license-text.header>
+ <license-text.header>ApacheLicense-2.0-header.txt</license-text.header>
</properties>
<scm>
@@ -39,8 +39,8 @@
<licenses>
<license>
- <name>GNU Affero General Public License, Version 3</name>
- <url>http://www.gnu.org/licenses/agpl-3.0-standalone.html</url>
+ <name>Apache License Version 2.0</name>
+ <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
</license>
</licenses>
View
19 readme.asciidoc
@@ -1,13 +1,26 @@
== Ease Maven Plugin ==
This plugin lets you release Maven artifacts in a very controlled way.
+It doesn't replace `install` or `deploy` but modifies the project before these targets are executed.
-The plugin works by adding metadata to artifacts during the release build,
+=== Introduction ===
+
+The plugin works by adding simple metadata to artifacts during the release build,
and then reading that data when deploying.
Which means release build and deploy are fully separated.
+No building or dependency resolution happens during release, it's just deploying existing artifacts from a known filesytemm location.
+
+* The `freeze` and `aggregate` goals are used while building a release.
+* The `attach` goal is used when deploying a release.
+
+The `freeze` goal should be added to all projects included in the release.
+
+The `aggregate` goal is used in a separate project.
+This project should have everything that should go into the release as dependencies.
+As the `aggregate` goal attaches the resulting list to the project just like the `freeze` goal, it can be composed in multiple levels.
-Use the `freeze` and `aggregate` goals while building a release.
-Use the `attach` goal when deploying the release.
+The `attach` goal is used in a separate project.
+This project should only be concerned with where to find the artifact list and the artifacts, and how to deploy the artifacts.
Add the plugin executions to the 'pom.xml' files.
Then just use normal `install` or `deploy` goals to bring it to action.

0 comments on commit 7712df0

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