[maven-release-plugin] copy for tag blueprint-maven-plugin-1.6.0

git-svn-id: https://svn.apache.org/repos/asf/aries/tags/blueprint-maven-plugin-1.6.0@1783631 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/pom.xml b/pom.xml
index 69600fb..2d1ee70 100644
--- a/pom.xml
+++ b/pom.xml
@@ -136,6 +136,7 @@
                 </plugin>
             </plugins>
         </pluginManagement>
+
     </build>
 
     <dependencies>
@@ -329,5 +330,4 @@
 
     </dependencies>
 
-
 </project>
diff --git a/src/main/java/org/apache/aries/blueprint/plugin/GenerateMojo.java b/src/main/java/org/apache/aries/blueprint/plugin/GenerateMojo.java
index 4d1c811..641fdc3 100644
--- a/src/main/java/org/apache/aries/blueprint/plugin/GenerateMojo.java
+++ b/src/main/java/org/apache/aries/blueprint/plugin/GenerateMojo.java
@@ -47,7 +47,7 @@
 /**
  * Generates blueprint from CDI annotations
  */
-@Mojo(name = "blueprint-write", requiresDependencyResolution = ResolutionScope.COMPILE,
+@Mojo(name = "blueprint-generate", requiresDependencyResolution = ResolutionScope.COMPILE,
         defaultPhase = LifecyclePhase.PROCESS_CLASSES, inheritByDefault = false)
 public class GenerateMojo extends AbstractMojo {
 
@@ -124,7 +124,7 @@
     }
 
     private boolean sourcesChanged() {
-        return !buildContext.hasDelta(new File(project.getCompileSourceRoots().iterator().next()));
+        return buildContext.hasDelta(new File(project.getCompileSourceRoots().iterator().next()));
     }
 
     private void writeBlueprint(Blueprint blueprint) throws Exception {
diff --git a/src/main/java/org/apache/aries/blueprint/plugin/ResourceInitializer.java b/src/main/java/org/apache/aries/blueprint/plugin/ResourceInitializer.java
index 2036b94..a967dc5 100644
--- a/src/main/java/org/apache/aries/blueprint/plugin/ResourceInitializer.java
+++ b/src/main/java/org/apache/aries/blueprint/plugin/ResourceInitializer.java
@@ -1,3 +1,21 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF 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
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * 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.apache.aries.blueprint.plugin;
 
 import org.apache.maven.model.Resource;
diff --git a/src/main/java/org/apache/aries/blueprint/plugin/handlers/bean/BeanHandler.java b/src/main/java/org/apache/aries/blueprint/plugin/handlers/bean/BeanHandler.java
index 3a8eeb8..32b85bb 100644
--- a/src/main/java/org/apache/aries/blueprint/plugin/handlers/bean/BeanHandler.java
+++ b/src/main/java/org/apache/aries/blueprint/plugin/handlers/bean/BeanHandler.java
@@ -1,3 +1,21 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF 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
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * 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.apache.aries.blueprint.plugin.handlers.bean;
 
 import org.apache.aries.blueprint.annotation.bean.Activation;
diff --git a/src/main/java/org/apache/aries/blueprint/plugin/model/Bean.java b/src/main/java/org/apache/aries/blueprint/plugin/model/Bean.java
index 79ce29b..6219424 100644
--- a/src/main/java/org/apache/aries/blueprint/plugin/model/Bean.java
+++ b/src/main/java/org/apache/aries/blueprint/plugin/model/Bean.java
@@ -35,6 +35,7 @@
 import java.lang.reflect.Field;
 import java.lang.reflect.Method;
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -44,7 +45,7 @@
 import static org.apache.aries.blueprint.plugin.model.AnnotationHelper.findSingleton;
 import static org.apache.aries.blueprint.plugin.model.NamingHelper.getBeanName;
 
-class Bean implements BeanEnricher, XmlWriter {
+class Bean implements BeanEnricher, XmlWriter, Comparable<Bean>{
 
     private static final String NS_EXT = "http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0";
 
@@ -181,8 +182,10 @@
     }
 
     private void writeCustomContent(XMLStreamWriter writer) throws XMLStreamException {
-        for (XmlWriter xmlWriter : beanContentWriters.values()) {
-            xmlWriter.write(writer);
+        List<String> customWriterKeys = new ArrayList<>(beanContentWriters.keySet());
+        Collections.sort(customWriterKeys);
+        for (String customWriterKey : customWriterKeys) {
+            beanContentWriters.get(customWriterKey).write(writer);
         }
     }
 
@@ -218,4 +221,9 @@
     BeanRef toBeanRef() {
         return new BeanRef(clazz, id, clazz.getAnnotations());
     }
+
+    @Override
+    public int compareTo(Bean o) {
+        return id.compareTo(o.id);
+    }
 }
diff --git a/src/main/java/org/apache/aries/blueprint/plugin/model/BeanRefStore.java b/src/main/java/org/apache/aries/blueprint/plugin/model/BeanRefStore.java
index a06cfed..9165698 100644
--- a/src/main/java/org/apache/aries/blueprint/plugin/model/BeanRefStore.java
+++ b/src/main/java/org/apache/aries/blueprint/plugin/model/BeanRefStore.java
@@ -1,3 +1,21 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF 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
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * 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.apache.aries.blueprint.plugin.model;
 
 import java.util.Collection;
diff --git a/src/main/java/org/apache/aries/blueprint/plugin/model/Blueprint.java b/src/main/java/org/apache/aries/blueprint/plugin/model/Blueprint.java
index 29b7668..53ea65e 100644
--- a/src/main/java/org/apache/aries/blueprint/plugin/model/Blueprint.java
+++ b/src/main/java/org/apache/aries/blueprint/plugin/model/Blueprint.java
@@ -31,6 +31,8 @@
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
+import java.util.Collections;
+import java.util.Comparator;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -133,16 +135,24 @@
 
     public void write(XMLStreamWriter writer) throws XMLStreamException {
         writeBlueprint(writer);
+        writeBeans(writer);
+        writeCustomWriters(writer);
+        writer.writeEndElement();
+    }
 
+    private void writeCustomWriters(XMLStreamWriter writer) throws XMLStreamException {
+        List<String> customWriterKeys = new ArrayList<>(customWriters.keySet());
+        Collections.sort(customWriterKeys);
+        for (String customWriterKey : customWriterKeys) {
+            customWriters.get(customWriterKey).write(writer);
+        }
+    }
+
+    private void writeBeans(XMLStreamWriter writer) throws XMLStreamException {
+        Collections.sort(generatedBeans);
         for (Bean beanWriter : generatedBeans) {
             beanWriter.write(writer);
         }
-
-        for (XmlWriter bw : customWriters.values()) {
-            bw.write(writer);
-        }
-
-        writer.writeEndElement();
     }
 
     private void writeBlueprint(XMLStreamWriter writer) throws XMLStreamException {
diff --git a/src/test/java/org/apache/aries/blueprint/plugin/test/ServiceWithTypedParameters.java b/src/test/java/org/apache/aries/blueprint/plugin/test/ServiceWithTypedParameters.java
index 4742673..b29d7a0 100644
--- a/src/test/java/org/apache/aries/blueprint/plugin/test/ServiceWithTypedParameters.java
+++ b/src/test/java/org/apache/aries/blueprint/plugin/test/ServiceWithTypedParameters.java
@@ -1,3 +1,21 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF 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
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * 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.apache.aries.blueprint.plugin.test;
 
 import org.ops4j.pax.cdi.api.OsgiServiceProvider;
diff --git a/src/test/java/org/apache/aries/blueprint/plugin/test/bean/BasicBean.java b/src/test/java/org/apache/aries/blueprint/plugin/test/bean/BasicBean.java
index 380af4b..5b51ff9 100644
--- a/src/test/java/org/apache/aries/blueprint/plugin/test/bean/BasicBean.java
+++ b/src/test/java/org/apache/aries/blueprint/plugin/test/bean/BasicBean.java
@@ -1,3 +1,21 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF 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
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * 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.apache.aries.blueprint.plugin.test.bean;
 
 import org.apache.aries.blueprint.annotation.bean.Activation;
diff --git a/src/test/java/org/apache/aries/blueprint/plugin/test/bean/BeanWithCallbackMethods.java b/src/test/java/org/apache/aries/blueprint/plugin/test/bean/BeanWithCallbackMethods.java
index 5624bab..1cf3699 100644
--- a/src/test/java/org/apache/aries/blueprint/plugin/test/bean/BeanWithCallbackMethods.java
+++ b/src/test/java/org/apache/aries/blueprint/plugin/test/bean/BeanWithCallbackMethods.java
@@ -1,3 +1,21 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF 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
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * 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.apache.aries.blueprint.plugin.test.bean;
 
 import org.apache.aries.blueprint.annotation.bean.Activation;
diff --git a/src/test/java/org/apache/aries/blueprint/plugin/test/bean/NamedBean.java b/src/test/java/org/apache/aries/blueprint/plugin/test/bean/NamedBean.java
index 773b850..ee49aec 100644
--- a/src/test/java/org/apache/aries/blueprint/plugin/test/bean/NamedBean.java
+++ b/src/test/java/org/apache/aries/blueprint/plugin/test/bean/NamedBean.java
@@ -1,3 +1,21 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF 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
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * 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.apache.aries.blueprint.plugin.test.bean;
 
 import org.apache.aries.blueprint.annotation.bean.Activation;
diff --git a/src/test/java/org/apache/aries/blueprint/plugin/test/bean/SimpleProducedBean.java b/src/test/java/org/apache/aries/blueprint/plugin/test/bean/SimpleProducedBean.java
index 12849c0..3875462 100644
--- a/src/test/java/org/apache/aries/blueprint/plugin/test/bean/SimpleProducedBean.java
+++ b/src/test/java/org/apache/aries/blueprint/plugin/test/bean/SimpleProducedBean.java
@@ -1,3 +1,21 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF 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
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * 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.apache.aries.blueprint.plugin.test.bean;
 
 public class SimpleProducedBean {