users@glassfish.java.net

Re: Embedded GlassFish Plugin with ScatteredArchive?

From: Bhavanishankar <bhavanishankara.sapaliga_at_oracle.com>
Date: Mon, 22 Aug 2011 21:35:16 +0530

Hi Magnus Kvalheim,

On 08/22/2011 09:26 PM, Magnus Kvalheim wrote:
> Hi Bhavanishankar,
>
> I have successfully deployed a web application which uses maven structure.
> This is deployed as scattered archive so I would not need to package
> artifact.
>
> /ScatteredArchive archive = new ScatteredArchive("testapp",
> ScatteredArchive.Type.WAR, new File("src/main/webapp"));/
> / archive.addClassPath(new File("target", "classes"));/
>
> When the server is running I have it setup so that I can hit enter in
> eclipse console for reloading.
> I deploy with commands:
> /deployer.deploy(archive.toURI(), "--force=true", "--keepstate=true");/
>
> The problem is that changes to class files are not reflected/redeployed.
I believe the deployment goes fine and you are able to access the app.
But what you are saying is if you change the files under target/classes
later it is not getting reflected when you access the app again. Is my
understanding correct?

_Bhavani.
>
> I'm running this from eclipse and suspect that there could be a
> possible classoading issue when both eclipse and glassfish get in the mix.
> (Classpath is coming from maven and target/classes both resolved by
> eclipse)
>
>
> I think though that it could work better if it would be running as
> a ScatteredArchive from the glassfish plugin - then eclipse build path
> would not interfere...
>
> Do you think it's possible now to make the maven glassfish plugin run
> and deploy a maven project without packaging war artifact
> (ScatteredArchive)?
>
> This would be a huge benefit for us - and I guess anyone that are
> coming from dev cycles with jetty:run
> And I think it would also give the added benefit of resolving
> workspace artifacts - so packaging/install of related projects also
> can be avoided.
>
> best regards
> Magnus Kvalheim
>

-- 
Sun, an Oracle Company