users@jersey.java.net

[Jersey] Re: Error running simple-service

From: Daniel Trebbien <dtrebbien_at_gmail.com>
Date: Tue, 18 Jun 2013 07:24:03 -0400

Actually, I was wrong about the problem being that the project artifact was not installed into the local Maven cache. The problem is actually that the project was cleaned, so the compiled classes were deleted. mvn install has to first compile the sources, so that's why it appears that mvn install fixes the problem.

You can just run: mvn test exec:java
This won't install the project artifact into the local Maven cache.


On Jun 17, 2013, at 11:40 PM, Kingsley Osime wrote:

> Thanks for your response Daniel. Is there no way we can change this? I also remember reading somewhere on stack the mvn install was a command to be used sparingly?
>
> cheers
>
> From: Daniel Trebbien
> Sent: Tuesday, June 18, 2013 12:31 AM
> To: kingsley osime
> Cc: users_at_jersey.java.net
> Subject: Re: Error running simple-service
>
> Right, the Getting Started guide does not say to do this step, but in my humble opinion it should. Instead of saying to run mvn clean exec:java, I think it should say mvn install exec:java.
>
> I was also following the Getting Started guide precisely when I encountered the "java.lang.ClassNotFoundException: com.example.Main" error. I figured that it was because the simple-service's artifact had not been installed into the local Maven cache yet. mvn install is just something that you are familiar with if you have used Maven before.
>
> Hope that helps,
>
> Daniel
>
>
> On Jun 16, 2013, at 10:08 PM, kingsley osime wrote:
>
>> Hello Daniel,
>>
>> I am trying to follow the jersey user guide precisely and there is nowhere it specifies mvn install before the mvn clean exec:java command.
>>
>> can you please elaborate?
>>
>> Thanks
>
>