aboutsummaryrefslogtreecommitdiffstats
path: root/archiva-modules/archiva-base/archiva-consumers/archiva-metadata-consumer
diff options
context:
space:
mode:
authorMartin Stockhammer <martin_s@apache.org>2019-08-04 22:40:04 +0200
committerMartin Stockhammer <martin_s@apache.org>2019-08-04 22:40:04 +0200
commiteca0097d857aa4739a6387c67d22a9a355a46fa1 (patch)
tree48752d7b63424b3e8b2bf47d11a692bfa69a6ff5 /archiva-modules/archiva-base/archiva-consumers/archiva-metadata-consumer
parentee2c1a7b2b623cf76c8a5deff5e8ddb836de2eaa (diff)
downloadarchiva-eca0097d857aa4739a6387c67d22a9a355a46fa1.tar.gz
archiva-eca0097d857aa4739a6387c67d22a9a355a46fa1.zip
Changing session handling for metadata API
Diffstat (limited to 'archiva-modules/archiva-base/archiva-consumers/archiva-metadata-consumer')
-rw-r--r--archiva-modules/archiva-base/archiva-consumers/archiva-metadata-consumer/src/main/java/org/apache/archiva/consumers/metadata/ArchivaMetadataCreationConsumer.java28
1 files changed, 22 insertions, 6 deletions
diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-metadata-consumer/src/main/java/org/apache/archiva/consumers/metadata/ArchivaMetadataCreationConsumer.java b/archiva-modules/archiva-base/archiva-consumers/archiva-metadata-consumer/src/main/java/org/apache/archiva/consumers/metadata/ArchivaMetadataCreationConsumer.java
index 407b2399b..e93b032ac 100644
--- a/archiva-modules/archiva-base/archiva-consumers/archiva-metadata-consumer/src/main/java/org/apache/archiva/consumers/metadata/ArchivaMetadataCreationConsumer.java
+++ b/archiva-modules/archiva-base/archiva-consumers/archiva-metadata-consumer/src/main/java/org/apache/archiva/consumers/metadata/ArchivaMetadataCreationConsumer.java
@@ -138,7 +138,15 @@ public class ArchivaMetadataCreationConsumer
throws ConsumerException
{
- RepositorySession repositorySession = repositorySessionFactory.createSession();
+ RepositorySession repositorySession = null;
+ try
+ {
+ repositorySession = repositorySessionFactory.createSession();
+ }
+ catch ( MetadataRepositoryException e )
+ {
+ e.printStackTrace( );
+ }
try
{
// note that we do minimal processing including checksums and POM information for performance of
@@ -185,14 +193,14 @@ public class ArchivaMetadataCreationConsumer
// read the metadata and update it if it is newer or doesn't exist
artifact.setWhenGathered( whenGathered );
- metadataRepository.updateArtifact( repoId, project.getNamespace(), project.getId(), projectVersion,
- artifact );
+ metadataRepository.updateArtifact( , repoId, project.getNamespace(), project.getId(),
+ projectVersion, artifact );
if ( createVersionMetadata )
{
- metadataRepository.updateProjectVersion( repoId, project.getNamespace(), project.getId(),
- versionMetadata );
+ metadataRepository.updateProjectVersion( , repoId, project.getNamespace(),
+ project.getId(), versionMetadata );
}
- metadataRepository.updateProject( repoId, project );
+ metadataRepository.updateProject( , repoId, project );
repositorySession.save();
}
catch ( MetadataRepositoryException e )
@@ -213,6 +221,14 @@ public class ArchivaMetadataCreationConsumer
{
repositorySession.close();
}
+ catch ( org.apache.archiva.metadata.repository.MetadataSessionException e )
+ {
+ e.printStackTrace( );
+ }
+ catch ( org.apache.archiva.metadata.repository.MetadataSessionException e )
+ {
+ e.printStackTrace( );
+ }
}
@Override