Maven Eclipse Plugin classpathContainer with attributes? - attributes

I can set the classpathContainer parameter in my pom for a configuration of the Maven Eclipse Plugin for the command eclipse:eclipse. If I set:
<classpathContainers>
<classpathContainer>org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk1.6.0_29</classpathContainer>
</classpathContainers>
I get in my .class
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk1.6.0_29"/>
But I need:
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk1.6.0_29">
<attributes>
<attribute name="owner.project.facets" value="java"/>
</attributes>
</classpathentry>
How can I add attributes to the classpathContainer?
Thanks in advance.

Related

adding Parse javadoc to Android Studio

Parse provides docs as external Parse-1.5.1-javadoc folder.
I would like to have Parse javadoc connected within Android Studio. How do I achieve that?
I'm using AndroidStudio 0.6 and parse 1.5.1.
Same problem:
Android Studio: How to attach javadoc
Android issue tracker:
https://code.google.com/p/android/issues/detail?id=59220
Here is the only solution I've found so far:
Open /YourProjectDir/.idea/libraries/Parse_versionCode.xml"
Add the following lines:
<JAVADOC>
<root url="https://www.parse.com/docs/android/api/" />
</JAVADOC>
So it should look something like this:
<component name="libraryTable">
<library name="Parse-1.8.3">
<CLASSES>
<root url="jar://$PROJECT_DIR$/app/libs/Parse-1.8.3.jar!/" /> <!-- check version! -->
</CLASSES>
<JAVADOC>
<root url="https://www.parse.com/docs/android/api/" />
</JAVADOC>
<SOURCES />
</library>
</component>

CruiseControl.NET use project name in project config

Is there any way to use the project name in the project config in CruiseControl.NET ?
I tried ${project.name} based on other posts which doesn't work.
<cruisecontrol xmlns:cb="urn:ccnet.config.builder">
<cb:define BuildArtifactsMainDir="D:\CCNet\BuildArtifacts\"/>
<project name="MyProject">
<artifactDirectory>$(BuildArtifactsMainDir)${project.name}</artifactDirectory>
<tasks>
<exec>
<executable>C:\Windows\System32\robocopy.exe</executable>
<buildArgs>D:\${project.name} F:\${project.name}</buildArgs>
<buildTimeoutSeconds>600</buildTimeoutSeconds>
<successExitCodes>0,1,3,4,8,16</successExitCodes>
</exec>
</tasks>
I don't think there's a parameter for project name. You can use scopes instead.
<cruisecontrol xmlns:cb="urn:ccnet.config.builder">
<cb:define BuildArtifactsMainDir="D:\CCNet\BuildArtifacts\"/>
<cb:scope ProjectName="MyProject">
<project name="$(ProjectName)">
<artifactDirectory>$(BuildArtifactsMainDir)$(ProjectName)</artifactDirectory>
...
</project>
</cb:scope>

j2me emulator error

