diff options
author | Brett Porter <brett@apache.org> | 2009-10-16 11:30:46 +0000 |
---|---|---|
committer | Brett Porter <brett@apache.org> | 2009-10-16 11:30:46 +0000 |
commit | 4e4362191f12adbffc2af970b6e1e4affea94954 (patch) | |
tree | 83a64717895955a8c584970f0bed72b44708e5e1 /archiva-modules/archiva-base/archiva-model | |
parent | e75014219beca14e8128dc65b28e838c96ba36d7 (diff) | |
parent | 61336c8774e7341d5d16d4adba809ef2ca54a969 (diff) | |
download | archiva-4e4362191f12adbffc2af970b6e1e4affea94954.tar.gz archiva-4e4362191f12adbffc2af970b6e1e4affea94954.zip |
recreate from trunk
git-svn-id: https://svn.apache.org/repos/asf/archiva/branches/MRM-1025@825849 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules/archiva-base/archiva-model')
9 files changed, 220 insertions, 423 deletions
diff --git a/archiva-modules/archiva-base/archiva-model/pom.xml b/archiva-modules/archiva-base/archiva-model/pom.xml index eaa37a4b7..f686016c9 100755 --- a/archiva-modules/archiva-base/archiva-model/pom.xml +++ b/archiva-modules/archiva-base/archiva-model/pom.xml @@ -22,7 +22,7 @@ <parent> <groupId>org.apache.archiva</groupId> <artifactId>archiva-base</artifactId> - <version>1.2-MRM1025-SNAPSHOT</version> + <version>1.2.3-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion> <artifactId>archiva-model</artifactId> @@ -49,21 +49,32 @@ <groupId>javax.jdo</groupId> <artifactId>jdo2-api</artifactId> </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-simple</artifactId> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>jcl-over-slf4j</artifactId> + <scope>runtime</scope> + </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.codehaus.plexus</groupId> - <artifactId>plexus-maven-plugin</artifactId> + <artifactId>plexus-component-metadata</artifactId> </plugin> <plugin> <groupId>org.codehaus.modello</groupId> <artifactId>modello-maven-plugin</artifactId> - <version>1.0-alpha-17</version> <configuration> - <version>1.0.0</version> + <version>1.2.1</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> @@ -71,14 +82,26 @@ <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> @@ -139,6 +162,25 @@ </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> <artifactId>cobertura-maven-plugin</artifactId> diff --git a/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/AbstractArtifactKey.java b/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/AbstractArtifactKey.java index bb96d6f54..bf9d95ac4 100644 --- a/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/AbstractArtifactKey.java +++ b/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/AbstractArtifactKey.java @@ -106,6 +106,11 @@ public class AbstractArtifactKey public String type = ""; /** + * The Repository Id (JPOX Requires this remain public) + */ + public String repositoryId = ""; + + /** * Default Constructor. Required by JPOX. */ public AbstractArtifactKey() @@ -126,19 +131,22 @@ public class AbstractArtifactKey version = parts[2]; classifier = parts[3]; type = parts[4]; + repositoryId = parts[5]; } /** * Get the String representation of this object. - Required by JPOX. */ + @Override public String toString() { - return StringUtils.join( new String[] { groupId, artifactId, version, classifier, type }, ':' ); + return StringUtils.join( new String[] { groupId, artifactId, version, classifier, type, repositoryId }, ':' ); } /** * Get the hashcode for this object's values - Required by JPOX. */ + @Override public int hashCode() { final int PRIME = 31; @@ -148,12 +156,14 @@ public class AbstractArtifactKey result = PRIME * result + ( ( version == null ) ? 0 : version.hashCode() ); result = PRIME * result + ( ( classifier == null ) ? 0 : classifier.hashCode() ); result = PRIME * result + ( ( type == null ) ? 0 : type.hashCode() ); + result = PRIME * result + ( ( repositoryId == null ) ? 0 : repositoryId.hashCode() ); return result; } /** * Get the equals for this object's values - Required by JPOX. */ + @Override public boolean equals( Object obj ) { if ( this == obj ) @@ -233,6 +243,18 @@ public class AbstractArtifactKey return false; } + if ( repositoryId == null ) + { + if ( other.repositoryId != null ) + { + return false; + } + } + else if ( !repositoryId.equals( other.repositoryId ) ) + { + return false; + } + return true; } @@ -286,4 +308,13 @@ public class AbstractArtifactKey } } + public void setRepositoryId( String repositoryId ) + { + this.repositoryId = ""; + + if ( StringUtils.isNotBlank(repositoryId) ) + { + this.repositoryId = repositoryId; + } + } } diff --git a/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/AbstractProjectKey.java b/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/AbstractProjectKey.java index 63b2bc6af..445c21e99 100644 --- a/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/AbstractProjectKey.java +++ b/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/AbstractProjectKey.java @@ -113,6 +113,7 @@ public class AbstractProjectKey /** * Get the String representation of this object. - Required by JPOX. */ + @Override public String toString() { return StringUtils.join( new String[] { groupId, artifactId } ); @@ -121,6 +122,7 @@ public class AbstractProjectKey /** * Get the hashcode for this object's values - Required by JPOX. */ + @Override public int hashCode() { final int PRIME = 31; @@ -133,6 +135,7 @@ public class AbstractProjectKey /** * Get the equals for this object's values - Required by JPOX. */ + @Override public boolean equals( Object obj ) { if ( this == obj ) diff --git a/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/ArchivaArtifact.java b/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/ArchivaArtifact.java index 54bf1a828..baf086296 100644 --- a/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/ArchivaArtifact.java +++ b/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/ArchivaArtifact.java @@ -36,7 +36,7 @@ public class ArchivaArtifact private String baseVersion; public ArchivaArtifact( String groupId, String artifactId, String version, - String classifier, String type ) + String classifier, String type, String repositoryId ) { if ( empty( groupId ) ) { @@ -62,6 +62,12 @@ public class ArchivaArtifact + Keys.toKey( groupId, artifactId, version, classifier, type ) + "]" ); } + if ( empty( repositoryId ) ) + { + throw new IllegalArgumentException( "Unable to create ArchivaArtifact with empty repositoryId [" + + Keys.toKey( groupId, artifactId, version, classifier, type ) + "]" ); + } + model = new ArchivaArtifactModel(); model.setGroupId( groupId ); @@ -70,6 +76,7 @@ public class ArchivaArtifact model.setClassifier( StringUtils.defaultString( classifier ) ); model.setType( type ); model.setSnapshot( VersionUtil.isSnapshot( version ) ); + model.setRepositoryId(repositoryId); this.baseVersion = VersionUtil.getBaseVersion( version ); } @@ -81,9 +88,9 @@ public class ArchivaArtifact this.baseVersion = VersionUtil.getBaseVersion( model.getVersion() ); } - public ArchivaArtifact( ArtifactReference ref ) + public ArchivaArtifact( ArtifactReference ref, String repositoryId ) { - this( ref.getGroupId(), ref.getArtifactId(), ref.getVersion(), ref.getClassifier(), ref.getType() ); + this( ref.getGroupId(), ref.getArtifactId(), ref.getVersion(), ref.getClassifier(), ref.getType(), repositoryId ); } public ArchivaArtifactModel getModel() @@ -131,6 +138,12 @@ public class ArchivaArtifact return StringUtils.isNotEmpty( model.getClassifier() ); } + public String getRepositoryId() + { + return model.getRepositoryId(); + } + + @Override public int hashCode() { final int PRIME = 31; @@ -146,6 +159,7 @@ public class ArchivaArtifact return result; } + @Override public boolean equals( Object obj ) { if ( this == obj ) @@ -180,6 +194,7 @@ public class ArchivaArtifact return true; } + @Override public String toString() { StringBuffer sb = new StringBuffer(); diff --git a/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/ArchivaModelCloner.java b/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/ArchivaModelCloner.java index 8eba80c1f..66af52d93 100644 --- a/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/ArchivaModelCloner.java +++ b/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/ArchivaModelCloner.java @@ -65,6 +65,7 @@ public class ArchivaModelCloner cloned.setPlugins( clonePlugins( model.getPlugins() ) ); cloned.setReports( cloneReports( model.getReports() ) ); cloned.setDependencyManagement( cloneDependencies( model.getDependencyManagement() ) ); + cloned.setProperties( clone(model.getProperties() ) ); return cloned; } @@ -98,6 +99,7 @@ public class ArchivaModelCloner cloned.setSystem( ciManagement.getSystem() ); cloned.setUrl( ciManagement.getUrl() ); + cloned.setCiUrl( ciManagement.getCiUrl() ); return cloned; } @@ -138,6 +140,7 @@ public class ArchivaModelCloner IssueManagement cloned = new IssueManagement(); + cloned.setIssueManagementUrl( issueManagement.getIssueManagementUrl() ); cloned.setSystem( issueManagement.getSystem() ); cloned.setUrl( issueManagement.getUrl() ); @@ -175,10 +178,12 @@ public class ArchivaModelCloner cloned.setFavicon( organization.getFavicon() ); cloned.setName( organization.getName() ); cloned.setUrl( organization.getUrl() ); + cloned.setOrganizationName( organization.getOrganizationName() ); return cloned; } + @SuppressWarnings("unchecked") public static Properties clone( Properties properties ) { if ( properties == null ) @@ -188,7 +193,7 @@ public class ArchivaModelCloner Properties cloned = new Properties(); - Enumeration keys = properties.propertyNames(); + Enumeration<String> keys = (Enumeration<String>) properties.propertyNames(); while ( keys.hasMoreElements() ) { String key = (String) keys.nextElement(); @@ -246,39 +251,34 @@ public class ArchivaModelCloner return cloned; } - public static List cloneArtifactReferences( List artifactReferenceList ) + public static List<ArtifactReference> cloneArtifactReferences( List<ArtifactReference> artifactReferenceList ) { if ( artifactReferenceList == null ) { return null; } - List ret = new ArrayList(); + List<ArtifactReference> ret = new ArrayList<ArtifactReference>(); - Iterator it = artifactReferenceList.iterator(); - while ( it.hasNext() ) + for ( ArtifactReference ref : artifactReferenceList ) { - ArtifactReference artifactReference = (ArtifactReference) it.next(); - ret.add( clone( artifactReference ) ); + ret.add( clone( ref ) ); } return ret; } - public static List cloneDependencies( List dependencies ) + public static List<Dependency> cloneDependencies( List<Dependency> dependencies ) { if ( dependencies == null ) { return null; } - List ret = new ArrayList(); + List<Dependency> ret = new ArrayList<Dependency>(); - Iterator it = dependencies.iterator(); - while ( it.hasNext() ) + for ( Dependency dep : dependencies ) { - Dependency dep = (Dependency) it.next(); - if ( dep == null ) { // Skip null dependency. @@ -291,19 +291,17 @@ public class ArchivaModelCloner return ret; } - public static List cloneExclusions( List exclusions ) + public static List<Exclusion> cloneExclusions( List<Exclusion> exclusions ) { if ( exclusions == null ) { return null; } - List ret = new ArrayList(); + List<Exclusion> ret = new ArrayList<Exclusion>(); - Iterator it = exclusions.iterator(); - while ( it.hasNext() ) + for ( Exclusion exclusion : exclusions ) { - Exclusion exclusion = (Exclusion) it.next(); Exclusion cloned = new Exclusion(); cloned.setGroupId( exclusion.getGroupId() ); @@ -315,19 +313,19 @@ public class ArchivaModelCloner return ret; } - public static List cloneIndividuals( List individuals ) + public static List<Individual> cloneIndividuals( List<Individual> individuals ) { if ( individuals == null ) { return individuals; } - List ret = new ArrayList(); + List<Individual> ret = new ArrayList<Individual>(); - Iterator it = individuals.iterator(); + Iterator<Individual> it = individuals.iterator(); while ( it.hasNext() ) { - Individual individual = (Individual) it.next(); + Individual individual = it.next(); Individual cloned = new Individual(); cloned.setPrincipal( individual.getPrincipal() ); @@ -338,6 +336,7 @@ public class ArchivaModelCloner cloned.setOrganizationUrl( individual.getOrganizationUrl() ); cloned.setUrl( individual.getUrl() ); cloned.setTimezone( individual.getTimezone() ); + cloned.setIndividualEmail( individual.getIndividualEmail() ); cloned.setRoles( cloneRoles( individual.getRoles() ) ); cloned.setProperties( clone( individual.getProperties() ) ); @@ -348,19 +347,17 @@ public class ArchivaModelCloner return ret; } - public static List cloneLicenses( List licenses ) + public static List<License> cloneLicenses( List<License> licenses ) { if ( licenses == null ) { return null; } - List ret = new ArrayList(); + List<License> ret = new ArrayList<License>(); - Iterator it = licenses.iterator(); - while ( it.hasNext() ) + for ( License license : licenses ) { - License license = (License) it.next(); License cloned = new License(); cloned.setId( license.getId() ); @@ -374,20 +371,17 @@ public class ArchivaModelCloner return ret; } - public static List cloneMailingLists( List mailingLists ) + public static List<MailingList> cloneMailingLists( List<MailingList> mailingLists ) { if ( mailingLists == null ) { return null; } - List ret = new ArrayList(); + List<MailingList> ret = new ArrayList<MailingList>(); - Iterator it = mailingLists.iterator(); - while ( it.hasNext() ) + for ( MailingList mailingList : mailingLists ) { - MailingList mailingList = (MailingList) it.next(); - if ( mailingList == null ) { // Skip null mailing list. @@ -400,29 +394,27 @@ public class ArchivaModelCloner return ret; } - public static List clonePlugins( List plugins ) + public static List<ArtifactReference> clonePlugins( List<ArtifactReference> plugins ) { return cloneArtifactReferences( plugins ); } - public static List cloneReports( List reports ) + public static List<ArtifactReference> cloneReports( List<ArtifactReference> reports ) { return cloneArtifactReferences( reports ); } - public static List cloneRepositories( List repositories ) + public static List<ProjectRepository> cloneRepositories( List<ProjectRepository> repositories ) { if ( repositories == null ) { return null; } - List ret = new ArrayList(); + List<ProjectRepository> ret = new ArrayList<ProjectRepository>(); - Iterator it = repositories.iterator(); - while ( it.hasNext() ) + for ( ProjectRepository repository : repositories ) { - ProjectRepository repository = (ProjectRepository) it.next(); ProjectRepository cloned = new ProjectRepository(); cloned.setId( repository.getId() ); @@ -439,32 +431,29 @@ public class ArchivaModelCloner return ret; } - public static List cloneRoles( List roles ) + public static List<String> cloneRoles( List<String> roles ) { return cloneSimpleStringList( roles ); } - private static List cloneSimpleStringList( List simple ) + private static List<String> cloneSimpleStringList( List<String> simple ) { if ( simple == null ) { return null; } - List ret = new ArrayList(); + List<String> ret = new ArrayList<String>(); - Iterator it = simple.iterator(); - - while ( it.hasNext() ) + for ( String txt : simple ) { - String txt = (String) it.next(); ret.add( txt ); } return ret; } - public static List cloneAvailableVersions( List availableVersions ) + public static List<String> cloneAvailableVersions( List<String> availableVersions ) { return cloneSimpleStringList( availableVersions ); } diff --git a/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/jpox/ArchivaArtifactJavaDetailsKey.java b/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/jpox/ArchivaArtifactJavaDetailsKey.java deleted file mode 100644 index 9fb78e6bf..000000000 --- a/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/jpox/ArchivaArtifactJavaDetailsKey.java +++ /dev/null @@ -1,46 +0,0 @@ -package org.apache.maven.archiva.model.jpox; - -/* - * 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * 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. - */ - -import org.apache.maven.archiva.model.AbstractArtifactKey; - -import java.io.Serializable; - -/** - * ArchivaArtifactJavaDetailsKey - unique classid-key for JPOX. - * - * @version $Id$ - */ -public class ArchivaArtifactJavaDetailsKey - extends AbstractArtifactKey - implements Serializable -{ - private static final long serialVersionUID = -2565748477203220905L; - - public ArchivaArtifactJavaDetailsKey() - { - } - - public ArchivaArtifactJavaDetailsKey( String key ) - { - super( key ); - } - -} diff --git a/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/platform/JavaArtifactHelper.java b/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/platform/JavaArtifactHelper.java deleted file mode 100644 index a05852631..000000000 --- a/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/platform/JavaArtifactHelper.java +++ /dev/null @@ -1,43 +0,0 @@ -package org.apache.maven.archiva.model.platform; - -/* - * 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * 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. - */ - -import org.apache.maven.archiva.model.ArchivaArtifact; -import org.apache.maven.archiva.model.ArchivaArtifactJavaDetails; - -/** - * Utility methods for working with java platform specific ArchivaArtifacts. - * - * @version $Id$ - */ -public class JavaArtifactHelper -{ - public static ArchivaArtifactJavaDetails getJavaDetails( ArchivaArtifact artifact ) - { - ArchivaArtifactJavaDetails javaDetails = (ArchivaArtifactJavaDetails) artifact.getPlatformDetails(); - if ( javaDetails == null ) - { - javaDetails = new ArchivaArtifactJavaDetails(); - artifact.setPlatformDetails( javaDetails ); - } - - return javaDetails; - } -} diff --git a/archiva-modules/archiva-base/archiva-model/src/main/mdo/archiva-base.xml b/archiva-modules/archiva-base/archiva-model/src/main/mdo/archiva-base.xml index 93912f688..de08a8d7b 100644 --- a/archiva-modules/archiva-base/archiva-model/src/main/mdo/archiva-base.xml +++ b/archiva-modules/archiva-base/archiva-model/src/main/mdo/archiva-base.xml @@ -1,11 +1,11 @@ <?xml version="1.0" ?> <model jpox.mapping-in-package="true" jpox.table-prefix="ARCHIVA_" - xsd.namespace="http://maven.apache.org/archiva/MODEL-1.0.0" - xsd.target-namespace="http://maven.apache.org/archiva/MODEL-1.0.0"> + xsd.namespace="http://archiva.apache.org/model/1.2.0" + xsd.target-namespace="http://archiva.apache.org/model/1.2.0"> <id>archiva-base-model</id> <name>ArchivaBaseModel</name> - <version>1.0.0</version> + <version>1.2.1</version> <description>Archiva Model</description> <defaults> <default> @@ -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> @@ -219,7 +218,6 @@ <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"> @@ -230,8 +228,6 @@ NOTE TO ARCHIVA DEVELOPERS.... The ArchivaArtifact object should contain no platform specifics!! - Put Java specifics in the ArchivaArtifactJavaDetails object. - Put .Net specifics in the ArchivaArtifactDotNetDetails object. --> <field stash.maxSize="250" jpox.primary-key="true" @@ -299,11 +295,14 @@ The type of artifact. </description> </field> - <field stash.maxSize="50"> + <field stash.maxSize="50" + jpox.primary-key="true" + jpox.value-strategy="off" + jpox.persistence-modifier="persistent"> <name>repositoryId</name> - <identifier>false</identifier> + <identifier>true</identifier> <version>1.0.0+</version> - <required>false</required> + <required>true</required> <type>String</type> <description> The repository associated with this content. @@ -408,7 +407,7 @@ <type>Date</type> <required>false</required> <description> - When this artifact was gathered or disovered from the repository. + When this artifact was gathered or discovered from the repository. </description> </field> </fields> @@ -435,129 +434,6 @@ </codeSegment> </codeSegments> </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"> - <name>ArchivaArtifactJavaDetails</name> - <interfaces> - <interface>org.apache.maven.archiva.model.ArchivaArtifactPlatformDetails</interface> - </interfaces> - <version>1.0.0+</version> - <fields> - <field stash.maxSize="250" - jpox.primary-key="true" - jpox.value-strategy="off" - jpox.persistence-modifier="persistent"> - <name>groupId</name> - <identifier>true</identifier> - <version>1.0.0+</version> - <type>String</type> - <required>true</required> - <description> - The Group ID of the repository content. - </description> - </field> - <field stash.maxSize="80" - jpox.primary-key="true" - jpox.value-strategy="off" - jpox.persistence-modifier="persistent"> - <name>artifactId</name> - <identifier>true</identifier> - <version>1.0.0+</version> - <type>String</type> - <required>true</required> - <description> - The Artifact ID of the repository content. - </description> - </field> - <field stash.maxSize="50" - jpox.primary-key="true" - jpox.value-strategy="off" - jpox.persistence-modifier="persistent"> - <name>version</name> - <identifier>true</identifier> - <version>1.0.0+</version> - <type>String</type> - <required>true</required> - <description> - The version of the repository content. - </description> - </field> - <field stash.maxSize="50" - jpox.primary-key="true" - jpox.value-strategy="off" - jpox.persistence-modifier="persistent"> - <name>classifier</name> - <identifier>true</identifier> - <version>1.0.0+</version> - <type>String</type> - <required>true</required> - <description> - The classifier for this artifact. - </description> - </field> - <field stash.maxSize="50" - jpox.primary-key="true" - jpox.value-strategy="off" - jpox.persistence-modifier="persistent" - jpox.column="FILE_TYPE"> - <name>type</name> - <identifier>true</identifier> - <version>1.0.0+</version> - <type>String</type> - <required>true</required> - <description> - The type of artifact. - </description> - </field> - <field> - <name>checksumBytecode</name> - <identifier>false</identifier> - <version>1.0.0+</version> - <type>String</type> - <required>false</required> - <description> - The SHA1 checksum for the bytecode in the artifact file. (Can be empty if - the artifact contains no bytecode) - </description> - </field> - <field> - <name>jdk</name> - <identifier>false</identifier> - <version>1.0.0+</version> - <type>String</type> - <required>false</required> - <description> - The JDK revision of the bytecode. (Can be empty if the artifact contains no bytecode) - </description> - </field> - </fields> - <codeSegments> - <codeSegment> - <version>1.0.0+</version> - <code><![CDATA[ - private static final long serialVersionUID = -4774236779581844880L; - ]]></code> - </codeSegment> - <codeSegment> - <version>1.0.0+</version> - <code><![CDATA[ - /** - * Identify this implementation as a set of java details. - * - * @return the Java platform string - */ - public String getPlatform() - { - return "java"; - } - ]]></code> - </codeSegment> - </codeSegments> - </class> <!-- _______________________________________________________________ __ __ _ _ _ @@ -570,7 +446,6 @@ <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"> @@ -736,27 +611,26 @@ ]]></code> </codeSegment> <codeSegment> - <version>1.0.0</version> + <version>1.0.0+</version> <code> - public void updateTimestamp() - { - setLastUpdatedTimestamp( new java.util.Date() ); - } + public void updateTimestamp() + { + setLastUpdatedTimestamp( new java.util.Date() ); + } - public void setLastUpdatedTimestamp( java.util.Date date ) - { - java.util.TimeZone timezone = java.util.TimeZone.getTimeZone( "UTC" ); - java.text.DateFormat fmt = new java.text.SimpleDateFormat( "yyyyMMddHHmmss" ); - fmt.setTimeZone( timezone ); - setLastUpdated( fmt.format( date ) ); - } + public void setLastUpdatedTimestamp( java.util.Date date ) + { + java.util.TimeZone timezone = java.util.TimeZone.getTimeZone( "UTC" ); + java.text.DateFormat fmt = new java.text.SimpleDateFormat( "yyyyMMddHHmmss" ); + fmt.setTimeZone( timezone ); + setLastUpdated( fmt.format( date ) ); + } </code> </codeSegment> </codeSegments> </class> <class stash.storable="true" - jpox.not-persisted-fields="modelEncoding" jpox.table="REPOSITORY_METADATA_SNAPSHOTS"> <name>SnapshotVersion</name> <description>The Snapshot Version</description> @@ -791,7 +665,6 @@ </class> <class stash.storable="true" - jpox.not-persisted-fields="modelEncoding" jpox.table="REPOSITORY_METADATA_PLUGINS"> <name>Plugin</name> <description>The Plugin</description> @@ -839,7 +712,6 @@ --> <class stash.storable="true" - jpox.not-persisted-fields="modelEncoding" jpox.table="PROJECT_REFERENCE"> <name>ProjectReference</name> <description>A reference to another (unversioned) Project</description> @@ -903,7 +775,6 @@ </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> @@ -979,7 +850,6 @@ </class> <class stash.storable="true" - jpox.not-persisted-fields="modelEncoding" jpox.table="ARTIFACT_REFERENCE"> <name>ArtifactReference</name> <version>1.0.0+</version> @@ -1199,7 +1069,6 @@ <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"> @@ -1309,7 +1178,7 @@ The timestamp when this model was indexed. </description> </field> - <field stash.maxSize="250"> + <field stash.maxSize="1020"> <name>url</name> <identifier>false</identifier> <version>1.0.0+</version> @@ -1516,7 +1385,6 @@ </class> <class stash.storable="true" - jpox.not-persisted-fields="modelEncoding" jpox.table="MAILING_LISTS"> <name>MailingList</name> <description>A Mailing List</description> @@ -1546,7 +1414,7 @@ <description>The email address to post to this mailing list.</description> <type>String</type> </field> - <field stash.maxSize="250"> + <field stash.maxSize="1020"> <name>mainArchiveUrl</name> <version>1.0.0+</version> <description>The url to the archive for this mailing list.</description> @@ -1574,7 +1442,6 @@ </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> @@ -1584,16 +1451,23 @@ <name>name</name> <identifier>true</identifier> <version>1.0.0+</version> - <description><![CDATA[The full name of the organization.]]></description> + <description><![CDATA[The generated id of the organization object. Due to problems in upgrading, + we cannot unset this as the identifier and we cannot rename this as well.]]></description> <type>String</type> </field> - <field stash.maxSize="250"> + <field stash.maxSize="250" null-value="default"> + <name>organizationName</name> + <version>1.2.1+</version> + <description><![CDATA[The full name of the organization.]]></description> + <type>String</type> + </field> + <field stash.maxSize="1020"> <name>url</name> <version>1.0.0+</version> <description><![CDATA[The URL to the organization's home page.]]></description> <type>String</type> </field> - <field stash.maxSize="250" + <field stash.maxSize="1020" jpox.column="FAVICON_URL"> <name>favicon</name> <version>1.0.0+</version> @@ -1618,7 +1492,6 @@ </class> <class stash.storable="true" - jpox.not-persisted-fields="modelEncoding" jpox.table="LICENSES"> <name>License</name> <description><![CDATA[ @@ -1643,7 +1516,7 @@ <description><![CDATA[The full legal name of the license.]]></description> <type>String</type> </field> - <field stash.maxSize="250"> + <field stash.maxSize="1020"> <name>url</name> <version>1.0.0+</version> <description><![CDATA[The official url for the license text.]]></description> @@ -1669,7 +1542,6 @@ </class> <class stash.storable="true" - jpox.not-persisted-fields="modelEncoding" jpox.table="ISSUE_MANAGEMENT"> <name>IssueManagement</name> <description> @@ -1681,6 +1553,13 @@ <name>url</name> <identifier>true</identifier> <version>1.0.0+</version> + <description><![CDATA[The generated id for the issue management object. Due to problems in upgrading, + we cannot unset this as the identifier and we cannot rename this as well.]]></description> + <type>String</type> + </field> + <field stash.maxSize="1020" null-value="default"> + <name>issueManagementUrl</name> + <version>1.2.1+</version> <description><![CDATA[URL for the issue management system used by the project.]]></description> <type>String</type> </field> @@ -1701,14 +1580,22 @@ </codeSegments> </class> - <class jpox.not-persisted-fields="modelEncoding"> + <class> <name>CiManagement</name> <version>1.0.0+</version> <fields> <field stash.maxSize="250"> <name>url</name> - <identifier>true</identifier> <version>1.0.0+</version> + <identifier>true</identifier> + <description> + <![CDATA[The generated id for the CI management object. Due to problems in upgrading, + we cannot unset this as the identifier and we cannot rename this as well.]]></description> + <type>String</type> + </field> + <field stash.maxSize="1020" null-value="default"> + <name>ciUrl</name> + <version>1.2.1+</version> <description> <![CDATA[URL for the continuous integration system used by the project if it has a web interface.]]></description> <type>String</type> @@ -1732,8 +1619,7 @@ </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. @@ -1745,6 +1631,13 @@ <name>email</name> <identifier>true</identifier> <version>1.0.0+</version> + <description><![CDATA[The generated id for the object. Due to problems in upgrading, + we cannot unset this as the identifier and we cannot rename this as well.]]></description> + <type>String</type> + </field> + <field stash.maxSize="250" null-value="default"> + <name>individualEmail</name> + <version>1.2.1+</version> <description><![CDATA[The email address of the individual.]]></description> <type>String</type> </field> @@ -1770,7 +1663,7 @@ </description> <type>boolean</type> </field> - <field stash.maxSize="250"> + <field stash.maxSize="1020"> <name>url</name> <version>1.0.0+</version> <description><![CDATA[The URL for the homepage of the individual.]]></description> @@ -1784,7 +1677,7 @@ <description><![CDATA[The organization to which the individual belongs.]]></description> <type>String</type> </field> - <field stash.maxSize="250"> + <field stash.maxSize="1020"> <name>organizationUrl</name> <alias>organisationUrl</alias> <version>1.0.0+</version> @@ -1837,7 +1730,6 @@ </class> <class stash.storable="true" - jpox.not-persisted-fields="modelEncoding" jpox.table="DEPENDENCY"> <name>Dependency</name> <version>1.0.0+</version> @@ -1914,7 +1806,7 @@ <type>boolean</type> <!-- <defaultValue>false</defaultValue> --> </field> - <field stash.maxSize="250"> + <field stash.maxSize="1020"> <name>url</name> <version>1.0.0+</version> <description><![CDATA[ @@ -2027,7 +1919,6 @@ </class> <class stash.storable="true" - jpox.not-persisted-fields="modelEncoding" jpox.table="EXCLUSIONS"> <name>Exclusion</name> <version>1.0.0+</version> @@ -2058,12 +1949,11 @@ </class> <class stash.storable="true" - jpox.not-persisted-fields="modelEncoding" jpox.table="SCM"> <name>Scm</name> <version>1.0.0+</version> <fields> - <field stash.maxSize="250" jpox.column="SCM_URL"> + <field stash.maxSize="1020" jpox.column="SCM_URL"> <name>connection</name> <version>1.0.0+</version> <description><![CDATA[ @@ -2076,7 +1966,7 @@ ]]></description> <type>String</type> </field> - <field stash.maxSize="250"> + <field stash.maxSize="1020"> <name>developerConnection</name> <version>1.0.0+</version> <description><![CDATA[ @@ -2085,7 +1975,7 @@ ]]></description> <type>String</type> </field> - <field stash.maxSize="250"> + <field stash.maxSize="1020"> <name>url</name> <version>1.0.0+</version> <description> @@ -2103,9 +1993,7 @@ </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> @@ -2126,7 +2014,7 @@ ]]></description> <type>String</type> </field> - <field stash.maxSize="250"> + <field stash.maxSize="1020"> <name>url</name> <version>1.0.0+</version> <description><![CDATA[ @@ -2188,7 +2076,6 @@ --> <class stash.storable="true" - jpox.not-persisted-fields="modelEncoding" jpox.table="REPOSITORY_PROBLEMS"> <name>RepositoryProblem</name> <version>1.0.0+</version> @@ -2291,7 +2178,6 @@ --> <class stash.storable="true" - jpox.not-persisted-fields="modelEncoding" jpox.table="REPOSITORY_STATS"> <name>RepositoryContentStatistics</name> <version>1.0.0+</version> @@ -2346,41 +2232,37 @@ The number of new files discovered. </description> </field> - <field> + <field jpox.null-value="default"> <name>totalProjectCount</name> - <version>1.0.0+</version> + <version>1.2.0+</version> <identifier>false</identifier> - <required>true</required> <type>long</type> <description> The total number of unique projects in the repository. </description> </field> - <field> + <field jpox.null-value="default"> <name>totalGroupCount</name> - <version>1.0.0+</version> + <version>1.2.0+</version> <identifier>false</identifier> - <required>true</required> <type>long</type> <description> The total number of unique groups in the repository. </description> </field> - <field> + <field jpox.null-value="default"> <name>totalArtifactCount</name> - <version>1.0.0+</version> + <version>1.2.0+</version> <identifier>false</identifier> - <required>true</required> <type>long</type> <description> The total number of artifacts in the repository. </description> </field> - <field> + <field jpox.null-value="default"> <name>totalSize</name> - <version>1.0.0+</version> + <version>1.2.0+</version> <identifier>false</identifier> - <required>true</required> <type>long</type> <description> The total size in bytes of the repository. diff --git a/archiva-modules/archiva-base/archiva-model/src/test/resources/log4j.xml b/archiva-modules/archiva-base/archiva-model/src/test/resources/log4j.xml deleted file mode 100644 index 395941ac3..000000000 --- a/archiva-modules/archiva-base/archiva-model/src/test/resources/log4j.xml +++ /dev/null @@ -1,76 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" ?> -<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> - -<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"> - - <appender name="console" class="org.apache.log4j.ConsoleAppender"> - <param name="Target" value="System.out"/> - <layout class="org.apache.log4j.PatternLayout"> - <param name="ConversionPattern" value="%d [%t] %-5p %-30c{1} - %m%n"/> - </layout> - </appender> - - <!-- Help identify bugs during testing --> - <logger name="org.apache.maven"> - <level value="info"/> - </logger> - - <logger name="org.codehaus.plexus.security"> - <level value="info"/> - </logger> - - <!-- squelch noisy objects (for now) --> - <logger name="org.codehaus.plexus.mailsender.MailSender"> - <level value="info"/> - </logger> - - <logger name="org.quartz"> - <level value="info"/> - </logger> - - <logger name="org.apache.jasper"> - <level value="info"/> - </logger> - - <logger name="com.opensymphony.xwork"> - <level value="info"/> - </logger> - - <logger name="com.opensymphony.webwork"> - <level value="info"/> - </logger> - - <logger name="org.codehaus.plexus.PlexusContainer"> - <level value="info"/> - </logger> - - <logger name="JPOX"> - <level value="warn"/> - </logger> - - <logger name="JPOX.MetaData"> - <level value="error"/> - </logger> - - <logger name="JPOX.RDBMS.SQL"> - <level value="error"/> - </logger> - - <logger name="SQL"> - <level value="error"/> - </logger> - - <logger name="freemarker"> - <level value="warn"/> - </logger> - - <logger name="org.codehaus.plexus.component.manager.ClassicSingletonComponentManager"> - <level value="error"/> - </logger> - - <root> - <priority value ="info" /> - <appender-ref ref="console" /> - </root> - -</log4j:configuration> |