Compiler plugin & JDK 9 & classpath/modulepath question

2016-11-09 Thread Matej Novotny
Hello,

I was recently trying the following scenario with JDK 9 and mvn compiler 3.6.0:
A new Maven project, with module-info, running with JDK 9, having a dependency 
on one other non-modular project (Weld SE in this case).
Feel free to inspect it on GH -> https://github.com/manovotn/JDK9Playground

Now compiling this with debug mode showed me that Maven puts the dependency 
onto module-path of the project.
This means JDK 9 will turn this into automatic module.
So I ended up adding entries (`requires` formulas) into module-info.java on the 
one dependency I have there.

I managed to make it compile in the end, but I was wondering about the 
following:
  
 => Is there a way to tell Maven, that I want to add this dependency (and all 
it brings in transitively) to CLASSPATH instead of module path?
  - that would effectively mean there would be no automatic module (so I 
wouldn't need to declare it in module-info) and instead if would "fall back" to 
unnamed module (=searching classpath)

 => Is there a way for Maven to automatically populate your module-info with 
entries regarding automatic modules? Or at least some kind of a detection for 
which ones do I need?


Many thanks
Matej

-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org



Re: maven dependency plugin - build-classpath goal

2016-11-09 Thread Dagan Sandler
Hi,

Can you show your pom and what's the result you're getting?
I have just tested with a sample project and it looks fine:



junit
junit
4.11
sources






org.apache.maven.plugins
maven-dependency-plugin
2.10





Command line: mvn dependency:build-classpath -Dmdep.stripClassifier=true
-Dmdep.prefix=foo
Output:

[INFO] Dependencies classpath:

foo\junit-4.11.jar;foo\hamcrest-core-1.3.jar



On Thu, Nov 3, 2016 at 10:49 AM, LEBOULANGER Aurélien <
aurelien.leboulan...@3ds.com> wrote:

> Hello,
>
> I’m trying to use the maven-dependency plugin (2.10) with the
> build-classpath goal.
> I want to strip the classifier but it’s not work:
>
> mvn dependency:build-classpath -Dmdep.stripClassifier=true
>
> I also add the option -Dmdep.prefix="foo" (needed regarding the
> documentation) but it’s not works too.
>
> Thanks for your help,
>
> --
> Cordialement / Best regards,
> Aurélien
>
> This email and any attachments are intended solely for the use of the
> individual or entity to whom it is addressed and may be confidential and/or
> privileged.
>
> If you are not one of the named recipients or have received this email in
> error,
>
> (i) you should not read, disclose, or copy it,
>
> (ii) please notify sender of your receipt by reply email and delete this
> email and all attachments,
>
> (iii) Dassault Systemes does not accept or assume any liability or
> responsibility for any use of or reliance on this email.
>
> For other languages, go to http://www.3ds.com/terms/email-disclaimer
>


Re: Building WAR files with/without EAR context

2016-11-09 Thread Martin Hoeller
Hi!

On 08 Nov 2016, Clemens von Musil wrote:

> I am working on a multimodule maven project consisting of several EJB, WAR
> and an EAR module. The EJB modules contain shared functionality.
> 
> To increase development speed, I want the WAR modules build in a way that
> allows me to bundle them into the EAR as well as deploy them standalone in
> my EE container.

Wrong approach! Build the WAR as you would need it in standalone-mode and
configure the maven-ear-plugin to make the WAR a skinny war.

Details can be found here:
https://maven.apache.org/plugins/maven-ear-plugin/examples/skinny-wars.html

hth,
- martin


pgp2_fx7oPWiR.pgp
Description: Digitale Signatur von OpenPGP