]> source.dussan.org Git - archiva.git/commitdiff
MRM-1084 - Upgrade modello maven plugin to 1.0 to support Java 5 generics
authorJames William Dumay <jdumay@apache.org>
Thu, 12 Feb 2009 06:47:36 +0000 (06:47 +0000)
committerJames William Dumay <jdumay@apache.org>
Thu, 12 Feb 2009 06:47:36 +0000 (06:47 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@743630 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-base/archiva-configuration/pom.xml
archiva-modules/archiva-base/archiva-model/pom.xml
archiva-modules/archiva-base/archiva-model/src/main/mdo/archiva-base.xml
archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/MetadataTransferTest.java
archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/metadata/RepositoryMetadataMerge.java
pom.xml

index 2999766b95400ba0cc63ebba42bd5cf400e9c266..51c1b54fca82584c27ec15640ce51e260b13242f 100644 (file)
       <plugin>
         <groupId>org.codehaus.modello</groupId>
         <artifactId>modello-maven-plugin</artifactId>
-        <version>1.0-alpha-15</version>
         <executions>
           <execution>
             <goals>
               <goal>java</goal>
-              <goal>registry-reader</goal>
-              <goal>registry-writer</goal>
             </goals>
+          </execution>
+                 <execution>
+            <id>archiva-jpox-registry-reader</id>
+            <goals>
+                <goal>generate</goal>
+            </goals>
+            <configuration>
+                <generatorId>registry-reader</generatorId>
+            </configuration>
+          </execution>
+                 <execution>
+            <id>archiva-jpox-registry-writer</id>
+            <goals>
+                <goal>generate</goal>
+            </goals>
+            <configuration>
+                <generatorId>registry-writer</generatorId>
+            </configuration>
           </execution>
         </executions>
         <configuration>
           <version>1.2.0</version>
-          <model>src/main/mdo/configuration.mdo</model>
+                 <models>
+            <model>src/main/mdo/configuration.mdo</model>
+                 </models>
         </configuration>
       </plugin>
       <plugin>
index fae3ca346f9baaa0b0fd3689b2038b6d49dd1b52..e6f34f00fabe64741e7c94a08d594707ff645db2 100755 (executable)
       <plugin>
         <groupId>org.codehaus.modello</groupId>
         <artifactId>modello-maven-plugin</artifactId>
-        <version>1.0-alpha-17</version>
         <configuration>
           <version>1.0.0</version>
           <packageWithVersion>false</packageWithVersion>
-          <model>src/main/mdo/archiva-base.xml</model>
+                 <models>
+            <model>src/main/mdo/archiva-base.xml</model>
+                 </models>
         </configuration>
         <executions>
           <execution>
             <goals>
               <goal>java</goal>
               <goal>xsd</goal>
-              <goal>jpox-jdo-mapping</goal>
-              <goal>jpox-metadata-class</goal>
-              <!--
-              <goal>xpp3-writer</goal>
-              <goal>xpp3-reader</goal>
-                -->
             </goals>
           </execution>
+                 <execution>
+                       <id>archiva-jpox-jdo-mapping</id>
+                       <goals>
+                               <goal>generate</goal>
+                       </goals>
+                       <configuration>
+                               <generatorId>jpox-jdo-mapping</generatorId>
+                       </configuration>        
+                 </execution>
+                 <execution>
+                       <id>archiva-jpox-metadata-class</id>
+                       <goals>
+                               <goal>generate</goal>
+                       </goals>
+                       <configuration>
+                               <generatorId>jpox-metadata-class</generatorId>
+                       </configuration>        
+                 </execution>
         </executions>
       </plugin>
       <plugin>
             </goals>
           </execution>
         </executions>
+      </plugin>
+         <!-- stupid hack because jpox/modello is not supported anymore and it has bugs -->
+         <plugin>
+               <groupId>org.apache.maven.plugins</groupId>
+               <artifactId>maven-antrun-plugin</artifactId>
+               <executions>
+                       <execution>
+                               <phase>process-sources</phase>
+                               <goals>
+                                       <goal>run</goal>
+                               </goals>
+                               <configuration>
+                                       <tasks>
+                                               <copy file="${project.build.directory}/generated-sources/modello/org/apache/maven/archiva/model/package.jdo" todir="${project.build.outputDirectory}/org/apache/maven/archiva/model/" />
+                                       </tasks>
+                               </configuration>
+                   </execution>
+               </executions>
       </plugin>
       <plugin>
         <groupId>org.codehaus.mojo</groupId>
index 19884d5ec9cd0c6590e10aebd63125851e657ae4..2ef7fc6259c329bca555ef07cacb7e29c64cc3cd 100644 (file)
@@ -96,8 +96,7 @@
       -->
     <!-- 
     <class stash.storable="true"
-           jpox.table="REPOSITORIES"
-           jpox.not-persisted-fields="modelEncoding">
+           jpox.table="REPOSITORIES">
       <name>ArchivaRepositoryModel</name>
       <version>1.0.0+</version>
       <fields>
 
     <class stash.storable="true"
            jpox.table="ARTIFACT"
-           jpox.not-persisted-fields="modelEncoding"
            jpox.use-identifiers-as-primary-key="false"
            jpox.identity-type="application"
            jpox.identity-class="org.apache.maven.archiva.model.jpox.ArchivaArtifactModelKey">
     </class>
     <class stash.storable="true"
            jpox.table="JAVA_ARTIFACT"
-           jpox.not-persisted-fields="modelEncoding"
            jpox.use-identifiers-as-primary-key="false"
            jpox.identity-type="application"
            jpox.identity-class="org.apache.maven.archiva.model.jpox.ArchivaArtifactJavaDetailsKey">
 
     <class stash.storable="true"
            jpox.use-identifiers-as-primary-key="false"
-           jpox.not-persisted-fields="modelEncoding"
            jpox.identity-type="application"
            jpox.identity-class="org.apache.maven.archiva.model.jpox.ArchivaRepositoryMetadataKey"
            jpox.table="REPOSITORY_METADATA">
     </class>
 
     <class stash.storable="true"
-           jpox.not-persisted-fields="modelEncoding"
            jpox.table="REPOSITORY_METADATA_SNAPSHOTS">
       <name>SnapshotVersion</name>
       <description>The Snapshot Version</description>
     </class>
 
     <class stash.storable="true"
-           jpox.not-persisted-fields="modelEncoding"
            jpox.table="REPOSITORY_METADATA_PLUGINS">
       <name>Plugin</name>
       <description>The Plugin</description>
     -->
 
     <class stash.storable="true"
-           jpox.not-persisted-fields="modelEncoding"
            jpox.table="PROJECT_REFERENCE">
       <name>ProjectReference</name>
       <description>A reference to another (unversioned) Project</description>
     </class>
 
     <class stash.storable="true"
-           jpox.not-persisted-fields="modelEncoding"
            jpox.table="VERSIONED_REFERENCE">
       <name>VersionedReference</name>
       <description>A reference to another Versioned Project</description>
     </class>
 
     <class stash.storable="true"
-           jpox.not-persisted-fields="modelEncoding"
            jpox.table="ARTIFACT_REFERENCE">
       <name>ArtifactReference</name>
       <version>1.0.0+</version>
 
     <class stash.storable="true"
            jpox.table="PROJECT"
-           jpox.not-persisted-fields="modelEncoding"
            jpox.use-identifiers-as-primary-key="false"
            jpox.identity-type="application"
            jpox.identity-class="org.apache.maven.archiva.model.jpox.ArchivaProjectModelKey">
     </class>
 
     <class stash.storable="true"
-           jpox.not-persisted-fields="modelEncoding"
            jpox.table="MAILING_LISTS">
       <name>MailingList</name>
       <description>A Mailing List</description>
     </class>
 
     <class stash.storable="true"
-           jpox.not-persisted-fields="modelEncoding"
            jpox.table="ORGANIZATION">
       <name>Organization</name>
       <description>Specifies the organization that produces this project.</description>
     </class>
 
     <class stash.storable="true"
-           jpox.not-persisted-fields="modelEncoding"
            jpox.table="LICENSES">
       <name>License</name>
       <description><![CDATA[
     </class>
 
     <class stash.storable="true"
-           jpox.not-persisted-fields="modelEncoding"
            jpox.table="ISSUE_MANAGEMENT">
       <name>IssueManagement</name>
       <description>
       </codeSegments>
     </class>
 
-    <class jpox.not-persisted-fields="modelEncoding">
+    <class>
       <name>CiManagement</name>
       <version>1.0.0+</version>
       <fields>
       </codeSegments>
     </class>
 
-    <class stash.storable="true"
-           jpox.not-persisted-fields="modelEncoding">
+    <class stash.storable="true">
       <name>Individual</name>
       <description>
         Description of a person who has contributed to the project.
     </class>
 
     <class stash.storable="true"
-           jpox.not-persisted-fields="modelEncoding"
            jpox.table="DEPENDENCY">
       <name>Dependency</name>
       <version>1.0.0+</version>
     </class>
 
     <class stash.storable="true"
-           jpox.not-persisted-fields="modelEncoding"
            jpox.table="EXCLUSIONS">
       <name>Exclusion</name>
       <version>1.0.0+</version>
     </class>
 
     <class stash.storable="true"
-           jpox.not-persisted-fields="modelEncoding"
            jpox.table="SCM">
       <name>Scm</name>
       <version>1.0.0+</version>
       </codeSegments>
     </class>
 
-    <class stash.storable="true"
-           jpox.not-persisted-fields="modelEncoding"
-           jpox.table="PROJECT_REPOSITORIES">
+    <class stash.storable="true" jpox.table="PROJECT_REPOSITORIES">
       <name>ProjectRepository</name>
       <version>1.0.0+</version>
       <fields>
       -->
 
     <class stash.storable="true"
-           jpox.not-persisted-fields="modelEncoding"
            jpox.table="REPOSITORY_PROBLEMS">
       <name>RepositoryProblem</name>
       <version>1.0.0+</version>
       -->
 
     <class stash.storable="true"
-           jpox.not-persisted-fields="modelEncoding"
            jpox.table="REPOSITORY_STATS">
       <name>RepositoryContentStatistics</name>
       <version>1.0.0+</version>
index 84ce3e130bcadcf578475fc6d75499d04b72db99..70e2ab540b8b5203c4c6b6ab20a4314ae5bbafb9 100644 (file)
@@ -1112,7 +1112,6 @@ public class MetadataTransferTest
             m.getPlugins().add( p );
         }
 
-        m.setModelEncoding( null );
         RepositoryMetadataWriter.write( m, expectedMetadataXml );
 
         // Compare the file to the actual contents.
@@ -1148,7 +1147,6 @@ public class MetadataTransferTest
             m.getAvailableVersions().addAll( Arrays.asList( expectedVersions ) );
         }
 
-        m.setModelEncoding( null );
         RepositoryMetadataWriter.write( m, expectedMetadataXml );
 
         // Compare the file to the actual contents.
@@ -1176,7 +1174,6 @@ public class MetadataTransferTest
         m.setGroupId( metadata.getGroupId() );
         m.setArtifactId( metadata.getArtifactId() );
         m.setVersion( metadata.getVersion() );
-        m.setModelEncoding( null );
         RepositoryMetadataWriter.write( m, expectedMetadataXml );
 
         // Compare the file to the actual contents.
@@ -1254,7 +1251,6 @@ public class MetadataTransferTest
 
         m.setLastUpdated( expectedDate + expectedTime );
 
-        m.setModelEncoding( null );
         RepositoryMetadataWriter.write( m, expectedMetadataXml );
 
         // Compare the file to the actual contents.
@@ -1290,7 +1286,6 @@ public class MetadataTransferTest
             m.getAvailableVersions().addAll( Arrays.asList( expectedProxyVersions ) );
         }
 
