protected ArtifactReference createArtifactReference( String layoutType, String path )
throws Exception
{
BidirectionalRepositoryLayout layout = layoutFactory.getLayout( layoutType );
ArchivaArtifact artifact = layout.toArtifact( path );
ArtifactReference ref = new ArtifactReference();
ref.setGroupId( artifact.getGroupId() );
ref.setArtifactId( artifact.getArtifactId() );
ref.setVersion( artifact.getVersion() );
ref.setClassifier( artifact.getClassifier() );