import org.apache.maven.archiva.model.ArchivaArtifact;
import org.apache.maven.archiva.model.ArchivaModelCloner;
import org.apache.maven.archiva.model.ArchivaProjectModel;
+import org.apache.maven.archiva.model.CiManagement;
+import org.apache.maven.archiva.model.IssueManagement;
import org.apache.maven.archiva.model.Keys;
+import org.apache.maven.archiva.model.Organization;
import org.apache.maven.archiva.model.RepositoryProblem;
import org.apache.maven.archiva.reporting.artifact.CorruptArtifactReport;
import org.apache.maven.archiva.repository.ManagedRepositoryContent;
{
model = reader.read( artifactFile );
+ Organization organization = model.getOrganization();
+ if( organization != null )
+ {
+ log.info( "++++ [AfterRead] organization NAME --> " + organization.getName() + " : " + organization.getOrganizationName() );
+ }
+
+ IssueManagement iM = model.getIssueManagement();
+ if( iM != null )
+ {
+ log.info( "++++ [AfterRead] issueMgnt url --> " + iM.getUrl() + " : " + iM.getIssueManagementUrl() );
+ }
+
+ CiManagement ci = model.getCiManagement();
+ if( ci != null )
+ {
+ log.info( "++++ [AfterRead] ci url --> " + ci.getUrl() + " : " + ci.getCiUrl() );
+ }
+
// The version should be updated to the artifact/filename version if it is a unique snapshot
if ( VersionUtil.isUniqueSnapshot( artifact.getVersion() ) )
{
// Resolve the project model (build effective model, resolve expressions)
model = effectiveModelFilter.filter( model );
+
+ organization = model.getOrganization();
+ if( organization != null )
+ {
+ log.info( "++++ [AfterFilter] organization NAME --> " + organization.getName() + " : " + organization.getOrganizationName() );
+ }
+
+ iM = model.getIssueManagement();
+ if( iM != null )
+ {
+ log.info( "++++ [AfterFilter] issueMgnt url --> " + iM.getUrl() + " : " + iM.getIssueManagementUrl() );
+ }
+
+ ci = model.getCiManagement();
+ if( ci != null )
+ {
+ log.info( "++++ [AfterFilter] ci url --> " + ci.getUrl() + " : " + ci.getCiUrl() );
+ }
if ( isValidModel( model, repo, artifact ) )
{
// Clone model, since DAO while detachingCopy resets its contents
// This changes contents of the cache in EffectiveProjectModelFilter
model = ArchivaModelCloner.clone( model );
+
+ organization = model.getOrganization();
+ if( organization != null )
+ {
+ log.info( "++++ [AfterClone] organization NAME --> " + organization.getName() + " : " + organization.getOrganizationName() );
+ }
+
+ iM = model.getIssueManagement();
+ if( iM != null )
+ {
+ log.info( "++++ [AfterClone] issueMgnt url --> " + iM.getUrl() + " : " + iM.getIssueManagementUrl() );
+ }
+
+ ci = model.getCiManagement();
+ if( ci != null )
+ {
+ log.info( "++++ [AfterClone] ci url --> " + ci.getUrl() + " : " + ci.getCiUrl() );
+ }
+
dao.getProjectModelDAO().saveProjectModel( model );
}
else
<groupId>org.codehaus.modello</groupId>
<artifactId>modello-maven-plugin</artifactId>
<configuration>
- <version>1.2.0</version>
+ <version>1.2.1</version>
<packageWithVersion>false</packageWithVersion>
<models>
<model>src/main/mdo/archiva-base.xml</model>
cloned.setSystem( ciManagement.getSystem() );
cloned.setUrl( ciManagement.getUrl() );
+ cloned.setCiUrl( ciManagement.getCiUrl() );
return cloned;
}
IssueManagement cloned = new IssueManagement();
+ cloned.setIssueManagementUrl( issueManagement.getIssueManagementUrl() );
cloned.setSystem( issueManagement.getSystem() );
cloned.setUrl( issueManagement.getUrl() );
cloned.setFavicon( organization.getFavicon() );
cloned.setName( organization.getName() );
cloned.setUrl( organization.getUrl() );
+ cloned.setOrganizationName( organization.getOrganizationName() );
return cloned;
}
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() ) );
xsd.target-namespace="http://archiva.apache.org/model/1.2.0">
<id>archiva-base-model</id>
<name>ArchivaBaseModel</name>
- <version>1.2.0</version>
+ <version>1.2.1</version>
<description>Archiva Model</description>
<defaults>
<default>
<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" 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="250">
<name>url</name>
<version>1.0.0+</version>
<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="250" 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>
<name>url</name>
<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="250" 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>
<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>
merged.setSystem( merge( mainCim.getSystem(), parentCim.getSystem() ) );
merged.setUrl( merge( mainCim.getUrl(), parentCim.getUrl() ) );
+ merged.setCiUrl( merge( mainCim.getCiUrl(), parentCim.getCiUrl() ) );
return merged;
}
merged.setSystem( merge( mainIssueManagement.getSystem(), parentIssueManagement.getSystem() ) );
merged.setUrl( merge( mainIssueManagement.getUrl(), parentIssueManagement.getUrl() ) );
-
+ merged.setIssueManagementUrl( merge( mainIssueManagement.getIssueManagementUrl(), parentIssueManagement.getIssueManagementUrl() ) );
+
return merged;
}
Organization merged = new Organization();
merged.setFavicon( merge( mainOrganization.getFavicon(), parentOrganization.getFavicon() ) );
+ merged.setOrganizationName( merge( mainOrganization.getOrganizationName(), parentOrganization.getOrganizationName() ) );
merged.setName( merge( mainOrganization.getName(), parentOrganization.getName() ) );
merged.setUrl( merge( mainOrganization.getUrl(), parentOrganization.getUrl() ) );
import org.apache.maven.archiva.model.ArchivaModelCloner;
import org.apache.maven.archiva.model.ArchivaProjectModel;
import org.apache.maven.archiva.model.Dependency;
+import org.apache.maven.archiva.model.IssueManagement;
import org.apache.maven.archiva.model.VersionedReference;
import org.apache.maven.archiva.repository.project.ProjectModelException;
import org.apache.maven.archiva.repository.project.ProjectModelFilter;
// Clone submitted project (so that we don't mess with it)
effectiveProject = ArchivaModelCloner.clone( project );
+
+ System.out.println( "++++[EFFECTIVE Project] effectiveProject --> " + effectiveProject );
+ IssueManagement iM = effectiveProject.getIssueManagement();
+ if( iM != null )
+ {
+ System.out.println( "++++[EFFECTIVE Project] issue mgnt URL --> " + iM.getUrl() + " $$ " +
+ iM.getIssueManagementUrl() );
+ }
DEBUG( "Starting build of effective with: " + effectiveProject );
ciManagement.setSystem( eval.expand( ciManagement.getSystem() ) );
ciManagement.setUrl( eval.expand( ciManagement.getUrl() ) );
+ ciManagement.setCiUrl( eval.expand( ciManagement.getCiUrl() ) );
}
private void evaluateDependencyList( ExpressionEvaluator eval, List<Dependency> dependencies )
individual.setOrganization( eval.expand( individual.getOrganization() ) );
individual.setOrganizationUrl( eval.expand( individual.getOrganizationUrl() ) );
individual.setUrl( eval.expand( individual.getUrl() ) );
+ individual.setIndividualEmail( eval.expand( individual.getIndividualEmail() ) );
evaluateProperties( eval, individual.getProperties() );
evaluateStringList( eval, individual.getRoles() );
issueManagement.setSystem( eval.expand( issueManagement.getSystem() ) );
issueManagement.setUrl( eval.expand( issueManagement.getUrl() ) );
+ issueManagement.setIssueManagementUrl( eval.expand( issueManagement.getIssueManagementUrl() ) );
}
private void evaluateLicenses( ExpressionEvaluator eval, List<License> licenses )
return;
}
+ organization.setOrganizationName( eval.expand( organization.getOrganizationName() ) );
organization.setName( eval.expand( organization.getName() ) );
organization.setUrl( eval.expand( organization.getUrl() ) );
organization.setFavicon( eval.expand( organization.getFavicon() ) );
individual.setOrganizationUrl( elemPerson.elementTextTrim( "organizationUrl" ) );
individual.setUrl( elemPerson.elementTextTrim( "url" ) );
individual.setTimezone( elemPerson.elementTextTrim( "timezone" ) );
+ individual.setIndividualEmail( elemPerson.elementTextTrim( "email" ) );
// Roles
Element elemRoles = elemPerson.element( "roles" );
IssueManagement issueMgmt = new IssueManagement();
issueMgmt.setUrl( issueTrackingUrl );
-
+ issueMgmt.setIssueManagementUrl( issueTrackingUrl );
+
return issueMgmt;
}
{
Organization org = new Organization();
+ org.setOrganizationName( elemOrg.elementTextTrim( "name" ) );
org.setName( elemOrg.elementTextTrim( "name" ) );
org.setUrl( elemOrg.elementTextTrim( "url" ) );
// TODO: Handle <logo />
CiManagement ciManagement = new CiManagement();
ciManagement.setSystem( elemCiMgmt.elementTextTrim( "system" ) );
ciManagement.setUrl( elemCiMgmt.elementTextTrim( "url" ) );
+ ciManagement.setCiUrl( elemCiMgmt.elementTextTrim( "url" ) );
return ciManagement;
}
individual.setOrganizationUrl( elemPerson.elementTextTrim( "organizationUrl" ) );
individual.setUrl( elemPerson.elementTextTrim( "url" ) );
individual.setTimezone( elemPerson.elementTextTrim( "timezone" ) );
+ individual.setIndividualEmail( elemPerson.elementTextTrim( "email" ) );
// Roles
Element elemRoles = elemPerson.element( "roles" );
issueMgmt.setSystem( elemIssueMgmt.elementTextTrim( "system" ) );
issueMgmt.setUrl( elemIssueMgmt.elementTextTrim( "url" ) );
-
+ issueMgmt.setIssueManagementUrl( elemIssueMgmt.elementTextTrim( "url" ) );
+
return issueMgmt;
}
{
Organization org = new Organization();
+ org.setOrganizationName( elemOrg.elementTextTrim( "name" ) );
org.setName( elemOrg.elementTextTrim( "name" ) );
org.setUrl( elemOrg.elementTextTrim( "url" ) );
Element elem = root.addElement( "organization" );
+ //addChildElement( elem, "name", organization.getOrganizationName() );
addChildElement( elem, "name", organization.getName() );
addChildElement( elem, "url", organization.getUrl() );
}
}
if ( sharedModel.getIssueManagement() != null && model.getIssueManagement() != null &&
- !StringUtils.equalsIgnoreCase( sharedModel.getIssueManagement().getUrl(), model.getIssueManagement().getUrl() ) )
+ !StringUtils.equalsIgnoreCase( sharedModel.getIssueManagement().getIssueManagementUrl(), model.getIssueManagement().getIssueManagementUrl() ) )
{
sharedModel.setIssueManagement( null );
}
if ( sharedModel.getCiManagement() != null && model.getCiManagement() != null &&
- !StringUtils.equalsIgnoreCase( sharedModel.getCiManagement().getUrl(), model.getCiManagement().getUrl() ) )
+ !StringUtils.equalsIgnoreCase( sharedModel.getCiManagement().getCiUrl(), model.getCiManagement().getCiUrl() ) )
{
sharedModel.setCiManagement( null );
}
if ( sharedModel.getOrganization() != null && model.getOrganization() != null &&
- !StringUtils.equalsIgnoreCase( sharedModel.getOrganization().getName(), model.getOrganization().getName() ) )
+ !StringUtils.equalsIgnoreCase( sharedModel.getOrganization().getOrganizationName(), model.getOrganization().getOrganizationName() ) )
{
sharedModel.setOrganization( null );
}
<td>
<c:choose>
<c:when test="${(sharedModel.organization.url != null) && (!empty sharedModel.organization.url)}">
- <a href="${sharedModel.organization.url}">${sharedModel.organization.name}</a>
+ <a href="${sharedModel.organization.url}">${sharedModel.organization.organizationName}</a>
</c:when>
<c:otherwise>
- ${sharedModel.organization.name}
+ ${sharedModel.organization.organizationName}
</c:otherwise>
</c:choose>
</td>
<th>Issue Tracker</th>
<td>
<c:choose>
- <c:when test="${!empty (sharedModel.issueManagement.url)}">
- <a href="${sharedModel.issueManagement.url}">${sharedModel.issueManagement.system}</a>
+ <c:when test="${!empty (sharedModel.issueManagement.issueManagementUrl)}">
+ <a href="${sharedModel.issueManagement.issueManagementUrl}">${sharedModel.issueManagement.system}</a>
</c:when>
<c:otherwise>
${sharedModel.issueManagement.system}
<th>Continuous Integration</th>
<td>
<c:choose>
- <c:when test="${!empty (sharedModel.ciManagement.url)}">
- <a href="${sharedModel.ciManagement.url}">${sharedModel.ciManagement.system}</a>
+ <c:when test="${!empty (sharedModel.ciManagement.ciUrl)}">
+ <a href="${sharedModel.ciManagement.ciUrl}">${sharedModel.ciManagement.system}</a>
</c:when>
<c:otherwise>
${sharedModel.ciManagement.system}
<td>
<c:choose>
<c:when test="${model.organization != null}">
- <a href="${model.organization.url}">${model.organization.name}</a>
+ <a href="${model.organization.url}">${model.organization.organizationName}</a>
</c:when>
<c:otherwise>
${model.organization.name}
<th>Issue Tracker</th>
<td>
<c:choose>
- <c:when test="${!empty (model.issueManagement.url)}">
- <a href="${model.issueManagement.url}">${model.issueManagement.system}</a>
+ <c:when test="${!empty (model.issueManagement.issueManagementUrl)}">
+ <a href="${model.issueManagement.issueManagementUrl}">${model.issueManagement.system}</a>
</c:when>
<c:otherwise>
${model.issueManagement.system}
<th>Continuous Integration</th>
<td>
<c:choose>
- <c:when test="${!empty (model.ciManagement.url)}">
- <a href="${model.ciManagement.url}">${model.ciManagement.system}</a>
+ <c:when test="${!empty (model.ciManagement.ciUrl)}">
+ <a href="${model.ciManagement.ciUrl}">${model.ciManagement.system}</a>
</c:when>
<c:otherwise>
${model.ciManagement.system}