diff --git a/polyglot-atom/src/main/java/org/sonatype/maven/polyglot/atom/AtomMapping.java b/polyglot-atom/src/main/java/org/sonatype/maven/polyglot/atom/AtomMapping.java
index abb8d648..b288cee5 100644
--- a/polyglot-atom/src/main/java/org/sonatype/maven/polyglot/atom/AtomMapping.java
+++ b/polyglot-atom/src/main/java/org/sonatype/maven/polyglot/atom/AtomMapping.java
@@ -9,7 +9,6 @@
import javax.inject.Named;
import javax.inject.Singleton;
-
import org.sonatype.maven.polyglot.mapping.MappingSupport;
/**
@@ -18,13 +17,13 @@
* @author dhanji@gmail.com (Dhanji R. Prasanna)
*/
@Singleton
-@Named( "atom" )
+@Named("atom")
public class AtomMapping extends MappingSupport {
- public AtomMapping() {
- super("atom");
- setPomNames("pom.atom");
- setAcceptLocationExtensions(".atom");
- setAcceptOptionKeys("atom:4.0.0");
- setPriority(1);
- }
-}
\ No newline at end of file
+ public AtomMapping() {
+ super("atom");
+ setPomNames("pom.atom");
+ setAcceptLocationExtensions(".atom");
+ setAcceptOptionKeys("atom:4.0.0");
+ setPriority(1);
+ }
+}
diff --git a/polyglot-atom/src/main/java/org/sonatype/maven/polyglot/atom/AtomModelReader.java b/polyglot-atom/src/main/java/org/sonatype/maven/polyglot/atom/AtomModelReader.java
index 8ced4c6a..2f2d77ce 100644
--- a/polyglot-atom/src/main/java/org/sonatype/maven/polyglot/atom/AtomModelReader.java
+++ b/polyglot-atom/src/main/java/org/sonatype/maven/polyglot/atom/AtomModelReader.java
@@ -7,13 +7,11 @@
*/
package org.sonatype.maven.polyglot.atom;
-import javax.inject.Named;
-import javax.inject.Singleton;
-
import java.io.IOException;
import java.io.Reader;
import java.util.Map;
-
+import javax.inject.Named;
+import javax.inject.Singleton;
import org.apache.maven.model.Model;
import org.apache.maven.model.building.ModelProcessor;
import org.apache.maven.model.building.ModelSource;
@@ -25,18 +23,21 @@
/**
* Reads a pom.atom and transforms into a Maven {@link Model}.
- *
+ *
* @author dhanji@gmail.com (Dhanji R. Prasanna)
*/
@Singleton
-@Named( "atom" )
+@Named("atom")
public class AtomModelReader extends ModelReaderSupport {
- public Model read(final Reader input, final Map options) throws IOException {
- assert input != null;
+ public Model read(final Reader input, final Map options) throws IOException {
+ assert input != null;
- // Parse the token stream from our pom.atom configuration file.
- Project project = new AtomParser((ModelSource)options.get(ModelProcessor.SOURCE), new Tokenizer(IOUtil.toString(input)).tokenize()).parse();
- return project.toMavenModel();
- }
+ // Parse the token stream from our pom.atom configuration file.
+ Project project = new AtomParser(
+ (ModelSource) options.get(ModelProcessor.SOURCE),
+ new Tokenizer(IOUtil.toString(input)).tokenize())
+ .parse();
+ return project.toMavenModel();
+ }
}
diff --git a/polyglot-atom/src/main/java/org/sonatype/maven/polyglot/atom/AtomModelWriter.java b/polyglot-atom/src/main/java/org/sonatype/maven/polyglot/atom/AtomModelWriter.java
index 38f137ef..a004d360 100644
--- a/polyglot-atom/src/main/java/org/sonatype/maven/polyglot/atom/AtomModelWriter.java
+++ b/polyglot-atom/src/main/java/org/sonatype/maven/polyglot/atom/AtomModelWriter.java
@@ -7,9 +7,6 @@
*/
package org.sonatype.maven.polyglot.atom;
-import javax.inject.Named;
-import javax.inject.Singleton;
-
import java.io.IOException;
import java.io.PrintWriter;
import java.io.Writer;
@@ -17,7 +14,8 @@
import java.util.List;
import java.util.Map;
import java.util.regex.Pattern;
-
+import javax.inject.Named;
+import javax.inject.Singleton;
import org.apache.maven.model.Dependency;
import org.apache.maven.model.Model;
import org.apache.maven.model.Plugin;
@@ -29,251 +27,256 @@
import org.sonatype.maven.polyglot.io.ModelWriterSupport;
@Singleton
-@Named( "atom" )
+@Named("atom")
public class AtomModelWriter extends ModelWriterSupport {
- private static final Pattern ATOM_REGEX = Pattern.compile("\\d+|true|false");
+ private static final Pattern ATOM_REGEX = Pattern.compile("\\d+|true|false");
- protected Logger log = LoggerFactory.getLogger(AtomModelWriter.class);
- String indent = " ";
+ protected Logger log = LoggerFactory.getLogger(AtomModelWriter.class);
+ String indent = " ";
- @Override
- public void write(final Writer output, final Map options, final Model model) throws IOException {
- assert output != null;
- assert model != null;
+ @Override
+ public void write(final Writer output, final Map options, final Model model) throws IOException {
+ assert output != null;
+ assert model != null;
- PrintWriter pw = new PrintWriter(output);
+ PrintWriter pw = new PrintWriter(output);
- repositories(pw, model);
- project(pw, model);
- id(pw, model);
- parent(pw, model);
- properties(pw, model);
- dependencyManagement(pw, model);
- dependencies(pw, model);
- modules(pw, model);
- pw.println();
- pluginManagement(pw, model);
- plugins(pw, "plugin", model);
+ repositories(pw, model);
+ project(pw, model);
+ id(pw, model);
+ parent(pw, model);
+ properties(pw, model);
+ dependencyManagement(pw, model);
+ dependencies(pw, model);
+ modules(pw, model);
+ pw.println();
+ pluginManagement(pw, model);
+ plugins(pw, "plugin", model);
- pw.flush();
- pw.close();
- }
+ pw.flush();
+ pw.close();
+ }
- private void repositories(PrintWriter pw, Model model) {
- List repositories = model.getRepositories();
- if (!repositories.isEmpty()) {
- pw.print("repositories << \"");
- for (int i = 0; i < repositories.size(); i++) {
- pw.print(repositories.get(i).getUrl());
- if (i + 1 != repositories.size()) {
- pw.print(",");
+ private void repositories(PrintWriter pw, Model model) {
+ List repositories = model.getRepositories();
+ if (!repositories.isEmpty()) {
+ pw.print("repositories << \"");
+ for (int i = 0; i < repositories.size(); i++) {
+ pw.print(repositories.get(i).getUrl());
+ if (i + 1 != repositories.size()) {
+ pw.print(",");
+ }
+ }
+ pw.println("\"");
+ pw.println();
}
- }
- pw.println("\"");
- pw.println();
}
- }
- private void project(PrintWriter pw, Model model) {
- String name = model.getName();
- if (name == null) {
- name = model.getArtifactId();
+ private void project(PrintWriter pw, Model model) {
+ String name = model.getName();
+ if (name == null) {
+ name = model.getArtifactId();
+ }
+ String url = model.getUrl() == null ? "" : model.getUrl();
+ pw.print("project \"" + name + "\" @ \"" + url + "\"");
+ packaging(pw, model);
}
- String url = model.getUrl() == null ? "" : model.getUrl();
- pw.print("project \"" + name + "\" @ \"" + url + "\"");
- packaging(pw, model);
- }
- private void id(PrintWriter pw, Model model) {
- String groupId = model.getGroupId();
- if (groupId == null & model.getParent() != null) {
- groupId = model.getParent().getGroupId();
- }
+ private void id(PrintWriter pw, Model model) {
+ String groupId = model.getGroupId();
+ if (groupId == null & model.getParent() != null) {
+ groupId = model.getParent().getGroupId();
+ }
- String version = model.getVersion();
- if (version == null && model.getParent() != null) {
- version = model.getParent().getVersion();
+ String version = model.getVersion();
+ if (version == null && model.getParent() != null) {
+ version = model.getParent().getVersion();
+ }
+ pw.println(indent + "id: " + groupId + ":" + model.getArtifactId() + ":" + version);
}
- pw.println(indent + "id: " + groupId + ":" + model.getArtifactId() + ":" + version);
- }
- private void parent(PrintWriter pw, Model model) {
- if (model.getParent() != null) {
- pw.print(indent + "inherits: " + model.getParent().getGroupId() + ":" + model.getParent().getArtifactId() + ":" + model.getParent().getVersion());
- if (model.getParent().getRelativePath() != null) {
- //pw.println(":" + model.getParent().getRelativePath());
-// pw.println(":" + "../pom.atom");
- }
- pw.println();
+ private void parent(PrintWriter pw, Model model) {
+ if (model.getParent() != null) {
+ pw.print(indent + "inherits: " + model.getParent().getGroupId() + ":"
+ + model.getParent().getArtifactId() + ":"
+ + model.getParent().getVersion());
+ if (model.getParent().getRelativePath() != null) {
+ // pw.println(":" + model.getParent().getRelativePath());
+ // pw.println(":" + "../pom.atom");
+ }
+ pw.println();
+ }
}
- }
- private void packaging(PrintWriter pw, Model model) {
- pw.println(" as " + model.getPackaging());
- }
+ private void packaging(PrintWriter pw, Model model) {
+ pw.println(" as " + model.getPackaging());
+ }
- private void properties(PrintWriter pw, Model model) {
- if (!model.getProperties().isEmpty()) {
- List