public void visitJarEntry()

in archiva-jarinfo/archiva-jarinfo-lib/src/main/java/org/apache/archiva/jarinfo/analysis/visitors/IdentificationEmbeddedMavenProperties.java [44:88]


    public void visitJarEntry( EntryDetail entry, JarEntry jarEntry )
        throws IOException
    {
        Matcher matcher = MAVEN_POM_FILTER.matcher( jarEntry.getName() );
        if ( !matcher.matches() )
        {
            return;
        }

        Properties props = new Properties();
        props.load( jar.getInputStream( jarEntry ) );

        String groupId = props.getProperty( "groupId" );
        if ( !EmptyUtils.isEmpty( groupId ) )
        {
            if ( performInspection )
            {
                String weightKey = "embedded.pom.groupId";
                details.getInspectedIds().addGroupId( groupId, weights.getWeight( weightKey ), weightKey );
            }
            details.getAssignedId().setGroupId( groupId );
        }

        String artifactId = props.getProperty( "artifactId" );
        if ( !EmptyUtils.isEmpty( artifactId ) )
        {
            if ( performInspection )
            {
                String weightKey = "embedded.pom.artifactId";
                details.getInspectedIds().addArtifactId( artifactId, weights.getWeight( weightKey ), weightKey );
            }
            details.getAssignedId().setArtifactId( artifactId );
        }

        String version = props.getProperty( "version" );
        if ( !EmptyUtils.isEmpty( version ) )
        {
            if ( performInspection )
            {
                String weightKey = "embedded.pom.version";
                details.getInspectedIds().addVersion( version, weights.getWeight( weightKey ), weightKey );
            }
            details.getAssignedId().setVersion( version );
        }
    }