Skip to content
This repository has been archived by the owner on Nov 17, 2020. It is now read-only.

WTP war file creation failing #8

Open
martinlippert opened this issue May 31, 2011 · 4 comments
Open

WTP war file creation failing #8

martinlippert opened this issue May 31, 2011 · 4 comments

Comments

@martinlippert
Copy link

The removal of the scala* libs from the maven classpath container seem to cause WTP war file creations to not put those libs into the WEB-INF/lib folder.

As a workaround, you can add the Scala classpath container manually to the deployment assembly list (project preferences), but it would be much nicer to have those libs being added to the war automatically.

@davidB
Copy link
Contributor

davidB commented May 31, 2011

I'm not a WTP's user. you create war with a native WTP action or via "mvn package" (from eclipse) ?

@martinlippert
Copy link
Author

Just by dragging and dropping the project onto the server in the Servers view.

@fbricon
Copy link
Contributor

fbricon commented Sep 3, 2012

Unless Scala IDE requires the Scala Classpath Container, m2e-scala should simply remove it from the project classpath, as all the classpath management should be driven by Maven. Doing so, the WTP integration would just work OOTB (provided m2e-wtp is installed).

If that's not an option, then, what you should do is mark the Scala Classpath Container as deployable in m2e-scala. No need to add a dependency on WTP, m2e-wtp or any other 3rd party features : Check if the Maven Classpath Library has the "org.eclipse.jst.component.dependency" classpath attribute. If it does, then copy it and add it to the Scala Classpath Library too.
You'll end up with :

<classpathentry kind="con" path="org.scala-ide.sdt.launching.SCALA_CONTAINER">
    <attributes>
        <attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
    </attributes>
</classpathentry>

Only problem is it will make all dependencies from that library deployed on WTP servers (*-library, *-dbc, *-swing). If they're not all required at runtime by scala web apps, you should then loop on all individual classpath entries of the Scala Classpath Container. For each jar that must not be deployed (I dunno how you decide that), you add a "org.eclipse.jst.component.nondependency" attribute. See how it's done in m2e-wtp : http://git.eclipse.org/c/m2e-wtp/org.eclipse.m2e.wtp.git/tree/org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/WebProjectConfiguratorDelegate.java#n372

@fbricon
Copy link
Contributor

fbricon commented Sep 4, 2012

I created PR #22 to address the problem.
Currently all the jars from the Scala lib will be deployed, I didn't have time to write all the boilerplate code for specific jar handling.

If you want to test it, a zipped update site is attached to https://issues.jboss.org/browse/JBDS-2259

davidB added a commit that referenced this issue Sep 30, 2012
issue #8 : Add basic WTP support
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants