You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Lance Java <la...@googlemail.com> on 2012/06/26 09:35:47 UTC

Eclipse: Can run against maven jar, can't run against local project

I have two maven projects in eclipse using the m2e plugin.

Project A is a component library (jar) which includes a
"Tapestry-Module-Classes" entry in the manifest.
Project B is a webapp which uses Project A.

Case 1:
When I close Project A in eclipse. I am able to run the war (Project B) with
no worries using run-jetty-run. In this case, maven is finding Project A in
my local maven repo.

Case 2:
When Project A is open in eclipse, I can't run Project B. Tapestry does not
load Project A's AppModule and I get exceptions saying that I am
contributing to services which don't exist.

I'm pretty sure Case 1 works because Project A is a jar file and tapestry
can find the manifest (and load the "Tapestry-Module-Classes").

Does anyone have a solution where I can have both projects open in eclipse
and run Project B?

At the moment my workflow is this:
1. Make changes in Project A in eclipse
2. Close Project A in eclipse
3. mvn install (Project A)
4. Run Project B in eclipse

It's pretty annoying.

--
View this message in context: http://tapestry.1045711.n5.nabble.com/Eclipse-Can-run-against-maven-jar-can-t-run-against-local-project-tp5714087.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Eclipse: Can run against maven jar, can't run against local project

Posted by Kalle Korhonen <ka...@gmail.com>.
On Tue, Jun 26, 2012 at 12:00 PM, Lance Java <la...@googlemail.com> wrote:
>> if it's your own application, what's the point of avoiding @SubModule
> I wasn't sure what would happen when running against a jar. Would the
> submodule be loaded twice? (once for @SubModule, once for manifest)

No, that's all good.

Kalle

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Eclipse: Can run against maven jar, can't run against local project

Posted by Lance Java <la...@googlemail.com>.
> if it's your own application, what's the point of avoiding @SubModule
I wasn't sure what would happen when running against a jar. Would the
submodule be loaded twice? (once for @SubModule, once for manifest)

--
View this message in context: http://tapestry.1045711.n5.nabble.com/Eclipse-Can-run-against-maven-jar-can-t-run-against-local-project-tp5714087p5714102.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Eclipse: Can run against maven jar, can't run against local project

Posted by Kalle Korhonen <ka...@gmail.com>.
On Tue, Jun 26, 2012 at 2:04 AM, Lance Java <la...@googlemail.com> wrote:
> I thought of this approach but I'd be scared that I'd accidentally commit the
> change to git (which I would never want to do).

I use @SubModule regularly exactly for the case when both the library
and the application is in active development at the same time.
Especially if it's your own application, what's the point of avoiding
@SubModule? As an alternative, I suppose you could also create a
static META-INF/manifest.mf under the src/test/resources directory,
that might work for Eclipse.

Kalle

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


RE: Eclipse: Can run against maven jar, can't run against local project

Posted by Lance Java <la...@googlemail.com>.
I thought of this approach but I'd be scared that I'd accidentally commit the
change to git (which I would never want to do).

--
View this message in context: http://tapestry.1045711.n5.nabble.com/Eclipse-Can-run-against-maven-jar-can-t-run-against-local-project-tp5714087p5714090.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


RE: Eclipse: Can run against maven jar, can't run against local project

Posted by Guerin Laurent <lg...@sopragroup.com>.
Hi Lance, 
you can link your component lib module with you webapp with @SubModule annotation.

For example, in your AppModule of your webapp, add :

@SubModule(MyLibraryModule.class)
public class AppModule

>From the documentation : @SubModule
Attached to a module class, this annotation identifies other module classes that should also be added to the Registry. This is often easier than updating the JAR Manifest.

Laurent.


-----Message d'origine-----
De : Lance Java [mailto:lance.java@googlemail.com] 
Envoyé : mardi 26 juin 2012 10:31
À : users@tapestry.apache.org
Objet : Re: Eclipse: Can run against maven jar, can't run against local project

I have a workaround which is to use a system property -Dtapestry.modules=foo.bar.MyModule

I'd prefer it if tapestry could find my manifest file (located in
src/main/resources/META_INF/MANIFEST.MF)

--
View this message in context: http://tapestry.1045711.n5.nabble.com/Eclipse-Can-run-against-maven-jar-can-t-run-against-local-project-tp5714087p5714088.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Eclipse: Can run against maven jar, can't run against local project

Posted by Lance Java <la...@googlemail.com>.
I have a workaround which is to use a system property
-Dtapestry.modules=foo.bar.MyModule

I'd prefer it if tapestry could find my manifest file (located in
src/main/resources/META_INF/MANIFEST.MF)

--
View this message in context: http://tapestry.1045711.n5.nabble.com/Eclipse-Can-run-against-maven-jar-can-t-run-against-local-project-tp5714087p5714088.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org