aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--archiva-modules/metadata/metadata-repository-api/src/test/java/org/apache/archiva/metadata/repository/AbstractMetadataRepositoryTest.java137
-rw-r--r--archiva-modules/plugins/metadata-store-file/src/main/java/org/apache/archiva/metadata/repository/file/FileMetadataRepository.java40
2 files changed, 90 insertions, 87 deletions
diff --git a/archiva-modules/metadata/metadata-repository-api/src/test/java/org/apache/archiva/metadata/repository/AbstractMetadataRepositoryTest.java b/archiva-modules/metadata/metadata-repository-api/src/test/java/org/apache/archiva/metadata/repository/AbstractMetadataRepositoryTest.java
index 9c663e516..afaf1f149 100644
--- a/archiva-modules/metadata/metadata-repository-api/src/test/java/org/apache/archiva/metadata/repository/AbstractMetadataRepositoryTest.java
+++ b/archiva-modules/metadata/metadata-repository-api/src/test/java/org/apache/archiva/metadata/repository/AbstractMetadataRepositoryTest.java
@@ -48,7 +48,7 @@ import java.util.List;
import java.util.Map;
@RunWith( SpringJUnit4ClassRunner.class )
-@ContextConfiguration( locations = {"classpath*:/META-INF/spring-context.xml","classpath*:/spring-context.xml"} )
+@ContextConfiguration( locations = { "classpath*:/META-INF/spring-context.xml", "classpath*:/spring-context.xml" } )
public abstract class AbstractMetadataRepositoryTest
extends TestCase
{
@@ -187,8 +187,8 @@ public abstract class AbstractMetadataRepositoryTest
repository.updateArtifact( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, metadata );
- Collection<ArtifactMetadata> artifacts = repository.getArtifacts( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT,
- TEST_PROJECT_VERSION );
+ Collection<ArtifactMetadata> artifacts =
+ repository.getArtifacts( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION );
assertEquals( Collections.singletonList( metadata ), new ArrayList<ArtifactMetadata>( artifacts ) );
// test that namespace, project and project version is also constructed
@@ -198,9 +198,8 @@ public abstract class AbstractMetadataRepositoryTest
assertEquals( TEST_PROJECT, projectMetadata.getId() );
assertEquals( TEST_NAMESPACE, projectMetadata.getNamespace() );
- ProjectVersionMetadata projectVersionMetadata = repository.getProjectVersion( TEST_REPO_ID, TEST_NAMESPACE,
- TEST_PROJECT,
- TEST_PROJECT_VERSION );
+ ProjectVersionMetadata projectVersionMetadata =
+ repository.getProjectVersion( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION );
assertEquals( TEST_PROJECT_VERSION, projectVersionMetadata.getId() );
}
@@ -328,8 +327,9 @@ public abstract class AbstractMetadataRepositoryTest
repository.updateNamespace( TEST_REPO_ID, "namespace" );
repository.updateNamespace( OTHER_REPO_ID, "namespace" );
- assertEquals( Arrays.asList( TEST_REPO_ID, OTHER_REPO_ID ), new ArrayList<String>(
- repository.getRepositories() ) );
+ assertEquals( "repository.getRepositories() -> " + repository.getRepositories(),
+ Arrays.asList( TEST_REPO_ID, OTHER_REPO_ID ),
+ new ArrayList<String>( repository.getRepositories() ) );
}
@Test
@@ -448,8 +448,8 @@ public abstract class AbstractMetadataRepositoryTest
repository.updateArtifact( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, artifactMetadata );
repository.save();
- Collection<ArtifactMetadata> artifacts = repository.getArtifacts( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT,
- TEST_PROJECT_VERSION );
+ Collection<ArtifactMetadata> artifacts =
+ repository.getArtifacts( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION );
assertEquals( Collections.singletonList( artifactMetadata ), new ArrayList<ArtifactMetadata>( artifacts ) );
artifacts = repository.getArtifacts( TEST_REPO_ID );
@@ -478,8 +478,8 @@ public abstract class AbstractMetadataRepositoryTest
metadata.addFacet( facet );
repository.updateArtifact( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, metadata );
- Collection<ArtifactMetadata> artifacts = repository.getArtifacts( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT,
- TEST_PROJECT_VERSION );
+ Collection<ArtifactMetadata> artifacts =
+ repository.getArtifacts( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION );
assertEquals( 1, artifacts.size() );
metadata = artifacts.iterator().next();
assertEquals( Collections.singleton( TEST_FACET_ID ), metadata.getFacetIds() );
@@ -552,8 +552,8 @@ public abstract class AbstractMetadataRepositoryTest
{
repository.addMetadataFacet( TEST_REPO_ID, new TestMetadataFacet( TEST_VALUE ) );
- assertEquals( new TestMetadataFacet( TEST_VALUE ), repository.getMetadataFacet( TEST_REPO_ID, TEST_FACET_ID,
- TEST_NAME ) );
+ assertEquals( new TestMetadataFacet( TEST_VALUE ),
+ repository.getMetadataFacet( TEST_REPO_ID, TEST_FACET_ID, TEST_NAME ) );
}
@Test
@@ -578,9 +578,8 @@ public abstract class AbstractMetadataRepositoryTest
{
repository.addMetadataFacet( TEST_REPO_ID, new TestMetadataFacet( null ) );
- assertEquals( new TestMetadataFacet( TEST_METADATA_VALUE ), repository.getMetadataFacet( TEST_REPO_ID,
- TEST_FACET_ID,
- TEST_NAME ) );
+ assertEquals( new TestMetadataFacet( TEST_METADATA_VALUE ),
+ repository.getMetadataFacet( TEST_REPO_ID, TEST_FACET_ID, TEST_NAME ) );
}
@Test
@@ -596,8 +595,8 @@ public abstract class AbstractMetadataRepositoryTest
{
repository.addMetadataFacet( TEST_REPO_ID, new TestMetadataFacet( TEST_VALUE ) );
- assertEquals( Collections.singletonList( TEST_NAME ), repository.getMetadataFacets( TEST_REPO_ID,
- TEST_FACET_ID ) );
+ assertEquals( Collections.singletonList( TEST_NAME ),
+ repository.getMetadataFacets( TEST_REPO_ID, TEST_FACET_ID ) );
}
@Test
@@ -694,8 +693,8 @@ public abstract class AbstractMetadataRepositoryTest
repository.updateArtifact( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, artifact1 );
repository.updateArtifact( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, artifact2 );
- Collection<ArtifactMetadata> artifacts = repository.getArtifacts( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT,
- TEST_PROJECT_VERSION );
+ Collection<ArtifactMetadata> artifacts =
+ repository.getArtifacts( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION );
ArrayList<ArtifactMetadata> actual = new ArrayList<ArtifactMetadata>( artifacts );
Collections.sort( actual, new Comparator<ArtifactMetadata>()
{
@@ -722,9 +721,8 @@ public abstract class AbstractMetadataRepositoryTest
repository.updateArtifact( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, artifact1 );
repository.updateArtifact( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, artifact2 );
- List<String> versions = new ArrayList<String>( repository.getArtifactVersions( TEST_REPO_ID, TEST_NAMESPACE,
- TEST_PROJECT,
- TEST_PROJECT_VERSION ) );
+ List<String> versions = new ArrayList<String>(
+ repository.getArtifactVersions( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION ) );
Collections.sort( versions );
assertEquals( Arrays.asList( version1, version2 ), versions );
}
@@ -740,10 +738,9 @@ public abstract class AbstractMetadataRepositoryTest
repository.updateArtifact( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, artifact1 );
repository.updateArtifact( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, artifact2 );
- assertEquals( Collections.singleton( TEST_PROJECT_VERSION ), repository.getArtifactVersions( TEST_REPO_ID,
- TEST_NAMESPACE,
- TEST_PROJECT,
- TEST_PROJECT_VERSION ) );
+ assertEquals( Collections.singleton( TEST_PROJECT_VERSION ),
+ repository.getArtifactVersions( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT,
+ TEST_PROJECT_VERSION ) );
}
@Test
@@ -754,8 +751,8 @@ public abstract class AbstractMetadataRepositoryTest
repository.updateArtifact( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, artifact );
repository.save();
- assertEquals( Collections.singletonList( artifact ), repository.getArtifactsByDateRange( TEST_REPO_ID, null,
- null ) );
+ assertEquals( Collections.singletonList( artifact ),
+ repository.getArtifactsByDateRange( TEST_REPO_ID, null, null ) );
}
@Test
@@ -768,8 +765,8 @@ public abstract class AbstractMetadataRepositoryTest
repository.updateArtifact( TEST_REPO_ID, namespace, TEST_PROJECT, TEST_PROJECT_VERSION, artifact );
repository.save();
- assertEquals( Collections.singletonList( artifact ), repository.getArtifactsByDateRange( TEST_REPO_ID, null,
- null ) );
+ assertEquals( Collections.singletonList( artifact ),
+ repository.getArtifactsByDateRange( TEST_REPO_ID, null, null ) );
}
@Test
@@ -781,8 +778,8 @@ public abstract class AbstractMetadataRepositoryTest
repository.save();
Date date = new Date( artifact.getWhenGathered().getTime() - 10000 );
- assertEquals( Collections.singletonList( artifact ), repository.getArtifactsByDateRange( TEST_REPO_ID, date,
- null ) );
+ assertEquals( Collections.singletonList( artifact ),
+ repository.getArtifactsByDateRange( TEST_REPO_ID, date, null ) );
}
@Test
@@ -806,8 +803,8 @@ public abstract class AbstractMetadataRepositoryTest
Date lower = new Date( artifact.getWhenGathered().getTime() - 10000 );
Date upper = new Date( artifact.getWhenGathered().getTime() + 10000 );
- assertEquals( Collections.singletonList( artifact ), repository.getArtifactsByDateRange( TEST_REPO_ID, lower,
- upper ) );
+ assertEquals( Collections.singletonList( artifact ),
+ repository.getArtifactsByDateRange( TEST_REPO_ID, lower, upper ) );
}
@Test
@@ -819,8 +816,8 @@ public abstract class AbstractMetadataRepositoryTest
repository.save();
Date upper = new Date( artifact.getWhenGathered().getTime() + 10000 );
- assertEquals( Collections.singletonList( artifact ), repository.getArtifactsByDateRange( TEST_REPO_ID, null,
- upper ) );
+ assertEquals( Collections.singletonList( artifact ),
+ repository.getArtifactsByDateRange( TEST_REPO_ID, null, upper ) );
}
@Test
@@ -876,10 +873,10 @@ public abstract class AbstractMetadataRepositoryTest
repository.save();
// test it restricts to the appropriate repository
- assertEquals( Collections.singletonList( artifact ), repository.getArtifactsByDateRange( TEST_REPO_ID, null,
- null ) );
- assertEquals( Collections.singletonList( secondArtifact ), repository.getArtifactsByDateRange( OTHER_REPO_ID,
- null, null ) );
+ assertEquals( Collections.singletonList( artifact ),
+ repository.getArtifactsByDateRange( TEST_REPO_ID, null, null ) );
+ assertEquals( Collections.singletonList( secondArtifact ),
+ repository.getArtifactsByDateRange( OTHER_REPO_ID, null, null ) );
}
@Test
@@ -895,14 +892,14 @@ public abstract class AbstractMetadataRepositoryTest
repository.save();
// test it restricts to the appropriate repository
- assertEquals( Collections.singletonList( artifact ), repository.getArtifactsByChecksum( TEST_REPO_ID,
- TEST_SHA1 ) );
- assertEquals( Collections.singletonList( secondArtifact ), repository.getArtifactsByChecksum( OTHER_REPO_ID,
- TEST_SHA1 ) );
- assertEquals( Collections.singletonList( artifact ), repository.getArtifactsByChecksum( TEST_REPO_ID,
- TEST_MD5 ) );
- assertEquals( Collections.singletonList( secondArtifact ), repository.getArtifactsByChecksum( OTHER_REPO_ID,
- TEST_MD5 ) );
+ assertEquals( Collections.singletonList( artifact ),
+ repository.getArtifactsByChecksum( TEST_REPO_ID, TEST_SHA1 ) );
+ assertEquals( Collections.singletonList( secondArtifact ),
+ repository.getArtifactsByChecksum( OTHER_REPO_ID, TEST_SHA1 ) );
+ assertEquals( Collections.singletonList( artifact ),
+ repository.getArtifactsByChecksum( TEST_REPO_ID, TEST_MD5 ) );
+ assertEquals( Collections.singletonList( secondArtifact ),
+ repository.getArtifactsByChecksum( OTHER_REPO_ID, TEST_MD5 ) );
}
@Test
@@ -942,8 +939,8 @@ public abstract class AbstractMetadataRepositoryTest
repository.updateNamespace( TEST_REPO_ID, "org.apache.maven.shared" );
- assertEquals( Collections.singletonList( TEST_PROJECT ), repository.getProjects( TEST_REPO_ID,
- "org.apache.maven" ) );
+ assertEquals( Collections.singletonList( TEST_PROJECT ),
+ repository.getProjects( TEST_REPO_ID, "org.apache.maven" ) );
}
@Test
@@ -962,8 +959,8 @@ public abstract class AbstractMetadataRepositoryTest
List<String> expectedVersions = Collections.singletonList( TEST_PROJECT_VERSION );
assertEquals( expectedVersions, repository.getProjectVersions( TEST_REPO_ID, "org.apache.maven." + TEST_PROJECT,
"other-project" ) );
- assertEquals( expectedVersions, repository.getProjectVersions( TEST_REPO_ID, "org.apache.maven",
- TEST_PROJECT ) );
+ assertEquals( expectedVersions,
+ repository.getProjectVersions( TEST_REPO_ID, "org.apache.maven", TEST_PROJECT ) );
}
@Test
@@ -974,8 +971,8 @@ public abstract class AbstractMetadataRepositoryTest
repository.updateArtifact( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, artifact );
repository.save();
- assertEquals( Collections.singletonList( artifact ), repository.getArtifactsByChecksum( TEST_REPO_ID,
- TEST_MD5 ) );
+ assertEquals( Collections.singletonList( artifact ),
+ repository.getArtifactsByChecksum( TEST_REPO_ID, TEST_MD5 ) );
}
@Test
@@ -986,8 +983,8 @@ public abstract class AbstractMetadataRepositoryTest
repository.updateArtifact( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, artifact );
repository.save();
- assertEquals( Collections.singletonList( artifact ), repository.getArtifactsByChecksum( TEST_REPO_ID,
- TEST_SHA1 ) );
+ assertEquals( Collections.singletonList( artifact ),
+ repository.getArtifactsByChecksum( TEST_REPO_ID, TEST_SHA1 ) );
}
@Test
@@ -1000,10 +997,10 @@ public abstract class AbstractMetadataRepositoryTest
repository.updateArtifact( TEST_REPO_ID, namespace, TEST_PROJECT, TEST_PROJECT_VERSION, artifact );
repository.save();
- assertEquals( Collections.singletonList( artifact ), repository.getArtifactsByChecksum( TEST_REPO_ID,
- TEST_SHA1 ) );
- assertEquals( Collections.singletonList( artifact ), repository.getArtifactsByChecksum( TEST_REPO_ID,
- TEST_MD5 ) );
+ assertEquals( Collections.singletonList( artifact ),
+ repository.getArtifactsByChecksum( TEST_REPO_ID, TEST_SHA1 ) );
+ assertEquals( Collections.singletonList( artifact ),
+ repository.getArtifactsByChecksum( TEST_REPO_ID, TEST_MD5 ) );
}
@Test
@@ -1019,8 +1016,8 @@ public abstract class AbstractMetadataRepositoryTest
repository.updateArtifact( TEST_REPO_ID, TEST_NAMESPACE, newProjectId, TEST_PROJECT_VERSION, artifact2 );
repository.save();
- List<ArtifactMetadata> artifacts = new ArrayList<ArtifactMetadata>( repository.getArtifactsByChecksum(
- TEST_REPO_ID, TEST_SHA1 ) );
+ List<ArtifactMetadata> artifacts =
+ new ArrayList<ArtifactMetadata>( repository.getArtifactsByChecksum( TEST_REPO_ID, TEST_SHA1 ) );
Collections.sort( artifacts, new ArtifactMetadataComparator() );
assertEquals( Arrays.asList( artifact2, artifact1 ), artifacts );
@@ -1049,13 +1046,13 @@ public abstract class AbstractMetadataRepositoryTest
repository.updateArtifact( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, artifact );
- assertEquals( Collections.singletonList( artifact ), new ArrayList<ArtifactMetadata>( repository.getArtifacts(
- TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION ) ) );
+ assertEquals( Collections.singletonList( artifact ), new ArrayList<ArtifactMetadata>(
+ repository.getArtifacts( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION ) ) );
repository.removeArtifact( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, artifact.getId() );
- assertTrue( repository.getArtifacts( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT,
- TEST_PROJECT_VERSION ).isEmpty() );
+ assertTrue(
+ repository.getArtifacts( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION ).isEmpty() );
}
@Test
@@ -1084,8 +1081,8 @@ public abstract class AbstractMetadataRepositoryTest
List<ArtifactMetadata> expected = Arrays.asList( artifact1, artifact2 );
Collections.sort( expected, new ArtifactMetadataComparator() );
- List<ArtifactMetadata> actual = new ArrayList<ArtifactMetadata>( repository.getArtifactsByDateRange(
- TEST_REPO_ID, null, null ) );
+ List<ArtifactMetadata> actual =
+ new ArrayList<ArtifactMetadata>( repository.getArtifactsByDateRange( TEST_REPO_ID, null, null ) );
Collections.sort( actual, new ArtifactMetadataComparator() );
assertEquals( expected, actual );
diff --git a/archiva-modules/plugins/metadata-store-file/src/main/java/org/apache/archiva/metadata/repository/file/FileMetadataRepository.java b/archiva-modules/plugins/metadata-store-file/src/main/java/org/apache/archiva/metadata/repository/file/FileMetadataRepository.java
index bd75b5720..77f3f0abd 100644
--- a/archiva-modules/plugins/metadata-store-file/src/main/java/org/apache/archiva/metadata/repository/file/FileMetadataRepository.java
+++ b/archiva-modules/plugins/metadata-store-file/src/main/java/org/apache/archiva/metadata/repository/file/FileMetadataRepository.java
@@ -37,6 +37,7 @@ import org.apache.archiva.metadata.repository.MetadataRepositoryException;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;
import org.apache.maven.archiva.configuration.ArchivaConfiguration;
+import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -127,8 +128,8 @@ public class FileMetadataRepository
{
updateProject( repoId, namespace, projectId );
- File directory = new File( getDirectory( repoId ),
- namespace + "/" + projectId + "/" + versionMetadata.getId() );
+ File directory =
+ new File( getDirectory( repoId ), namespace + "/" + projectId + "/" + versionMetadata.getId() );
Properties properties = readOrCreateProperties( directory, PROJECT_VERSION_METADATA_KEY );
// remove properties that are not references or artifacts
@@ -332,8 +333,8 @@ public class FileMetadataRepository
Properties properties;
try
{
- properties = readProperties( new File( getMetadataDirectory( repositoryId, facetId ), name ),
- METADATA_KEY );
+ properties =
+ readProperties( new File( getMetadataDirectory( repositoryId, facetId ), name ), METADATA_KEY );
}
catch ( FileNotFoundException e )
{
@@ -368,8 +369,8 @@ public class FileMetadataRepository
try
{
- File directory = new File( getMetadataDirectory( repositoryId, metadataFacet.getFacetId() ),
- metadataFacet.getName() );
+ File directory =
+ new File( getMetadataDirectory( repositoryId, metadataFacet.getFacetId() ), metadataFacet.getName() );
writeProperties( properties, directory, METADATA_KEY );
}
catch ( IOException e )
@@ -515,8 +516,8 @@ public class FileMetadataRepository
String property = (String) key;
if ( property.startsWith( prefix ) )
{
- map.put( property.substring( prefix.length() + 1 ), properties.getProperty(
- property ) );
+ map.put( property.substring( prefix.length() + 1 ),
+ properties.getProperty( property ) );
}
}
facet.fromProperties( map );
@@ -575,7 +576,12 @@ public class FileMetadataRepository
public Collection<String> getRepositories()
{
- return configuration.getConfiguration().getManagedRepositoriesAsMap().keySet();
+ List<String> repositories = new ArrayList<String>();
+ for ( ManagedRepositoryConfiguration managedRepositoryConfiguration : configuration.getConfiguration().getManagedRepositories() )
+ {
+ repositories.add( managedRepositoryConfiguration.getId() );
+ }
+ return repositories;
}
public List<ArtifactMetadata> getArtifactsByChecksum( String repositoryId, String checksum )
@@ -908,14 +914,14 @@ public class FileMetadataRepository
dependency.setArtifactId( dependencyArtifactId );
dependency.setGroupId( properties.getProperty( "dependency." + i + ".groupId" ) );
dependency.setClassifier( properties.getProperty( "dependency." + i + ".classifier" ) );
- dependency.setOptional( Boolean.valueOf( properties.getProperty(
- "dependency." + i + ".optional" ) ) );
+ dependency.setOptional(
+ Boolean.valueOf( properties.getProperty( "dependency." + i + ".optional" ) ) );
dependency.setScope( properties.getProperty( "dependency." + i + ".scope" ) );
dependency.setSystemPath( properties.getProperty( "dependency." + i + ".systemPath" ) );
dependency.setType( properties.getProperty( "dependency." + i + ".type" ) );
dependency.setVersion( properties.getProperty( "dependency." + i + ".version" ) );
- dependency.setOptional( Boolean.valueOf( properties.getProperty(
- "dependency." + i + ".optional" ) ) );
+ dependency.setOptional(
+ Boolean.valueOf( properties.getProperty( "dependency." + i + ".optional" ) ) );
versionMetadata.addDependency( dependency );
}
else
@@ -944,8 +950,8 @@ public class FileMetadataRepository
String property = (String) key;
if ( property.startsWith( facet.getFacetId() ) )
{
- map.put( property.substring( facet.getFacetId().length() + 1 ), properties.getProperty(
- property ) );
+ map.put( property.substring( facet.getFacetId().length() + 1 ),
+ properties.getProperty( property ) );
}
}
facet.fromProperties( map );
@@ -993,8 +999,8 @@ public class FileMetadataRepository
reference.setProjectId( properties.getProperty( "ref:reference." + i + ".projectId" ) );
reference.setNamespace( properties.getProperty( "ref:reference." + i + ".namespace" ) );
reference.setProjectVersion( properties.getProperty( "ref:reference." + i + ".projectVersion" ) );
- reference.setReferenceType( ProjectVersionReference.ReferenceType.valueOf( properties.getProperty(
- "ref:reference." + i + ".referenceType" ) ) );
+ reference.setReferenceType( ProjectVersionReference.ReferenceType.valueOf(
+ properties.getProperty( "ref:reference." + i + ".referenceType" ) ) );
references.add( reference );
}
return references;