Re: Using artifacts as resources in other projects.
Wiadomość napisana przez Jeff MAURY w dniu 2 kwi 2012, o godz. 21:02: > You should probably use the maven assembly plugin Thanks. I'll look on this plugin when come back to that project. Best regards, Mariusz Pluciński
Re: maven-android: core-classes related error during dx
You're right, changing scope to "provided" helped. Thank you very much. Best regards, Mariusz Pluciński Wiadomość napisana przez Manfred Moser w dniu 3 kwi 2012, o godz. 16:28: > You probably forget to give the android jar the provided scope. In general > I would suggest to ask Android/Maven related questions on the Maven > Android Developers mailing list and read the documentation for the Android > Maven Plugin in the book Maven: The Complete Reference and on the website > > In general you will NOT need the core classes argument... unless you are > really supplying another core class implementation (why would you do that? > .. if you need something in java.* or javax.* that is not part of > Android..) which in general should be avoid imho... > > manfred > http://simpligility.com > > http://code.google.com/p/maven-android-plugin/ > http://groups.google.com/group/maven-android-developers > http://www.sonatype.com/books/mvnref-book/reference/android-dev.html > > On Tue, April 3, 2012 7:19 am, Mariusz Plucinski wrote: >> Hi all, >> >> I have another problem with Maven: Android plugins seems to call javac >> and/or dx incorrectly. >> >> After adding Android platform as dependency to Maven project, I am getting >> long message from dx that I am trying to provide own implementation for >> core libraries, and that I should not do it. >> >> [INFO] trouble processing "java/nio/CharBuffer.class": >> [INFO] >> [INFO] Ill-advised or mistaken usage of a core class (java.* or javax.*) >> [INFO] when not building a core library. (…) >> >> I have read that this message appears when one tries to pass android.jar >> to dx (instead of passing it just to javac). As workaround, I have removed >> dependency on Android, and added path to android.jar into >> maven-compiler-plugin configuration: >> >> >> ${env.ANDROID_HOME}/platforms/android-8/android.jar >> >> >> This did the trick and allowed me to build working application. But today, >> another problem appeared: as I've probably completely overwritten >> "-classpath" parameter of javac, maven does not passing it paths to other >> dependencies. In result, I see lot of "package (…) does not exist" and >> "can not find symbol (…)" errors. They are saying about libraries which >> are defined as dependencies. >> >> I was trying to extend "classpath" parameter by adding paths to my >> dependencies manually, but surprisingly, it does not work (and I prefer to >> force maven to do this). Removing "classpath" element make javac >> complaining that "package os.android does not exists". And adding android >> to dependencies moves me to the beginning - dx complains about core >> classes. >> >> Error message informs about "--core-classes" argument which may be passed >> to dx, but may result in "pain, suffering, grief, and lamentation". I've >> checked that maven-android may be configured to pass it. Do you think this >> is safe to use it? I suppose this message should appear when using >> libraries incompatible with Android (as defining core classes is forbidden >> on this platform). If I use the "--core-classes" switch, I will not be >> informed about incompatible libraries, which may cause many troubles in >> the future. >> >> I have no idea how to solve it. I was trying to compile with both >> android.jar from Maven Central repository, and with android.jar from SDK - >> both causes the same error. >> >> Is there any other way to do it, instead of passing "--core-classes" >> argument? >> >> Best regards, >> Mariusz Pluciñski >> >> >> >> >> >> - >> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org >> For additional commands, e-mail: users-h...@maven.apache.org >> > > - > To unsubscribe, e-mail: users-unsubscr...@maven.apache.org > For additional commands, e-mail: users-h...@maven.apache.org >
maven-android: core-classes related error during dx
Hi all, I have another problem with Maven: Android plugins seems to call javac and/or dx incorrectly. After adding Android platform as dependency to Maven project, I am getting long message from dx that I am trying to provide own implementation for core libraries, and that I should not do it. [INFO] trouble processing "java/nio/CharBuffer.class": [INFO] [INFO] Ill-advised or mistaken usage of a core class (java.* or javax.*) [INFO] when not building a core library. (…) I have read that this message appears when one tries to pass android.jar to dx (instead of passing it just to javac). As workaround, I have removed dependency on Android, and added path to android.jar into maven-compiler-plugin configuration: ${env.ANDROID_HOME}/platforms/android-8/android.jar This did the trick and allowed me to build working application. But today, another problem appeared: as I've probably completely overwritten "-classpath" parameter of javac, maven does not passing it paths to other dependencies. In result, I see lot of "package (…) does not exist" and "can not find symbol (…)" errors. They are saying about libraries which are defined as dependencies. I was trying to extend "classpath" parameter by adding paths to my dependencies manually, but surprisingly, it does not work (and I prefer to force maven to do this). Removing "classpath" element make javac complaining that "package os.android does not exists". And adding android to dependencies moves me to the beginning - dx complains about core classes. Error message informs about "--core-classes" argument which may be passed to dx, but may result in "pain, suffering, grief, and lamentation". I've checked that maven-android may be configured to pass it. Do you think this is safe to use it? I suppose this message should appear when using libraries incompatible with Android (as defining core classes is forbidden on this platform). If I use the "--core-classes" switch, I will not be informed about incompatible libraries, which may cause many troubles in the future. I have no idea how to solve it. I was trying to compile with both android.jar from Maven Central repository, and with android.jar from SDK - both causes the same error. Is there any other way to do it, instead of passing "--core-classes" argument? Best regards, Mariusz Pluciński - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Adding Eclipse JAR and source files
Wiadomość napisana przez mike digioia w dniu 3 kwi 2012, o godz. 00:38: > [INFO] skip non existing resourceDirectory > /home/conalab/MikesNewAndroidWork/workspace3/jxwhiteboard_ccn_gohuawei_dist/trunk/src/main/resources I am getting this message during successful builds, so I suppose this is not directly related to your problem. Isn't there any other message before build failure? Best regards, Mariusz Pluciński
Using artifacts as resources in other projects.
Hello Maven users, I am really newbie in Maven, so I am not pretty sure if my way of thinking is right. If it's not, do not hesitate to criticize it. I am developing medium-size project, which contains both Java SE and Android sub-projects. After many troubles with Ant, I've decided to give Maven's a try. To make it simple, let's say that I have three projects: - Android application - Swing application - Main application (also uses Swing, but this is not important now) Those three applications are building pretty well with maven. I am typing "mvn package" and - as expected - I get one *.apk file and two *.jar files. Thanks to maven-shade-plugin, JAR files contains all required dependencies. They are, of course, executable jars. Goal of Main application is to "generate" Swing and Android applications for user's request. Those applications are prebuilt, so Main program needs only to slightly modify it before putting onto user's disk. However, I would like to deliver only one file - Main.jar. Two other files - Android.apk and Swing.jar should be put as entire files inside of Main.jar (they should stay there as full files, without unpacking or anything). This way, when user decided to generate e.g. Swing application, Main application gets whole file Swing.jar from itself, modifies it a little and put somewhere to user's file system. That same is possible in case of generating Android program. But it requires shipping Android.apk and Swing.jar inside of Main.jar. Is it possible to be done using Maven? I suppose that Swing.jar and Android.apk should be provided as resources during build of Main.jar, but I don't know how to instruct Maven to do it this way. I have tried to set compile in maven-jar-plugin configuration in Swing.jar. I suppose it is wrong solution - in compile phase, Main application should already have all required resources. Is there any way to instruct Maven to "package" my Android and Swing projects during "prepare-resources" of Main project? Of course, those two are dependencies, so Main project should be informed, that resources were changed in case of modifications in those two. I am using Maven 3.0.3 and m2e 1.0.200. Thank you in advance for any help/advise/criticism :). Best Regards, Mariusz Pluciński - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org