manifest.mf

How to read my META-INF/MANIFEST.MF file in a Spring Boot app?

做~自己de王妃 提交于 2019-11-29 12:25:45
问题 I'm trying to read my META-INF/MANIFEST.MF file from my Spring Boot web app (contained in a jar file). I'm trying the following code: InputStream is = getClass().getResourceAsStream("/META-INF/MANIFEST.MF"); Properties prop = new Properties(); prop.load( is ); But apparently there is something behind the scenes in Spring Boot that a different manifest.mf is loaded (and not my own located in META-INF folder). Does anyone know how I can read my manifest app in my Spring Boot app? UPDATE: After

Apache ant manifest class-path?

谁都会走 提交于 2019-11-29 04:08:39
I have a standard project layout for a java project: project / src / source_file_1.java ... source_file_N.java build / classes / source_file_X.class ... jar / MyJar.jar lib / SomeLibrary.jar SomeOtherLibrary.jar As far as I can tell, I am building the project correctly with Ant. I need to set the class-path attribute in the Manifest file so my classes can use the required libraries. The following relevant information from build.xml <target name="compile" depends="init"> <javac srcdir="src" destdir="build\classes"> <classpath id="classpath"> <fileset dir="lib"> <include name="**/*.jar" /> <

How do you create a MANIFEST.MF that's available when you're testing and running from a jar in production?

ε祈祈猫儿з 提交于 2019-11-29 00:18:00
问题 I've spent far too much time trying to figure this out. This should be the simplest thing and everyone who distributes Java applications in jars must have to deal with it. I just want to know the proper way to add versioning to my Java app so that I can access the version information when I'm testing, e.g. debugging in Eclipse and running from a jar. Here's what I have in my build.xml: <target name="jar" depends = "compile"> <property name="version.num" value="1.0.0"/> <buildnumber file=

Netbeans manifest

可紊 提交于 2019-11-28 23:15:33
问题 Is it possible to add entries to the manifest.mf file of jars generated by netbeans? to build an osgi bundle for instance. 回答1: Note that you can create a manifest on-the-fly via an ant task and set properties dynamically. First, you must update your Netbeans "project.properties" file found in the "nbproject" directory. Add the following line to the file: manifest.file=manifest.mf Next, create an ant task to create/update the manifest using the "build.xml" file. In this example, we will set

manifest.mf is overwritten by eclipse during jar export

与世无争的帅哥 提交于 2019-11-28 08:01:19
问题 I would like make an executable jar archive with eclipse. So into my project I created file src/META-INF/MANIFEST.MF : Manifest-Version: 1.0 Main-Class: MainClass Class-Path: . But when I export my java eclipse project eclipse warn me with following message: "JAR export finished with warnings. See details for additional information. myproject/src/META-INF/MANIFEST.MF was replaced by the generated MANIFEST.MF and is no longer in the JAR." Anyone know how I can avoid this when I export my

Should log4.properties be on the classpath?

耗尽温柔 提交于 2019-11-27 14:28:22
I'm having some problems putting my log4j.properties file on classpath. I can use it when I'm developing (Eclipse Indigo) but, when I export my app as a JAR, I can't. I've made by hand a MANIFEST.MF file for the exported JAR: Manifest-Version: 1.0 Main-Class: main.Program Class-Path: lib/log4j.properties lib/log4j-1.2.15.jar And then with put the JAR on this file organization: folder |-------- app.jar |-------- lib |--------- log4j.properties |--------- log4j-1.2.15.jar When I try to run app.jar, they find log4j.jar but not log4j.properties: log4j:WARN No appenders could be found for logger

reading MANIFEST.MF file from jar file using JAVA

时光怂恿深爱的人放手 提交于 2019-11-27 12:05:50
Is there any way i can read the contents of a jar file. like i want to read the manifest file in order to find the creator of the jar file and version. Is there any way to achieve the same. Next code should help: JarInputStream jarStream = new JarInputStream(stream); Manifest mf = jarStream.getManifest(); Exception handling is left for you :) flash You could use something like this: public static String getManifestInfo() { Enumeration resEnum; try { resEnum = Thread.currentThread().getContextClassLoader().getResources(JarFile.MANIFEST_NAME); while (resEnum.hasMoreElements()) { try { URL url =

How to read MANIFEST.MF file from JAR using Bash

浪子不回头ぞ 提交于 2019-11-27 10:50:22
I need to read MANIFEST.MF maven manifest file from "some.jar" using bash $ unzip -q -c myarchive.jar META-INF/MANIFEST.MF -q will suppress verbose output from the unzip program -c will extract to stdout Example: $ unzip -q -c commons-lang-2.4.jar META-INF/MANIFEST.MF Manifest-Version: 1.0 Ant-Version: Apache Ant 1.7.0 Created-By: 1.5.0_13-119 (Apple Inc.) Package: org.apache.commons.lang Extension-Name: commons-lang Specification-Version: 2.4 Specification-Vendor: Apache Software Foundation Specification-Title: Commons Lang Implementation-Version: 2.4 Implementation-Vendor: Apache Software

Use of the MANIFEST.MF file in Java

◇◆丶佛笑我妖孽 提交于 2019-11-26 19:26:41
I noticed that JAR, WAR and EAR files have a MANIFEST.MF file under the META-INF folder. What is the use of the MANIFEST.MF file? What all things can be specified in this file? The content of the Manifest file in a JAR file created with version 1.0 of the Java Development Kit is the following. Manifest-Version: 1.0 All the entries are as name-value pairs. The name of a header is separated from its value by a colon. The default manifest shows that it conforms to version 1.0 of the manifest specification. The manifest can also contain information about the other files that are packaged in the

Should log4.properties be on the classpath?

此生再无相见时 提交于 2019-11-26 16:45:01
问题 I'm having some problems putting my log4j.properties file on classpath. I can use it when I'm developing (Eclipse Indigo) but, when I export my app as a JAR, I can't. I've made by hand a MANIFEST.MF file for the exported JAR: Manifest-Version: 1.0 Main-Class: main.Program Class-Path: lib/log4j.properties lib/log4j-1.2.15.jar And then with put the JAR on this file organization: folder |-------- app.jar |-------- lib |--------- log4j.properties |--------- log4j-1.2.15.jar When I try to run app