-        m.setModelEncoding( null );
         RepositoryMetadataWriter.write( m, expectedMetadataXml );
 
         // Compare the file to the actual contents.
@@ -1320,7 +1315,6 @@ public class MetadataTransferTest
         m.setGroupId( metadata.getGroupId() );
         m.setArtifactId( metadata.getArtifactId() );
         m.setVersion( metadata.getVersion() );
-        m.setModelEncoding( null );
         RepositoryMetadataWriter.write( m, expectedMetadataXml );
 
         // Compare the file to the actual contents.
index e19dc8fd05ce297ffa70ce8120f733c3bce4befe..47d4fadd3fa292b64a96d47533076668bc363bcb 100644 (file)
@@ -219,7 +219,6 @@ public class RepositoryMetadataMerge
         {
             Plugin clonedPlugin = new Plugin();
             clonedPlugin.setArtifactId(plugin.getArtifactId());
-            clonedPlugin.setModelEncoding(plugin.getModelEncoding());
             clonedPlugin.setName(plugin.getName());
             clonedPlugin.setPrefix(plugin.getPrefix());
             result.add(plugin);
diff --git a/pom.xml b/pom.xml
index 283de7dc00db73574e2997a994f4176e4ae02fdb..d930bc7a9c3c27f2a8f66f048c4782a5672889bd 100644 (file)
--- a/pom.xml
+++ b/pom.xml
         <plugin>
           <groupId>org.codehaus.modello</groupId>
           <artifactId>modello-maven-plugin</artifactId>
-          <version>1.0-alpha-15</version>
+          <version>1.0</version>
+                 <configuration>
+                       <useJava5>true</useJava5>
+                 </configuration>
+                 <dependencies>
+            <dependency>
+              <groupId>org.codehaus.modello</groupId>
+              <artifactId>modello-plugin-plexus-registry</artifactId>
+              <version>1.0-alpha-21</version>
+            </dependency>
+                       <dependency>
+              <groupId>org.codehaus.modello</groupId>
+              <artifactId>modello-plugin-jpox</artifactId>
+              <version>1.0-alpha-21</version>
+            </dependency>
+          </dependencies>
         </plugin>
         <plugin>
           <groupId>org.apache.maven.plugins</groupId>