I am using kemulator to run j2me game (my own developed) when I try to run it i get an error which says "can not find MIDlet class plz check jad or use -midlet param"
Classpath
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="res"/>
<classpathentry kind="con" path="J2MELIB"/>
<classpathentry kind="output" path="bin"/>
</classpath>
There is a package org/rhynn/ and there`s no such thing as a src folder in myGame.jar. I am using Eclipse ME to export this game.
actually there is no res or src folders in that jar. PS : Im new at those Manifest and other (except Java ME) so I dont know what to do.
A j2me application or game must have at least one class that extends MIDlet. Take this class full name, for example, org.rhynn.MyGameMIDlet and pass it to -midlet param.
try using ant and antenna to pack jar file

JavaFx 2.0 application referencing external jars

I'm developing a JavaFx 2.0 application using Netbeans 7.
The main application references another class library project added by rightclicking the 'Libraries' folder and selecting 'Add Project...'. Executing the application from netbeans works fine.
When deploying it to a jar file by 'Clean and build' and trying to execute it via console with
java -jar TestApp.jar
I get
Exception in thread "JavaFX-Launcher" java.lang.NoClassDefFoundError: net/pmoule/SomeClass
...
The dist/lib folder of my application contains the referenced library. So IMHO everything should be fine. Looking at the Manifest.MF contained in my application jar I get this
Manifest-Version: 1.0
Ant-Version: Apache Ant 1.8.2
Created-By: 1.6.0_23-b05 (Sun Microsystems Inc.)
Implementation-Vendor: pmoule
Implementation-Title: TestApp
Implementation-Version: 1.0
Main-Class: com/javafx/main/Main
JavaFX-Application-Class: testapp.TestApp
JavaFX-Version: 2.0
Where is my class path? How do I get Netbeans to add the correct classpath?
I tried adding it manually to the Manifest.MF by editing the one contained in the jar
Manifest-Version: 1.0
Ant-Version: Apache Ant 1.8.2
Created-By: 1.6.0_23-b05 (Sun Microsystems Inc.)
Implementation-Vendor: pmoule
Implementation-Title: TestApp
Implementation-Version: 1.0
Class-Path: lib/MyLib.jar //THIS IS NEW
Main-Class: com/javafx/main/Main
JavaFX-Application-Class: testapp.TestApp
JavaFX-Version: 2.0
No success and same error.
All samples delivered with the JavaFX 2.0 SDK work by doubleclicking in WindowsExplorer or from the console by entering e.g.
java -jar PathAnimation.jar
But not any of these examples makes a reference to an external jar.
Some research lead me to this question: Netbeans JavaFX 2.0 Application
But without any solution so far.
Thanks for any help!
Found a working solution by myself.
All the external libraries in the dist/lin folder had a size of 0kb. So the exception was correct, of course.
To get my application running I did the following in the project's jfx-impl.xml:
Add the classpath to manifest.mf
<fxjar destfile="${jfx.deployment.dir}/${jfx.deployment.jar}" applicationClass="${main.class}" >
<fileset dir="${build.classes.dir}"/>
<manifest>
<attribute name="Implementation-Vendor" value="${application.vendor}"/>
<attribute name="Implementation-Title" value="${application.title}"/>
<!-- NEW --> <attribute name="Class-Path" value="${jar.classpath}"/> <!-- NEW -->
<attribute name="Implementation-Version" value="1.0"/>
</manifest>
</fxjar>
Create an output dir for web deployment
<property name="jfx.deployment.web.dir" location="${jfx.deployment.dir}/web" />
<mkdir dir="${jfx.deployment.web.dir}" />
Set output dir for fxdeploy task
<fxdeploy width="${jfx.applet.width}" height="${jfx.applet.height}"
outdir="${jfx.deployment.web.dir}" <!-- NEW DIR -->
embedJNLP="true"
outfile="${application.title}">
<info title="${application.title}"
vendor="${application.vendor}"/>
<application name="${application.title}"
appclass="${main.class}"/>
<resources type="eager">
<fileset dir="${jfx.deployment.web.dir}"> <!-- NEW DIR -->
<include name="${jfx.deployment.jar}"/>
<include name="lib/*.jar"/>
<exclude name="**/jfxrt.jar"/>
</fileset>
</resources>
</fxdeploy>
Now, I can deploy my desktop application and execute ist via doubleclick from windows explorer or by entering
java -jar TestApp.jar
There still exists some issue with the content of my newly created web-dir.
The TestApp.jar ist not copied zo dist/web
The referenced external jars are not copied to dist/web
This is fine for me and will be fixed some time later.
Hope this helps anyone else.
In Netbeans, under project => properties => Build => Packaging, did you check "Copy Dependent Libraries" ?
You need to tell the fx:jar task what your classpath dependencies are:
<fxjar destfile="${jfx.deployment.dir}/${jfx.deployment.jar}" applicationClass="${main.class}" >
<fileset dir="${build.classes.dir}"/>
<manifest>
<attribute name="Implementation-Vendor" value="${application.vendor}"/>
<attribute name="Implementation-Title" value="${application.title}"/>
<attribute name="Implementation-Version" value="1.0"/>
</manifest>
<!-- Setup the classpath for the generated .jar here -->
<fx:resources>
<fx:fileset type="jar" dir="lib" includes="MyLib.jar"/>
</fx:resources>
</fxjar>
You also need to use fx:resources tag in your fx:deploy task instead of just resources. That should resolve the last two problems left in your answer.

JAXB: how to get sources annotated by #generated by ant task?

Is there a way to pass the option -mark-generated, which is applicable to xjc.bat:
%JAXB_HOME%\bin\xjc.bat -mark-generated c:\TEMP\my.xsd
to the corresponding ant task?
<taskdef name="xjc" classname="com.sun.tools.xjc.XJCTask">
<classpath refid="classpath" />
</taskdef>
<xjc schema="my.xsd" destdir="src" package="gen.example">
<produces dir="src/gen" includes="**/*.java" />
</xjc>
You can pass -mark-generated and other options which are not directly supported in an tag nested under the tag, like this:
<xjc schema="simple.xsd" destdir="src" package="gen.example">
<produces dir="src/gen" includes="**/*.java" />
<arg line="-mark-generated"/>
</xjc>
See the Ant Task reference for details. Happy marshalling!

Resources