mirror of https://github.com/apache/archiva.git
[MRM-346]: Show Artifact results in error 500.
git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/trunk@540599 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
6a82d8f370
commit
8e4c990b3b
|
@ -596,7 +596,8 @@
|
||||||
<description>
|
<description>
|
||||||
The snapshot version id.
|
The snapshot version id.
|
||||||
</description>
|
</description>
|
||||||
<association>
|
<association stash.part="true"
|
||||||
|
jpox.join="false">
|
||||||
<type>SnapshotVersion</type>
|
<type>SnapshotVersion</type>
|
||||||
<multiplicity>1</multiplicity>
|
<multiplicity>1</multiplicity>
|
||||||
</association>
|
</association>
|
||||||
|
@ -736,36 +737,29 @@
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<class stash.storable="true"
|
<class stash.storable="true"
|
||||||
jpox.table="PROJECT_REFERENCE"
|
jpox.table="PROJECT_REFERENCE">
|
||||||
jpox.use-identifiers-as-primary-key="false"
|
|
||||||
jpox.identity-type="application"
|
|
||||||
jpox.identity-class="org.apache.maven.archiva.model.jpox.ProjectReferenceKey">
|
|
||||||
<name>ProjectReference</name>
|
<name>ProjectReference</name>
|
||||||
<description>A reference to another (unversioned) Project</description>
|
<description>A reference to another (unversioned) Project</description>
|
||||||
<version>1.0.0+</version>
|
<version>1.0.0+</version>
|
||||||
<fields>
|
<fields>
|
||||||
<field jpox.primary-key="true"
|
<field null-value="default">
|
||||||
jpox.value-strategy="off"
|
|
||||||
jpox.persistence-modifier="persistent">
|
|
||||||
<name>groupId</name>
|
<name>groupId</name>
|
||||||
<identifier>true</identifier>
|
<identifier>false</identifier>
|
||||||
<version>1.0.0+</version>
|
<version>1.0.0+</version>
|
||||||
<type>String</type>
|
<type>String</type>
|
||||||
<required>true</required>
|
<required>true</required>
|
||||||
<description>
|
<description>
|
||||||
The Group ID of the repository content.
|
The Group ID of the project reference.
|
||||||
</description>
|
</description>
|
||||||
</field>
|
</field>
|
||||||
<field jpox.primary-key="true"
|
<field null-value="default">
|
||||||
jpox.value-strategy="off"
|
|
||||||
jpox.persistence-modifier="persistent">
|
|
||||||
<name>artifactId</name>
|
<name>artifactId</name>
|
||||||
<identifier>true</identifier>
|
<identifier>false</identifier>
|
||||||
<version>1.0.0+</version>
|
<version>1.0.0+</version>
|
||||||
<type>String</type>
|
<type>String</type>
|
||||||
<required>true</required>
|
<required>true</required>
|
||||||
<description>
|
<description>
|
||||||
The Artifact ID of the repository content.
|
The Artifact ID of the project reference.
|
||||||
</description>
|
</description>
|
||||||
</field>
|
</field>
|
||||||
</fields>
|
</fields>
|
||||||
|
@ -776,23 +770,42 @@
|
||||||
private static final long serialVersionUID = 8947981859537138991L;
|
private static final long serialVersionUID = 8947981859537138991L;
|
||||||
]]></code>
|
]]></code>
|
||||||
</codeSegment>
|
</codeSegment>
|
||||||
|
<codeSegment>
|
||||||
|
<version>1.0.0+</version>
|
||||||
|
<code><![CDATA[
|
||||||
|
private static String defaultString( String value )
|
||||||
|
{
|
||||||
|
if ( value == null )
|
||||||
|
{
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
return value.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String toKey( ProjectReference reference )
|
||||||
|
{
|
||||||
|
StringBuffer key = new StringBuffer();
|
||||||
|
|
||||||
|
key.append( defaultString( reference.getGroupId() ) ).append( ":" );
|
||||||
|
key.append( defaultString( reference.getArtifactId() ) ).append( ":" );
|
||||||
|
|
||||||
|
return key.toString();
|
||||||
|
}
|
||||||
|
]]></code>
|
||||||
|
</codeSegment>
|
||||||
</codeSegments>
|
</codeSegments>
|
||||||
</class>
|
</class>
|
||||||
|
|
||||||
<class stash.storable="true"
|
<class stash.storable="true"
|
||||||
jpox.table="VERSIONED_REFERENCE"
|
jpox.table="VERSIONED_REFERENCE">
|
||||||
jpox.use-identifiers-as-primary-key="false"
|
|
||||||
jpox.identity-type="application"
|
|
||||||
jpox.identity-class="org.apache.maven.archiva.model.jpox.VersionedReferenceKey">
|
|
||||||
<name>VersionedReference</name>
|
<name>VersionedReference</name>
|
||||||
<description>A reference to another Versioned Project</description>
|
<description>A reference to another Versioned Project</description>
|
||||||
<version>1.0.0+</version>
|
<version>1.0.0+</version>
|
||||||
<fields>
|
<fields>
|
||||||
<field jpox.primary-key="true"
|
<field null-value="default">
|
||||||
jpox.value-strategy="off"
|
|
||||||
jpox.persistence-modifier="persistent">
|
|
||||||
<name>groupId</name>
|
<name>groupId</name>
|
||||||
<identifier>true</identifier>
|
<identifier>false</identifier>
|
||||||
<version>1.0.0+</version>
|
<version>1.0.0+</version>
|
||||||
<type>String</type>
|
<type>String</type>
|
||||||
<required>true</required>
|
<required>true</required>
|
||||||
|
@ -800,11 +813,9 @@
|
||||||
The Group ID of the repository content.
|
The Group ID of the repository content.
|
||||||
</description>
|
</description>
|
||||||
</field>
|
</field>
|
||||||
<field jpox.primary-key="true"
|
<field null-value="default">
|
||||||
jpox.value-strategy="off"
|
|
||||||
jpox.persistence-modifier="persistent">
|
|
||||||
<name>artifactId</name>
|
<name>artifactId</name>
|
||||||
<identifier>true</identifier>
|
<identifier>false</identifier>
|
||||||
<version>1.0.0+</version>
|
<version>1.0.0+</version>
|
||||||
<type>String</type>
|
<type>String</type>
|
||||||
<required>true</required>
|
<required>true</required>
|
||||||
|
@ -812,11 +823,9 @@
|
||||||
The Artifact ID of the repository content.
|
The Artifact ID of the repository content.
|
||||||
</description>
|
</description>
|
||||||
</field>
|
</field>
|
||||||
<field jpox.primary-key="true"
|
<field null-value="default">
|
||||||
jpox.value-strategy="off"
|
|
||||||
jpox.persistence-modifier="persistent">
|
|
||||||
<name>version</name>
|
<name>version</name>
|
||||||
<identifier>true</identifier>
|
<identifier>false</identifier>
|
||||||
<version>1.0.0+</version>
|
<version>1.0.0+</version>
|
||||||
<type>String</type>
|
<type>String</type>
|
||||||
<required>false</required>
|
<required>false</required>
|
||||||
|
@ -832,22 +841,42 @@
|
||||||
private static final long serialVersionUID = -6990353165677563113L;
|
private static final long serialVersionUID = -6990353165677563113L;
|
||||||
]]></code>
|
]]></code>
|
||||||
</codeSegment>
|
</codeSegment>
|
||||||
|
<codeSegment>
|
||||||
|
<version>1.0.0+</version>
|
||||||
|
<code><![CDATA[
|
||||||
|
private static String defaultString( String value )
|
||||||
|
{
|
||||||
|
if ( value == null )
|
||||||
|
{
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
return value.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String toKey( VersionedReference reference )
|
||||||
|
{
|
||||||
|
StringBuffer key = new StringBuffer();
|
||||||
|
|
||||||
|
key.append( defaultString( reference.getGroupId() ) ).append( ":" );
|
||||||
|
key.append( defaultString( reference.getArtifactId() ) ).append( ":" );
|
||||||
|
key.append( defaultString( reference.getVersion() ) ).append( ":" );
|
||||||
|
|
||||||
|
return key.toString();
|
||||||
|
}
|
||||||
|
]]></code>
|
||||||
|
</codeSegment>
|
||||||
</codeSegments>
|
</codeSegments>
|
||||||
</class>
|
</class>
|
||||||
|
|
||||||
<class stash.storable="true"
|
<class stash.storable="true"
|
||||||
jpox.table="ARTIFACT_REFERENCE"
|
jpox.table="ARTIFACT_REFERENCE">
|
||||||
jpox.use-identifiers-as-primary-key="false"
|
|
||||||
jpox.identity-type="application"
|
|
||||||
jpox.identity-class="org.apache.maven.archiva.model.jpox.ArtifactReferenceKey">
|
|
||||||
<name>ArtifactReference</name>
|
<name>ArtifactReference</name>
|
||||||
<version>1.0.0+</version>
|
<version>1.0.0+</version>
|
||||||
<fields>
|
<fields>
|
||||||
<field jpox.primary-key="true"
|
<field null-value="default">
|
||||||
jpox.value-strategy="off"
|
|
||||||
jpox.persistence-modifier="persistent">
|
|
||||||
<name>groupId</name>
|
<name>groupId</name>
|
||||||
<identifier>true</identifier>
|
<identifier>false</identifier>
|
||||||
<version>1.0.0+</version>
|
<version>1.0.0+</version>
|
||||||
<type>String</type>
|
<type>String</type>
|
||||||
<required>true</required>
|
<required>true</required>
|
||||||
|
@ -855,11 +884,9 @@
|
||||||
The Group ID of the repository content.
|
The Group ID of the repository content.
|
||||||
</description>
|
</description>
|
||||||
</field>
|
</field>
|
||||||
<field jpox.primary-key="true"
|
<field null-value="default">
|
||||||
jpox.value-strategy="off"
|
|
||||||
jpox.persistence-modifier="persistent">
|
|
||||||
<name>artifactId</name>
|
<name>artifactId</name>
|
||||||
<identifier>true</identifier>
|
<identifier>false</identifier>
|
||||||
<version>1.0.0+</version>
|
<version>1.0.0+</version>
|
||||||
<type>String</type>
|
<type>String</type>
|
||||||
<required>true</required>
|
<required>true</required>
|
||||||
|
@ -867,11 +894,9 @@
|
||||||
The Artifact ID of the repository content.
|
The Artifact ID of the repository content.
|
||||||
</description>
|
</description>
|
||||||
</field>
|
</field>
|
||||||
<field jpox.primary-key="true"
|
<field null-value="default">
|
||||||
jpox.value-strategy="off"
|
|
||||||
jpox.persistence-modifier="persistent">
|
|
||||||
<name>version</name>
|
<name>version</name>
|
||||||
<identifier>true</identifier>
|
<identifier>false</identifier>
|
||||||
<version>1.0.0+</version>
|
<version>1.0.0+</version>
|
||||||
<type>String</type>
|
<type>String</type>
|
||||||
<required>false</required>
|
<required>false</required>
|
||||||
|
@ -879,11 +904,9 @@
|
||||||
The version of the repository content.
|
The version of the repository content.
|
||||||
</description>
|
</description>
|
||||||
</field>
|
</field>
|
||||||
<field jpox.primary-key="true"
|
<field null-value="default">
|
||||||
jpox.value-strategy="off"
|
|
||||||
jpox.persistence-modifier="persistent">
|
|
||||||
<name>classifier</name>
|
<name>classifier</name>
|
||||||
<identifier>true</identifier>
|
<identifier>false</identifier>
|
||||||
<version>1.0.0+</version>
|
<version>1.0.0+</version>
|
||||||
<type>String</type>
|
<type>String</type>
|
||||||
<required>true</required>
|
<required>true</required>
|
||||||
|
@ -891,12 +914,10 @@
|
||||||
The classifier for this artifact.
|
The classifier for this artifact.
|
||||||
</description>
|
</description>
|
||||||
</field>
|
</field>
|
||||||
<field jpox.primary-key="true"
|
<field null-value="default"
|
||||||
jpox.value-strategy="off"
|
|
||||||
jpox.persistence-modifier="persistent"
|
|
||||||
jpox.column="FILE_TYPE">
|
jpox.column="FILE_TYPE">
|
||||||
<name>type</name>
|
<name>type</name>
|
||||||
<identifier>true</identifier>
|
<identifier>false</identifier>
|
||||||
<version>1.0.0+</version>
|
<version>1.0.0+</version>
|
||||||
<type>String</type>
|
<type>String</type>
|
||||||
<required>true</required>
|
<required>true</required>
|
||||||
|
@ -915,19 +936,25 @@
|
||||||
<codeSegment>
|
<codeSegment>
|
||||||
<version>1.0.0+</version>
|
<version>1.0.0+</version>
|
||||||
<code><![CDATA[
|
<code><![CDATA[
|
||||||
|
private static String defaultString( String value )
|
||||||
|
{
|
||||||
|
if ( value == null )
|
||||||
|
{
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
return value.trim();
|
||||||
|
}
|
||||||
|
|
||||||
public static String toKey( ArtifactReference artifactReference )
|
public static String toKey( ArtifactReference artifactReference )
|
||||||
{
|
{
|
||||||
StringBuffer key = new StringBuffer();
|
StringBuffer key = new StringBuffer();
|
||||||
|
|
||||||
key.append( artifactReference.getGroupId() ).append( ":" );
|
key.append( defaultString( artifactReference.getGroupId() ) ).append( ":" );
|
||||||
key.append( artifactReference.getArtifactId() ).append( ":" );
|
key.append( defaultString( artifactReference.getArtifactId() ) ).append( ":" );
|
||||||
key.append( artifactReference.getVersion() ).append( ":" );
|
key.append( defaultString( artifactReference.getVersion() ) ).append( ":" );
|
||||||
if ( artifactReference.getClassifier() != null )
|
key.append( defaultString( artifactReference.getClassifier() ) ).append( ":" );
|
||||||
{
|
key.append( defaultString( artifactReference.getType() ) );
|
||||||
key.append( artifactReference.getClassifier() );
|
|
||||||
}
|
|
||||||
key.append( ":" );
|
|
||||||
key.append( artifactReference.getType() );
|
|
||||||
|
|
||||||
return key.toString();
|
return key.toString();
|
||||||
}
|
}
|
||||||
|
@ -936,14 +963,10 @@
|
||||||
{
|
{
|
||||||
StringBuffer key = new StringBuffer();
|
StringBuffer key = new StringBuffer();
|
||||||
|
|
||||||
key.append( artifactReference.getGroupId() ).append( ":" );
|
key.append( defaultString( artifactReference.getGroupId() ) ).append( ":" );
|
||||||
key.append( artifactReference.getArtifactId() ).append( ":" );
|
key.append( defaultString( artifactReference.getArtifactId() ) ).append( ":" );
|
||||||
if ( artifactReference.getClassifier() != null )
|
key.append( defaultString( artifactReference.getClassifier() ) ).append( ":" );
|
||||||
{
|
key.append( defaultString( artifactReference.getType() ) );
|
||||||
key.append( artifactReference.getClassifier() );
|
|
||||||
}
|
|
||||||
key.append( ":" );
|
|
||||||
key.append( artifactReference.getType() );
|
|
||||||
|
|
||||||
return key.toString();
|
return key.toString();
|
||||||
}
|
}
|
||||||
|
@ -1010,7 +1033,8 @@
|
||||||
<identifier>false</identifier>
|
<identifier>false</identifier>
|
||||||
<version>1.0.0+</version>
|
<version>1.0.0+</version>
|
||||||
<required>false</required>
|
<required>false</required>
|
||||||
<association>
|
<association stash.part="true"
|
||||||
|
jpox.join="false">
|
||||||
<type>VersionedReference</type>
|
<type>VersionedReference</type>
|
||||||
<multiplicity>1</multiplicity>
|
<multiplicity>1</multiplicity>
|
||||||
</association>
|
</association>
|
||||||
|
@ -1083,7 +1107,8 @@
|
||||||
<identifier>false</identifier>
|
<identifier>false</identifier>
|
||||||
<version>1.0.0+</version>
|
<version>1.0.0+</version>
|
||||||
<required>false</required>
|
<required>false</required>
|
||||||
<association>
|
<association stash.part="true"
|
||||||
|
jpox.join="false">
|
||||||
<type>Organization</type>
|
<type>Organization</type>
|
||||||
</association>
|
</association>
|
||||||
</field>
|
</field>
|
||||||
|
@ -1092,7 +1117,8 @@
|
||||||
<identifier>false</identifier>
|
<identifier>false</identifier>
|
||||||
<version>1.0.0+</version>
|
<version>1.0.0+</version>
|
||||||
<required>false</required>
|
<required>false</required>
|
||||||
<association>
|
<association stash.part="true"
|
||||||
|
jpox.join="false">
|
||||||
<type>License</type>
|
<type>License</type>
|
||||||
<multiplicity>*</multiplicity>
|
<multiplicity>*</multiplicity>
|
||||||
</association>
|
</association>
|
||||||
|
@ -1102,7 +1128,8 @@
|
||||||
<version>1.0.0+</version>
|
<version>1.0.0+</version>
|
||||||
<description>The mailing lists.</description>
|
<description>The mailing lists.</description>
|
||||||
<required>false</required>
|
<required>false</required>
|
||||||
<association>
|
<association stash.part="true"
|
||||||
|
jpox.join="false">
|
||||||
<type>MailingList</type>
|
<type>MailingList</type>
|
||||||
<multiplicity>*</multiplicity>
|
<multiplicity>*</multiplicity>
|
||||||
</association>
|
</association>
|
||||||
|
@ -1111,7 +1138,8 @@
|
||||||
<name>issueManagement</name>
|
<name>issueManagement</name>
|
||||||
<version>1.0.0+</version>
|
<version>1.0.0+</version>
|
||||||
<description><![CDATA[The project's issue management system information.]]></description>
|
<description><![CDATA[The project's issue management system information.]]></description>
|
||||||
<association>
|
<association stash.part="true"
|
||||||
|
jpox.join="false">
|
||||||
<type>IssueManagement</type>
|
<type>IssueManagement</type>
|
||||||
</association>
|
</association>
|
||||||
</field>
|
</field>
|
||||||
|
@ -1119,7 +1147,8 @@
|
||||||
<name>ciManagement</name>
|
<name>ciManagement</name>
|
||||||
<version>1.0.0+</version>
|
<version>1.0.0+</version>
|
||||||
<description><![CDATA[The project's continuous integration information.]]></description>
|
<description><![CDATA[The project's continuous integration information.]]></description>
|
||||||
<association>
|
<association stash.part="true"
|
||||||
|
jpox.join="false">
|
||||||
<type>CiManagement</type>
|
<type>CiManagement</type>
|
||||||
</association>
|
</association>
|
||||||
</field>
|
</field>
|
||||||
|
@ -1128,7 +1157,8 @@
|
||||||
<version>1.0.0+</version>
|
<version>1.0.0+</version>
|
||||||
<description>
|
<description>
|
||||||
<![CDATA[Specification for the SCM used by the project, such as CVS, Subversion, etc.]]></description>
|
<![CDATA[Specification for the SCM used by the project, such as CVS, Subversion, etc.]]></description>
|
||||||
<association>
|
<association stash.part="true"
|
||||||
|
jpox.join="false">
|
||||||
<type>Scm</type>
|
<type>Scm</type>
|
||||||
</association>
|
</association>
|
||||||
</field>
|
</field>
|
||||||
|
@ -1138,7 +1168,8 @@
|
||||||
<description>
|
<description>
|
||||||
The list of individuals around this project.
|
The list of individuals around this project.
|
||||||
</description>
|
</description>
|
||||||
<association>
|
<association stash.part="true"
|
||||||
|
jpox.join="false">
|
||||||
<type>Individual</type>
|
<type>Individual</type>
|
||||||
<multiplicity>*</multiplicity>
|
<multiplicity>*</multiplicity>
|
||||||
</association>
|
</association>
|
||||||
|
@ -1150,7 +1181,8 @@
|
||||||
This element describes all of the dependencies associated with a
|
This element describes all of the dependencies associated with a
|
||||||
project.
|
project.
|
||||||
]]></description>
|
]]></description>
|
||||||
<association>
|
<association stash.part="true"
|
||||||
|
jpox.join="false">
|
||||||
<type>Dependency</type>
|
<type>Dependency</type>
|
||||||
<multiplicity>*</multiplicity>
|
<multiplicity>*</multiplicity>
|
||||||
</association>
|
</association>
|
||||||
|
@ -1161,7 +1193,8 @@
|
||||||
<description>
|
<description>
|
||||||
The list of dependency management settings.
|
The list of dependency management settings.
|
||||||
</description>
|
</description>
|
||||||
<association>
|
<association stash.part="true"
|
||||||
|
jpox.join="false">
|
||||||
<type>Dependency</type>
|
<type>Dependency</type>
|
||||||
<multiplicity>*</multiplicity>
|
<multiplicity>*</multiplicity>
|
||||||
</association>
|
</association>
|
||||||
|
@ -1172,7 +1205,8 @@
|
||||||
<description>
|
<description>
|
||||||
The list project repositories in use by this project.
|
The list project repositories in use by this project.
|
||||||
</description>
|
</description>
|
||||||
<association>
|
<association stash.part="true"
|
||||||
|
jpox.join="false">
|
||||||
<type>ProjectRepository</type>
|
<type>ProjectRepository</type>
|
||||||
<multiplicity>*</multiplicity>
|
<multiplicity>*</multiplicity>
|
||||||
</association>
|
</association>
|
||||||
|
@ -1183,7 +1217,8 @@
|
||||||
<description>
|
<description>
|
||||||
The list of plugins that this project uses.
|
The list of plugins that this project uses.
|
||||||
</description>
|
</description>
|
||||||
<association>
|
<association stash.part="true"
|
||||||
|
jpox.join="false">
|
||||||
<type>ArtifactReference</type>
|
<type>ArtifactReference</type>
|
||||||
<multiplicity>*</multiplicity>
|
<multiplicity>*</multiplicity>
|
||||||
</association>
|
</association>
|
||||||
|
@ -1194,7 +1229,8 @@
|
||||||
<description>
|
<description>
|
||||||
The list of reports that this project uses.
|
The list of reports that this project uses.
|
||||||
</description>
|
</description>
|
||||||
<association>
|
<association stash.part="true"
|
||||||
|
jpox.join="false">
|
||||||
<type>ArtifactReference</type>
|
<type>ArtifactReference</type>
|
||||||
<multiplicity>*</multiplicity>
|
<multiplicity>*</multiplicity>
|
||||||
</association>
|
</association>
|
||||||
|
@ -1205,7 +1241,8 @@
|
||||||
<description>
|
<description>
|
||||||
The list of build extensions that this project uses.
|
The list of build extensions that this project uses.
|
||||||
</description>
|
</description>
|
||||||
<association>
|
<association stash.part="true"
|
||||||
|
jpox.join="false">
|
||||||
<type>ArtifactReference</type>
|
<type>ArtifactReference</type>
|
||||||
<multiplicity>*</multiplicity>
|
<multiplicity>*</multiplicity>
|
||||||
</association>
|
</association>
|
||||||
|
@ -1673,7 +1710,8 @@
|
||||||
Lists a set of artifacts that should be excluded from this dependency's artifact list when it comes to
|
Lists a set of artifacts that should be excluded from this dependency's artifact list when it comes to
|
||||||
calculating transitive dependencies.
|
calculating transitive dependencies.
|
||||||
</description>
|
</description>
|
||||||
<association>
|
<association stash.part="true"
|
||||||
|
jpox.join="false">
|
||||||
<type>Exclusion</type>
|
<type>Exclusion</type>
|
||||||
<multiplicity>*</multiplicity>
|
<multiplicity>*</multiplicity>
|
||||||
</association>
|
</association>
|
||||||
|
|
|
@ -105,6 +105,8 @@ public class ProjectModel400Reader
|
||||||
model.setReports( getReports( xml ) );
|
model.setReports( getReports( xml ) );
|
||||||
model.setProperties( getProperties( xml.getElement( "//project/properties" ) ) );
|
model.setProperties( getProperties( xml.getElement( "//project/properties" ) ) );
|
||||||
|
|
||||||
|
model.setBuildExtensions( getBuildExtensions( xml ) );
|
||||||
|
|
||||||
return model;
|
return model;
|
||||||
}
|
}
|
||||||
catch ( XMLException e )
|
catch ( XMLException e )
|
||||||
|
@ -126,6 +128,31 @@ public class ProjectModel400Reader
|
||||||
return reference;
|
return reference;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get List of {@link ArtifactReference} objects from xpath expr.
|
||||||
|
*/
|
||||||
|
private List getArtifactReferenceList( XMLReader xml, String xpathExpr, String defaultType )
|
||||||
|
throws XMLException
|
||||||
|
{
|
||||||
|
List plugins = new ArrayList();
|
||||||
|
|
||||||
|
Iterator it = xml.getElementList( xpathExpr ).iterator();
|
||||||
|
while ( it.hasNext() )
|
||||||
|
{
|
||||||
|
Element elemPlugin = (Element) it.next();
|
||||||
|
|
||||||
|
plugins.add( getArtifactReference( elemPlugin, defaultType ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
return plugins;
|
||||||
|
}
|
||||||
|
|
||||||
|
private List getBuildExtensions( XMLReader xml )
|
||||||
|
throws XMLException
|
||||||
|
{
|
||||||
|
return getArtifactReferenceList( xml, "//project/build/extensions/extension", "jar" );
|
||||||
|
}
|
||||||
|
|
||||||
private CiManagement getCiManagement( XMLReader xml )
|
private CiManagement getCiManagement( XMLReader xml )
|
||||||
throws XMLException
|
throws XMLException
|
||||||
{
|
{
|
||||||
|
@ -305,6 +332,34 @@ public class ProjectModel400Reader
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private List getLicenses( XMLReader xml )
|
||||||
|
throws XMLException
|
||||||
|
{
|
||||||
|
List licenses = new ArrayList();
|
||||||
|
|
||||||
|
Element elemLicenses = xml.getElement( "//project/licenses" );
|
||||||
|
|
||||||
|
if ( elemLicenses != null )
|
||||||
|
{
|
||||||
|
Iterator itLicense = elemLicenses.elements( "license" ).iterator();
|
||||||
|
while ( itLicense.hasNext() )
|
||||||
|
{
|
||||||
|
Element elemLicense = (Element) itLicense.next();
|
||||||
|
License license = new License();
|
||||||
|
|
||||||
|
// TODO: Create LicenseIdentity class to managed license ids.
|
||||||
|
// license.setId( elemLicense.elementTextTrim("id") );
|
||||||
|
license.setName( elemLicense.elementTextTrim( "name" ) );
|
||||||
|
license.setUrl( elemLicense.elementTextTrim( "url" ) );
|
||||||
|
license.setComments( elemLicense.elementTextTrim( "comments" ) );
|
||||||
|
|
||||||
|
licenses.add( license );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return licenses;
|
||||||
|
}
|
||||||
|
|
||||||
private List getMailingLists( XMLReader xml )
|
private List getMailingLists( XMLReader xml )
|
||||||
throws XMLException
|
throws XMLException
|
||||||
{
|
{
|
||||||
|
@ -343,34 +398,6 @@ public class ProjectModel400Reader
|
||||||
return mailingLists;
|
return mailingLists;
|
||||||
}
|
}
|
||||||
|
|
||||||
private List getLicenses( XMLReader xml )
|
|
||||||
throws XMLException
|
|
||||||
{
|
|
||||||
List licenses = new ArrayList();
|
|
||||||
|
|
||||||
Element elemLicenses = xml.getElement( "//project/licenses" );
|
|
||||||
|
|
||||||
if ( elemLicenses != null )
|
|
||||||
{
|
|
||||||
Iterator itLicense = elemLicenses.elements( "license" ).iterator();
|
|
||||||
while ( itLicense.hasNext() )
|
|
||||||
{
|
|
||||||
Element elemLicense = (Element) itLicense.next();
|
|
||||||
License license = new License();
|
|
||||||
|
|
||||||
// TODO: Create LicenseIdentity class to managed license ids.
|
|
||||||
// license.setId( elemLicense.elementTextTrim("id") );
|
|
||||||
license.setName( elemLicense.elementTextTrim( "name" ) );
|
|
||||||
license.setUrl( elemLicense.elementTextTrim( "url" ) );
|
|
||||||
license.setComments( elemLicense.elementTextTrim( "comments" ) );
|
|
||||||
|
|
||||||
licenses.add( license );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return licenses;
|
|
||||||
}
|
|
||||||
|
|
||||||
private Organization getOrganization( XMLReader xml )
|
private Organization getOrganization( XMLReader xml )
|
||||||
throws XMLException
|
throws XMLException
|
||||||
{
|
{
|
||||||
|
@ -404,26 +431,7 @@ public class ProjectModel400Reader
|
||||||
private List getPlugins( XMLReader xml )
|
private List getPlugins( XMLReader xml )
|
||||||
throws XMLException
|
throws XMLException
|
||||||
{
|
{
|
||||||
return getPlugins( xml, "//project/build/plugins/plugin" );
|
return getArtifactReferenceList( xml, "//project/build/plugins/plugin", "maven-plugin" );
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get List of {@link RepositoryContent} objects from plugin definitions.
|
|
||||||
*/
|
|
||||||
private List getPlugins( XMLReader xml, String xpathExpr )
|
|
||||||
throws XMLException
|
|
||||||
{
|
|
||||||
List plugins = new ArrayList();
|
|
||||||
|
|
||||||
Iterator it = xml.getElementList( xpathExpr ).iterator();
|
|
||||||
while ( it.hasNext() )
|
|
||||||
{
|
|
||||||
Element elemPlugin = (Element) it.next();
|
|
||||||
|
|
||||||
plugins.add( getArtifactReference( elemPlugin, "maven-plugin" ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
return plugins;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private Properties getProperties( Element elemProperties )
|
private Properties getProperties( Element elemProperties )
|
||||||
|
@ -448,7 +456,7 @@ public class ProjectModel400Reader
|
||||||
private List getReports( XMLReader xml )
|
private List getReports( XMLReader xml )
|
||||||
throws XMLException
|
throws XMLException
|
||||||
{
|
{
|
||||||
return getPlugins( xml, "//project/reporting/plugins/plugin" );
|
return getArtifactReferenceList( xml, "//project/reporting/plugins/plugin", "maven-plugin" );
|
||||||
}
|
}
|
||||||
|
|
||||||
private List getRepositories( XMLReader xml )
|
private List getRepositories( XMLReader xml )
|
||||||
|
|
|
@ -19,6 +19,8 @@ package org.apache.maven.archiva.database.jdo;
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import org.apache.commons.beanutils.PropertyUtils;
|
||||||
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.apache.maven.archiva.database.AbstractArchivaDatabaseTestCase;
|
import org.apache.maven.archiva.database.AbstractArchivaDatabaseTestCase;
|
||||||
import org.apache.maven.archiva.database.ProjectModelDAO;
|
import org.apache.maven.archiva.database.ProjectModelDAO;
|
||||||
import org.apache.maven.archiva.model.ArchivaProjectModel;
|
import org.apache.maven.archiva.model.ArchivaProjectModel;
|
||||||
|
@ -26,7 +28,9 @@ import org.apache.maven.archiva.model.jpox.ArchivaProjectModelKey;
|
||||||
import org.apache.maven.archiva.repository.project.ProjectModelReader;
|
import org.apache.maven.archiva.repository.project.ProjectModelReader;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import javax.jdo.JDOHelper;
|
import javax.jdo.JDOHelper;
|
||||||
|
@ -111,7 +115,7 @@ public class JdoProjectModelDAOTest
|
||||||
assertEquals( 0, projectDao.queryProjectModels( null ).size() );
|
assertEquals( 0, projectDao.queryProjectModels( null ).size() );
|
||||||
}
|
}
|
||||||
|
|
||||||
public void disabled_testSaveGetRealProjectModel()
|
public void testSaveGetRealProjectModel()
|
||||||
throws Exception
|
throws Exception
|
||||||
{
|
{
|
||||||
String groupId = "org.apache.maven.shared";
|
String groupId = "org.apache.maven.shared";
|
||||||
|
@ -129,7 +133,12 @@ public class JdoProjectModelDAOTest
|
||||||
ArchivaProjectModel model = modelReader.read( pomFile );
|
ArchivaProjectModel model = modelReader.read( pomFile );
|
||||||
assertNotNull( "Model should not be null.", model );
|
assertNotNull( "Model should not be null.", model );
|
||||||
|
|
||||||
// Fill in missing (mandatory) fields
|
/* NOTE: We are intentionally using a basic project model in this unit test.
|
||||||
|
* The expansion of expressions, resolving of dependencies, and merging
|
||||||
|
* of parent poms is *NOT* performed to keep this unit test simple.
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Fill in mandatory/missing fields
|
||||||
model.setGroupId( groupId );
|
model.setGroupId( groupId );
|
||||||
model.setOrigin( "testcase" );
|
model.setOrigin( "testcase" );
|
||||||
|
|
||||||
|
@ -139,6 +148,39 @@ public class JdoProjectModelDAOTest
|
||||||
assertNotNull( "Project model should not be null.", savedModel );
|
assertNotNull( "Project model should not be null.", savedModel );
|
||||||
|
|
||||||
// Test proper detachment of sub-objects.
|
// Test proper detachment of sub-objects.
|
||||||
assertNotNull( "model.parent != null", savedModel.getParentProject() );
|
List exprs = new ArrayList();
|
||||||
|
exprs.add( "parentProject.groupId" );
|
||||||
|
exprs.add( "organization.name" );
|
||||||
|
exprs.add( "issueManagement.system" );
|
||||||
|
exprs.add( "ciManagement.system" );
|
||||||
|
exprs.add( "scm.url" );
|
||||||
|
exprs.add( "individuals[0].name" );
|
||||||
|
exprs.add( "dependencies[0].groupId" );
|
||||||
|
exprs.add( "dependencyManagement[0].artifactId" );
|
||||||
|
exprs.add( "repositories[0].id" );
|
||||||
|
exprs.add( "plugins[0].artifactId" );
|
||||||
|
exprs.add( "reports[0].artifactId" );
|
||||||
|
exprs.add( "buildExtensions[0].artifactId" );
|
||||||
|
exprs.add( "licenses[0].url" );
|
||||||
|
exprs.add( "mailingLists[0].name" );
|
||||||
|
|
||||||
|
Iterator it = exprs.iterator();
|
||||||
|
while ( it.hasNext() )
|
||||||
|
{
|
||||||
|
String expr = (String) it.next();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Object obj = PropertyUtils.getProperty( model, expr );
|
||||||
|
assertNotNull( "Expr \"" + expr + "\" != null", obj );
|
||||||
|
assertTrue( "Expr \"" + expr + "\" should be a String.", ( obj instanceof String ) );
|
||||||
|
String value = (String) obj;
|
||||||
|
assertTrue( "Expr \"" + expr + "\" value should not be blank.", StringUtils.isNotBlank( value ) );
|
||||||
|
}
|
||||||
|
catch ( IndexOutOfBoundsException e )
|
||||||
|
{
|
||||||
|
fail( "Expr \"" + expr + "\" unable to get indexed property: " + e.getClass().getName() + ": "
|
||||||
|
+ e.getMessage() );
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,7 +39,45 @@
|
||||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/maven/sandbox/maven-shared-jar</developerConnection>
|
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/maven/sandbox/maven-shared-jar</developerConnection>
|
||||||
<url>http://svn.apache.org/viewcvs.cgi/maven/sandbox/maven-shared-jar</url>
|
<url>http://svn.apache.org/viewcvs.cgi/maven/sandbox/maven-shared-jar</url>
|
||||||
</scm>
|
</scm>
|
||||||
|
|
||||||
|
<organization>
|
||||||
|
<name>Apache</name>
|
||||||
|
</organization>
|
||||||
|
|
||||||
|
<issueManagement>
|
||||||
|
<system>jira</system>
|
||||||
|
</issueManagement>
|
||||||
|
|
||||||
|
<ciManagement>
|
||||||
|
<system>continuum</system>
|
||||||
|
</ciManagement>
|
||||||
|
|
||||||
|
<developers>
|
||||||
|
<developer>
|
||||||
|
<id>joakime</id>
|
||||||
|
<email>joakime@apache.org</email>
|
||||||
|
<name>Joakim Erdfelt</name>
|
||||||
|
</developer>
|
||||||
|
</developers>
|
||||||
|
|
||||||
|
<contributors>
|
||||||
|
<contributor>
|
||||||
|
<name>Someone Else</name>
|
||||||
|
</contributor>
|
||||||
|
</contributors>
|
||||||
|
|
||||||
|
<licenses>
|
||||||
|
<license>
|
||||||
|
<url>http://www.apache.org/licenses/LICENSE-2.0</url>
|
||||||
|
</license>
|
||||||
|
</licenses>
|
||||||
|
|
||||||
|
<mailingLists>
|
||||||
|
<mailingList>
|
||||||
|
<name>Shared Mailing List</name>
|
||||||
|
</mailingList>
|
||||||
|
</mailingLists>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
|
@ -65,6 +103,13 @@
|
||||||
</executions>
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
|
<extensions>
|
||||||
|
<extension>
|
||||||
|
<groupId>org.apache.maven.wagon</groupId>
|
||||||
|
<artifactId>wagon-webdav</artifactId>
|
||||||
|
<version>1.0-beta-2</version>
|
||||||
|
</extension>
|
||||||
|
</extensions>
|
||||||
</build>
|
</build>
|
||||||
|
|
||||||
<reporting>
|
<reporting>
|
||||||
|
@ -134,12 +179,21 @@
|
||||||
</snapshots>
|
</snapshots>
|
||||||
</repository>
|
</repository>
|
||||||
</repositories>
|
</repositories>
|
||||||
|
|
||||||
|
<dependencyManagement>
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.maven</groupId>
|
||||||
|
<artifactId>maven-model</artifactId>
|
||||||
|
<version>2.0.5</version>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
</dependencyManagement>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.maven</groupId>
|
<groupId>org.apache.maven</groupId>
|
||||||
<artifactId>maven-model</artifactId>
|
<artifactId>maven-model</artifactId>
|
||||||
<version>2.0.2</version>
|
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue