We need to put an entry in the FAQ: Q: My project compiles in Eclipse and not Maven. Why is Maven broken? A: Eclipse has its own compiler (JDT) that does things differently than Maven (which uses your JDK's javac). Try compiling your project with javac from the JDK and specifying your dependencies with -cp. If this works, then Maven should have no issues compiling it either.
This stuff just makes me love/hate Eclipse even more than I already do... Wayne On 3/24/08, Avi Laviad <[EMAIL PROTECTED]> wrote: > hi, > i think i found the problem. > i tried to compile the .java file with javac and it failed (in eclipse it > was successful). > when i make some change at the .java file and javac worked well then maven > worked well also. > > thanks for your help. > Avi. > > On Mon, Mar 24, 2008 at 12:33 PM, Tim Kettler <[EMAIL PROTECTED]> wrote: > > > Hi, > > > > As Simon guessed, too, I guess it's just a char-set/file-encoding issue. > > Can you go to a plain texteditor available on your platform (notepad, > > gedit, kate, nano ... whatever is available) and create a simple test > > class in src/main/java: > > > > Test.java: > > import com.gigaspaces.*; > > > > public class Test {} > > > > and try if this is compiled by maven. If yes, then it's really just an > > encoding issue. Then just try to delete the import statement from > > App.java and the readd it. > > > > And no, there is no chance that maven tries to compile without your > > specified jar dependency. You can double check by invoking maven with > > debug output enabled 'mvn -X ...' Maven then prints the classpath it's > > using for compilation. > > > > -Tim > > > > Avi Laviad schrieb: > > > ok, thanks for the mailing tip - didn't thought about it. im using > > gmail and > > > it made it automatically. > > > i will keep replying at top for now like you for not having more mess. > > > > > > the error is broken bcuz the command line print it like that. nothing to > > do > > > with the code. > > > > > > the project is compiled fine at Eclipse. > > > i just "mvn install:install-file" the jar i reference to from Eclipse. > > so > > > the files im sure the file i need is there. > > > > > > is there a chance that maven try to compile without this jar? > > > > > > On Mon, Mar 24, 2008 at 10:56 AM, simon <[EMAIL PROTECTED]> > > wrote: > > > > > >> Hi Avi, > > >> > > >> First, when someone replies by adding their comments at the bottom of > > >> the reply email, please do not then add your comments at the top. It's > > >> rude and makes the email hard to read. I'm posting at the top here only > > >> to avoid making things worse. > > >> > > >> The error message looks suspicious: > > >> package com.gigaspace > > >> s does not exist > > >> Is the package-name really being broken across two lines like this? If > > >> so, maybe your import statement has a non-ascii character embedded into > > >> it that is confusing the compiler. > > >> > > >> I suggest also running "jar tf" on the file in the repository, ie under > > >> "~/.m2/repository/gigaspaces/.." and checking that the files you expect > > >> are really in that jar. > > >> > > >> Regards, > > >> > > >> Simon > > >> > > >> On Mon, 2008-03-24 at 10:48 +0200, Avi Laviad wrote: > > >>> well, unfortunely you guessed wrong... im using <dependencies>. > > >>> and the classpath element included my wanted ,jar file. > > >>> > > >>> my pom.xml is: > > >>> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi=" > > >>> http://www.w3.org/2001/XMLSchema-instance" > > >>> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 > > >>> http://maven.apache.org/maven-v4_0_0.xsd"> > > >>> <modelVersion>4.0.0</modelVersion> > > >>> <groupId>com.MyProjectName</groupId> > > >>> <artifactId>MyProjectName</artifactId> > > >>> <packaging>jar</packaging> > > >>> <version>1.0-SNAPSHOT</version> > > >>> <name>MyProjectName</name> > > >>> <url>http://maven.apache.org</url> > > >>> <dependencies> > > >>> <dependency> > > >>> <groupId>gigaspaces</groupId> > > >>> <artifactId>JSpaces</artifactId> > > >>> <version>6.5</version> > > >>> </dependency> > > >>> <dependency> > > >>> <groupId>junit</groupId> > > >>> <artifactId>junit</artifactId> > > >>> <version>3.8.1</version> > > >>> <scope>test</scope> > > >>> </dependency> > > >>> </dependencies> > > >>> </project> > > >>> and the error is: > > >>> [ERROR] BUILD FAILURE > > >>> [INFO] > > >>> > > ------------------------------------------------------------------------ > > >>> [INFO] Compilation failure > > >>> > > C:\Projects\MyProjectName\src\main\java\com\MyProjectName\App.java:[3,0] > > >>> package com.gigaspace > > >>> s does not exist > > >>> > > >>> > > C:\Projects\MyProjectName\src\main\java\com\MyProjectName\App.java:[3,0] > > >>> package com.gigaspace > > >>> s does not exist > > >>> > > >>> [INFO] > > >>> > > ------------------------------------------------------------------------ > > >>> [DEBUG] Trace > > >>> org.apache.maven.BuildFailureException: Compilation failure > > >>> > > C:\Projects\MyProjectName\src\main\java\com\MyProjectName\App.java:[3,0] > > >>> package com.gigaspace > > >>> s does not exist > > >>> Is these details are any help? > > >>> Avi. > > >>> > > >>> > > >>> > > >>> On Sun, Mar 23, 2008 at 9:06 PM, Wendy Smoak <[EMAIL PROTECTED]> wrote: > > >>> > > >>>> On Sun, Mar 23, 2008 at 11:51 AM, Avi Laviad <[EMAIL PROTECTED]> > > >> wrote: > > >>>>> the project is compiled and build successfully when i try it on > > >>>> Eclipse. > > >>>>> the error is "package com.gigaspaces.* does not exist". > > >>>>> I think its compile error because it doesn't find the .jar file it > > >>>> should > > >>>>> reference to - and this is my problem - i added a dependency in the > > >>>>> pom.xmlfor the .jar that i need but it seems that maven ignores it > > >> and > > >>>>> try to compile without it. > > >>>> We need to see more of the pom and the error in order to help. I'll > > >>>> take one more guess... any chance that dependency you posted is > > inside > > >>>> <dependencyManagement> instead of just <dependencies> ? > > >>>> > > >>>> Add -X to the command line and Maven will print out a lot of > > >>>> information, including the classpath. Then you can see if the jar is > > >>>> on the classpath at all. > > >>>> > > >>>> -- > > >>>> Wendy > > >>>> > > >>>> --------------------------------------------------------------------- > > >>>> To unsubscribe, e-mail: [EMAIL PROTECTED] > > >>>> For additional commands, e-mail: [EMAIL PROTECTED] > > >>>> > > >>>> > > >> > > >> --------------------------------------------------------------------- > > >> To unsubscribe, e-mail: [EMAIL PROTECTED] > > >> For additional commands, e-mail: [EMAIL PROTECTED] > > >> > > >> > > > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]