manifest.mf

mangen adds 'Bundle-ManifestVersion: 1' to manifest, but felix doesn't seem to accept value 1

隐身守侯 提交于 2019-12-25 04:07:24
问题 I've used 'Mangen' to process my jar, which works but it adds the next line to the manifest Bundle-ManifestVersion: 1 after which Felix 1.8.0 complains with -> install file:D:/bundles/osgi_ds_1.jar.new.jar org.osgi.framework.BundleException: Unknown 'Bundle-ManifestVersion' value: 1 at org.apache.felix.framework.util.manifestparser.ManifestParser.<init>(ManifestParser.java:56) If I change the version manually to 2, Felix does install without error. But even if the manifest already contained

How to read manifest.mf from POJO class (not a servlet) instantiated by spring?

拈花ヽ惹草 提交于 2019-12-23 22:55:00
问题 I have a simple service called BuildNumberService which would be instantiated by spring. I'm trying to find the cleanest code for the class to find out the MANIFEST.MF file from the jar file it has been packaged into. The code has to run inside a servlet container. @Service public class BuildNumberService { private static final String IMPLEMENTATION_BUILD = "Implementation-Build"; private String version = null; public BuildNumberService() { // find correct manifest.mf // ????? // then read

ClassPath in manifest does not work

倾然丶 夕夏残阳落幕 提交于 2019-12-23 20:14:03
问题 Structure of files in my jar is: com/my/Main.class META-INF/MANIFEST.MF RXTXcomm.jar Manifest.mf consist: Manifest-Version: 1.0 Main-Class: com.my.Main Class-Path: RXTXcomm.jar (empty line present) When I run my jar as: java -jar my.jar I get: Exception in thread "main" java.lang.NoClassDefFoundError: gnu/io/SerialPortEventListener What is wrong? 回答1: What is wrong? You have packaged the jar dependency inside your main jar. The intention of Class-Path is to add an external jar to the

How do I correctly use SNAPSHOTS dependencies with EARs and EJBs

半城伤御伤魂 提交于 2019-12-23 19:24:37
问题 I am trying to build an EJB in an EAR. My EJB has dependencies on SNAPSHOTS. So when I build the EAR my structure looks like this: my-ear-1.0.0-SNAPSHOT.ear + META-INF - application.xml - MANIFEST.MF - my-ejb-1.0.0-SNAPSHOT.jar - third-party-lib-1.0.0-SNAPSHOT.jar However, when using the maven-ejb-plugin to generate its MANIFEST.MF: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-ejb-plugin</artifactId> <version>2.3</version> <configuration> <archive> <manifest>

Conventions for additional content of the manifest.mf file?

ぐ巨炮叔叔 提交于 2019-12-22 06:59:08
问题 Are there any conventions for the MANIFEST.MF file in a Java JAR beyond the JAR specification? Interesting information I might want to include are: Build date and other build information, SVN Revision, perhaps a description. I haven't found suggestions how to name the corresponding keys. Are there any de facto standards or at least common key names that are used in manifests for things that are not covered by the spec? 回答1: The JAR Manifest: Overview mentions that "Attributes which are not

file not found manifest.mf eclipse

馋奶兔 提交于 2019-12-18 12:47:11
问题 I'm using the following configuration : Eclipse Indigo Maven 2 ClearCase (like SVN and CVS) and every time I want to run an application within eclipse a popup appears telling me that a Problem has occured : File not found : ...\target\classes\META-INF\MANIFEST.MF . 回答1: Go to the root of the project. Wherever the pom is located then try to do a mvn eclipse:clean Then refresh your projects and see where that leaves you 回答2: Right click on project then click on maven then do update project.It

Apache ant manifest class-path?

霸气de小男生 提交于 2019-12-18 04:07:38
问题 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"

“No main manifest attribute” when creating Kotlin jar using IntelliJ IDEA

倖福魔咒の 提交于 2019-12-17 22:01:38
问题 When creating a jar from my Kotlin code and running it, it says "No main manifest attribute". When looking at the manifest.mf, it has this content: Manifest-Version: 1.0 When looking at the file in the source, it has this content: Manifest-Version: 1.0 Main-Class: MyMainClass When manually copying the source manifest to the jar, it runs perfectly. Screenshot of my artifact settings 回答1: If any of the dependent jars has a MANIFEST.MF file, it will override your custom one which defines the

include external jar when running java -jar

老子叫甜甜 提交于 2019-12-17 06:38:38
问题 From my readings, when you execute a command as follows: java -jar foo.jar Then the main classpath is ignored, and the classpath is taken from the manifest file. Further, the classpath declared on the command line is also ignored. So in: java -classpath /usr/local/jar/foobar.jar -jar foo.jar /usr/local/jar/foobar.jar is ignored. Lastly, I have read that the manifest file can only contain relative paths, within the jar file. So, how do you include absolute paths to external jars, that are

Unification of .jar and .jad files in a J2ME application

余生长醉 提交于 2019-12-13 05:36:28
问题 currently, I am developing a J2ME application for mobiles using LWUIT library. The build result of my project includes a .jar file along with a .jad file. I wonder, is there any way to unify these to files into a single .jar file? Why some properties of my application should be mentioned in a single (and simple) .jad file instead of the METAINF/manifest.mf file of the jar file? It really makes the deployment process more difficult. 回答1: There are historical reasons for the separate .jar and