Maven: Packaging dependencies alongside project JAR?

I’ve like Maven to package a project with run-time dependencies. This part is unclear (it’s not exactly what you describe just after). My answer covers what you described. I expect it to create a JAR file with the following manifest (…) Configure the Maven Jar Plugin to do so (or more precisely, the Maven Archiver): … Read more

How do I read the manifest file for a webapp running in apache tomcat?

Maybe your side-effects come from the fact that almost all jars include a MANIFEST.MF and you’re not getting the right one. To read the MANIFEST.MF from the webapp, I would say: ServletContext application = getServletConfig().getServletContext(); InputStream inputStream = application.getResourceAsStream(“/META-INF/MANIFEST.MF”); Manifest manifest = new Manifest(inputStream); Please note that running Tomcat from Eclipse is not the same … Read more

Android / iOS – Custom URI / Protocol Handling

EDIT 5/2014, as this seems to be a popular question I’ve added much detail to the answer: Android: For Android, refer to Intent Filter to Launch My Activity when custom URI is clicked. You use an intent-filter: <intent-filter> <action android:name=”android.intent.action.VIEW” /> <category android:name=”android.intent.category.DEFAULT” /> <category android:name=”android.intent.category.BROWSABLE” /> <data android:scheme=”myapp” /> </intent-filter> this is attached to … Read more

manifest.json vs manifest.webmanifest

There are no big difference rather than naming. Use whichever you prefer: href=”/manifest.webmanifest” or “/manifest.json”. Just don’t forget that MIME type has to be: application/manifest+json in both cases. <link rel=”manifest” href=”/manifest.webmanifest”> <link rel=”manifest” href=”/manifest.json”> Note that spec says it should be manifest.webmanifest. And later it may be important because it is under heavy development. For … Read more

Maven Error: Could not find or load main class

I got this error using Maven, and I discovered the solution. Error: Could not find or load main class com.mycompany.testapifactory.Main I’m using java JDK version 1.7 on Linux, my pom.xml file was the default generated by Netbeans and I was using these commands to compile, which do work fine with a normal hello-world java application: … Read more

Not targeting the latest versions of Android

It says this because of targetSdkVersion=”16″. API 16 is Jellybean 4.1 and 4.1.1, while Jellybean 4.2 is API 17. Try using: <uses-sdk android:minSdkVersion=”8″ android:targetSdkVersion=”17″ /> Also, keep in mind that this is a Lint warning. These warning exist to help you better your code and make it easy to maintain, while being compatible with the … Read more

Reference jars inside a jar

You will need a custom class loader for this, have a look at One Jar. One-JAR lets you package a Java application together with its dependency Jars into a single executable Jar file. It has an ant task which can simplify the building of it as well. REFERENCE (from background) Most developers reasonably assume that … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)