Skip to content

Commit

Permalink
Adds MANIFEST.MF + unit test for manifest file + adjusts pom.xml
Browse files Browse the repository at this point in the history
The pom.xml will use the existing MANIFEST.MF file and just add entries
which are not already given.
  • Loading branch information
RicardoBochnia committed Nov 19, 2014
1 parent b0d3a3a commit e17d91c
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 28 deletions.
4 changes: 4 additions & 0 deletions META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Manifest-Version: 1.0
Implementation-Title: metadata-extractor
Implementation-Version: 2.7.0-SNAPSHOT
Implementation-Vendor: https://drewnoakes.com/code/exif/
31 changes: 31 additions & 0 deletions Tests/com/drew/testing/ManifestTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package com.drew.testing;

import static org.junit.Assert.assertEquals;

import java.io.File;
import java.io.FileInputStream;
import java.util.jar.Manifest;

import org.junit.Assert;
import org.junit.Test;

public class ManifestTest {

@Test
public void testMetadataExtractorVersion() throws Exception
{
FileInputStream stream = new FileInputStream(new File("META-INF/MANIFEST.MF"));
try
{
Assert.assertNotNull(stream);
final Manifest manifest = new Manifest(stream);
Assert.assertNotNull(manifest);
assertEquals("metadata-extractor", manifest.getMainAttributes().getValue("Implementation-Title"));
assertEquals("https://drewnoakes.com/code/exif/", manifest.getMainAttributes().getValue("Implementation-Vendor"));
assertEquals("2.7.0-SNAPSHOT", manifest.getMainAttributes().getValue("Implementation-Version"));
} finally
{
stream.close();
}
}
}
60 changes: 32 additions & 28 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,23 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.sonatype.oss</groupId>
<artifactId>oss-parent</artifactId>
<version>7</version>
</parent>

<groupId>com.drewnoakes</groupId>
<artifactId>metadata-extractor</artifactId>
<version>2.7.0-SNAPSHOT</version>
<packaging>jar</packaging>

<name>metadata-extractor</name>
<description>Java library for extracting EXIF, IPTC, XMP, ICC and other metadata from image files.</description>

<url>https://drewnoakes.com/code/exif/</url>

<issueManagement>
<system>GitHub Issues</system>
<url>https://github.com/drewnoakes/metadata-extractor/issues</url>
</issueManagement>

<mailingLists>
<mailingList>
<name>Announce mailing list</name>
Expand Down Expand Up @@ -64,11 +70,11 @@
<artifactId>xmpcore</artifactId>
<version>5.1.2</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>[14.0,)</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>[14.0,)</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
Expand Down Expand Up @@ -106,34 +112,32 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.0</version>
<configuration>
<source>1.5</source>
<target>1.5</target>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.4</version>
<configuration>
<archive>
<manifestFile>META-INF/MANIFEST.MF</manifestFile>
<manifest>
<addClasspath>true</addClasspath>
</manifest>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
</manifest>
<manifestEntries>
<Implementation-Title>metadata-extractor</Implementation-Title>
<Implementation-Version>${project.version}</Implementation-Version>
<Implementation-Vendor>${project.url}</Implementation-Vendor>
</manifestEntries>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.9</version>
<configuration>
<stylesheetfile>${basedir}/src/main/javadoc/stylesheet.css</stylesheetfile>
<show>public</show>
<windowtitle>metadata-extractor - Javadoc - Extracts Exif, IPTC, XMP, ICC and other metadata from image files</windowtitle>
<windowtitle>metadata-extractor - Javadoc - Extracts Exif, IPTC,
XMP, ICC and other metadata from image files</windowtitle>
<notimestamp>true</notimestamp>
<header><![CDATA[<a href='https://drewnoakes.com/code/exif/' title='Go to the project home page.'><img src='https://raw.githubusercontent.com/drewnoakes/metadata-extractor/master/Resources/metadata-extractor-logo-131x30.png' border="0" alt='Metadata Extractor Logo'></a>]]></header>
<bottom><![CDATA[<i>Copyright &#169; 2002-2014 Drew Noakes. All Rights Reserved.</i>
Expand Down

0 comments on commit e17d91c

Please sign in to comment.