Re: Failed to init Classpath for jar file C:\apache-maven-3.9.6\boot\plexus-classworlds.license during compilation

2024-03-01 Thread Tamás Cservenák
Howdy,

Can you post debug output how the compiler plugin is invoked?

Also, looks related:
https://github.com/eclipse-jdt/eclipse.jdt.core/issues/1578

T

On Fri, Mar 1, 2024 at 10:37 AM Václav Haisman  wrote:

> I am getting the following error during build with Maven 3.9.6 and Java 21.
> The effective POM part for the compiler plugin is below the exception
> trace. Is this a known issue?
>
> [INFO] --- compiler:3.12.1:compile (default-compile) @ apmservices.artemis
> ---
> [INFO] Recompiling the module because of changed source code.
> [INFO] Compiling with eclipse [debug:lines,vars,source parameters release
> 21] to target\classes
> *Failed to init Classpath for jar file
> C:\apache-maven-3.9.6\boot\plexus-classworlds.license*
> java.util.zip.ZipException: zip END header not found
> at java.base/java.util.zip.ZipFile$Source.findEND(ZipFile.java:1649)
> at java.base/java.util.zip.ZipFile$Source.initCEN(ZipFile.java:1657)
> at java.base/java.util.zip.ZipFile$Source.(ZipFile.java:1495)
> at java.base/java.util.zip.ZipFile$Source.get(ZipFile.java:1458)
> at
> java.base/java.util.zip.ZipFile$CleanableResource.(ZipFile.java:724)
> at java.base/java.util.zip.ZipFile.(ZipFile.java:251)
> at java.base/java.util.zip.ZipFile.(ZipFile.java:180)
> at java.base/java.util.zip.ZipFile.(ZipFile.java:194)
> at
>
> org.eclipse.jdt.internal.compiler.batch.ClasspathJar.initialize(ClasspathJar.java:204)
> at
>
> org.eclipse.jdt.internal.compiler.batch.ClasspathMultiReleaseJar.initialize(ClasspathMultiReleaseJar.java:38)
> at
>
> org.eclipse.jdt.internal.compiler.batch.FileSystem.(FileSystem.java:233)
> at
>
> org.eclipse.jdt.internal.compiler.batch.Main.getLibraryAccess(Main.java:3480)
> at
>
> org.eclipse.jdt.internal.compiler.batch.Main.performCompilation(Main.java:4726)
> at
>
> org.eclipse.jdt.internal.compiler.tool.EclipseCompilerImpl.call(EclipseCompilerImpl.java:101)
> at
>
> org.eclipse.jdt.internal.compiler.tool.EclipseCompiler$1.call(EclipseCompiler.java:196)
> at
>
> org.codehaus.plexus.compiler.eclipse.EclipseJavaCompiler.performCompile(EclipseJavaCompiler.java:307)
> at
>
> org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:1188)
> at
>
> org.apache.maven.plugin.compiler.CompilerMojo.execute(CompilerMojo.java:212)
> at
>
> org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:126)
> at
>
> org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2(MojoExecutor.java:328)
> at
>
> org.apache.maven.lifecycle.internal.MojoExecutor.doExecute(MojoExecutor.java:316)
> at
>
> org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
> at
>
> org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:174)
> at
>
> org.apache.maven.lifecycle.internal.MojoExecutor.access$000(MojoExecutor.java:75)
> at
>
> org.apache.maven.lifecycle.internal.MojoExecutor$1.run(MojoExecutor.java:162)
> at
>
> org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute(DefaultMojosExecutionStrategy.java:39)
> at
>
> org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:159)
> at
>
> org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:105)
> at
>
> org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:73)
> at
>
> org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:53)
> at
>
> org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:118)
> at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:261)
> at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:173)
> at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:101)
> at org.apache.maven.cli.MavenCli.execute(MavenCli.java:906)
> at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:283)
> at org.apache.maven.cli.MavenCli.main(MavenCli.java:206)
> at
>
> java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
> at java.base/java.lang.reflect.Method.invoke(Method.java:580)
> at
>
> org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:283)
> at
> org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:226)
> at
>
> org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:407)
> at
> org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:348)
> at org.codehaus.classworlds.Launcher.main(Launcher.java:47)
>
> Effective POM section:
>
>   
> maven-compiler-plugin
> 3.12

Failed to init Classpath for jar file C:\apache-maven-3.9.6\boot\plexus-classworlds.license during compilation

2024-03-01 Thread Václav Haisman
I am getting the following error during build with Maven 3.9.6 and Java 21.
The effective POM part for the compiler plugin is below the exception
trace. Is this a known issue?

[INFO] --- compiler:3.12.1:compile (default-compile) @ apmservices.artemis
---
[INFO] Recompiling the module because of changed source code.
[INFO] Compiling with eclipse [debug:lines,vars,source parameters release
21] to target\classes
*Failed to init Classpath for jar file
C:\apache-maven-3.9.6\boot\plexus-classworlds.license*
java.util.zip.ZipException: zip END header not found
at java.base/java.util.zip.ZipFile$Source.findEND(ZipFile.java:1649)
at java.base/java.util.zip.ZipFile$Source.initCEN(ZipFile.java:1657)
at java.base/java.util.zip.ZipFile$Source.(ZipFile.java:1495)
at java.base/java.util.zip.ZipFile$Source.get(ZipFile.java:1458)
at
java.base/java.util.zip.ZipFile$CleanableResource.(ZipFile.java:724)
at java.base/java.util.zip.ZipFile.(ZipFile.java:251)
at java.base/java.util.zip.ZipFile.(ZipFile.java:180)
at java.base/java.util.zip.ZipFile.(ZipFile.java:194)
at
org.eclipse.jdt.internal.compiler.batch.ClasspathJar.initialize(ClasspathJar.java:204)
at
org.eclipse.jdt.internal.compiler.batch.ClasspathMultiReleaseJar.initialize(ClasspathMultiReleaseJar.java:38)
at
org.eclipse.jdt.internal.compiler.batch.FileSystem.(FileSystem.java:233)
at
org.eclipse.jdt.internal.compiler.batch.Main.getLibraryAccess(Main.java:3480)
at
org.eclipse.jdt.internal.compiler.batch.Main.performCompilation(Main.java:4726)
at
org.eclipse.jdt.internal.compiler.tool.EclipseCompilerImpl.call(EclipseCompilerImpl.java:101)
at
org.eclipse.jdt.internal.compiler.tool.EclipseCompiler$1.call(EclipseCompiler.java:196)
at
org.codehaus.plexus.compiler.eclipse.EclipseJavaCompiler.performCompile(EclipseJavaCompiler.java:307)
at
org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:1188)
at
org.apache.maven.plugin.compiler.CompilerMojo.execute(CompilerMojo.java:212)
at
org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:126)
at
org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2(MojoExecutor.java:328)
at
org.apache.maven.lifecycle.internal.MojoExecutor.doExecute(MojoExecutor.java:316)
at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:174)
at
org.apache.maven.lifecycle.internal.MojoExecutor.access$000(MojoExecutor.java:75)
at
org.apache.maven.lifecycle.internal.MojoExecutor$1.run(MojoExecutor.java:162)
at
org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute(DefaultMojosExecutionStrategy.java:39)
at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:159)
at
org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:105)
at
org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:73)
at
org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:53)
at
org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:118)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:261)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:173)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:101)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:906)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:283)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:206)
at
java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
at
org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:283)
at
org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:226)
at
org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:407)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:348)
at org.codehaus.classworlds.Launcher.main(Launcher.java:47)

Effective POM section:

  
maven-compiler-plugin
3.12.1

  
default-compile
compile

  compile


  21
  21
  21
  eclipse
  true
  true
  lines,vars,source
  
-properties

${settings.localRepository}/com/ca/apm/binaries/jdt.core.prefs/1.0.2/jdt.core.prefs-1.0.2.prefs
  
  true

  


  
com.ca.apm.binaries
jdt.core.prefs
1.0.2
prefs
compile
  
  
org.codehaus.plexus
plexus-compiler-eclipse
2.14.2
compile
  


  21
  21

Re: Re: How to add a library to the classpath

2023-01-06 Thread Siddharth Jain
I think as a user of maven the expected behavior (ask) is for the
additionalClasspathElements to support a user.property which it doesn't
currently. would be a good feature to add to maven exec plugin i believe.
thanks again to all for the help.

On Fri, Jan 6, 2023 at 9:33 AM Delany  wrote:

> The way to separate multiple classpaths is to have multiple poms. You can
> make another child module (so that it inherits the base dependencies) and
> add the extra dependencies and the exec:java to THAT module.
> Delany
>
> On Fri, 6 Jan 2023 at 18:55, Siddharth Jain  wrote:
>
> > Hi All,
> >
> > Thanks for your help. To keep the discussion focused, the ask is how to
> add
> > additional dependencies/jars to the classpath when running a program
> using
> > mvn exec:java and from what i understand it is not possible.
> >
> > I am using mvn dependency:build-classpath to get the full CP and then
> > augment it with additional jars and pass it to java (instead of
> > maven exec:java) as workaround. but that is not the question being asked.
> >
> > Sid
> >
> > On Fri, Jan 6, 2023 at 5:19 AM Eric Bresie  wrote:
> >
> > >
> > > Would using basic batch/shell specifying the dependencies with the Java
> > > classpath argument (without maven run) and the main runtime class be
> the
> > > alternative?
> > >
> > > Kind of a side question…when building with maven does it automate the
> > > addition dependencies within the META-INF/MANIFEST.MF (1) embedded
> within
> > > the jar?
> > >
> > > Eric Bresie
> > > ebre...@gmail.com (mailto:ebre...@gmail.com)
> > >
> > > References (1)
> > >
> https://stackoverflow.com/questions/70216/whats-the-purpose-of-meta-inf
> > > > On January 6, 2023 at 2:35:16 AM CST, Mantas Gridinas <
> > > mgridi...@gmail.com (mailto:mgridi...@gmail.com)> wrote:
> > > > I'm confused. Why would your users write additional entries intk your
> > > pom?
> > > >
> > > > On Fri, Jan 6, 2023, 10:33 (x-apple-data-detectors://4) Delany <
> > > delany.middle...@gmail.com (mailto:delany.middle...@gmail.com)> wrote:
> > > >
> > > > > Could this help?
> > > > >
> > > > >
> > >
> >
> https://maven.apache.org/plugins/maven-dependency-plugin/build-classpath-mojo.html
> > > > > Delany
> > > > >
> > > > > On Fri, 6 Jan 2023 at 05:30, Siddharth Jain  > > (mailto:siddh...@gmail.com)> wrote:
> > > > >
> > > > > > thanks. unfortunately this is exactly what i don't want to do. i
> am
> > > > > looking
> > > > > > for a command line solution. i don't want my users to have to
> > write a
> > > > > > pom.xml to add additional dependencies to the classpath.
> > > > > >
> > > > > > On Thu, Jan 5, 2023 at 5:16 PM Greg Chabala <
> > greg.chab...@gmail.com
> > > (mailto:greg.chab...@gmail.com)>
> > > > > > wrote:
> > > > > >
> > > > > > > Try searching for an example:
> > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > >
> >
> https://github.com/search?l=Maven+POM=additionalClasspathElements=Code
> > > > > > >
> > > > > > > On Thu, Jan 5, 2023 at 7:11 PM Siddharth Jain <
> > siddh...@gmail.com
> > > (mailto:siddh...@gmail.com)>
> > > > > > wrote:
> > > > > > >
> > > > > > > > thanks. how do i separate multiple classpaths? tried : and ,
> > and
> > > none
> > > > > > of
> > > > > > > > them work.
> > > > > > > >
> > > > > > > > On Thu, Jan 5, 2023 at 3:58 PM Laird Nelson <
> > ljnel...@gmail.com
> > > (mailto:ljnel...@gmail.com)>
> > > > > > wrote:
> > > > > > > >
> > > > > > > > > On Thu, Jan 5, 2023 at 3:20 PM Siddharth Jain <
> > > siddh...@gmail.com (mailto:siddh...@gmail.com)>
> > > > > > > > wrote:
> > > > > > > > >
> > > > > > > > > > I am using mvn exec:java to run a program. […] I want to
> > add
> > > some
> > > > > > > more
> > > > > > > > > > libraries that I have
> > > > > > > > > > installed in M2 repository to the classpath at runtime
> and
> > I
> > > do
> > > > > NOT
> > > > > > > > want
> > > > > > > > > to
> > > > > > > > > > list them in the project's pom.xml. How can I do this? I
> > > tried
> > > > > > > > searching
> > > > > > > > > > online but could not find an answer.
> > > > > > > > > >
> > > > > > > > >
> > > > > > > > > The documentation for the exec-maven-plugin's java goal
> > > contains
> > > > > > this:
> > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > >
> >
> https://www.mojohaus.org/exec-maven-plugin/java-mojo.html#additionalClasspathElements
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > >
> >
>


Re: Re: How to add a library to the classpath

2023-01-06 Thread Delany
The way to separate multiple classpaths is to have multiple poms. You can
make another child module (so that it inherits the base dependencies) and
add the extra dependencies and the exec:java to THAT module.
Delany

On Fri, 6 Jan 2023 at 18:55, Siddharth Jain  wrote:

> Hi All,
>
> Thanks for your help. To keep the discussion focused, the ask is how to add
> additional dependencies/jars to the classpath when running a program using
> mvn exec:java and from what i understand it is not possible.
>
> I am using mvn dependency:build-classpath to get the full CP and then
> augment it with additional jars and pass it to java (instead of
> maven exec:java) as workaround. but that is not the question being asked.
>
> Sid
>
> On Fri, Jan 6, 2023 at 5:19 AM Eric Bresie  wrote:
>
> >
> > Would using basic batch/shell specifying the dependencies with the Java
> > classpath argument (without maven run) and the main runtime class be the
> > alternative?
> >
> > Kind of a side question…when building with maven does it automate the
> > addition dependencies within the META-INF/MANIFEST.MF (1) embedded within
> > the jar?
> >
> > Eric Bresie
> > ebre...@gmail.com (mailto:ebre...@gmail.com)
> >
> > References (1)
> > https://stackoverflow.com/questions/70216/whats-the-purpose-of-meta-inf
> > > On January 6, 2023 at 2:35:16 AM CST, Mantas Gridinas <
> > mgridi...@gmail.com (mailto:mgridi...@gmail.com)> wrote:
> > > I'm confused. Why would your users write additional entries intk your
> > pom?
> > >
> > > On Fri, Jan 6, 2023, 10:33 (x-apple-data-detectors://4) Delany <
> > delany.middle...@gmail.com (mailto:delany.middle...@gmail.com)> wrote:
> > >
> > > > Could this help?
> > > >
> > > >
> >
> https://maven.apache.org/plugins/maven-dependency-plugin/build-classpath-mojo.html
> > > > Delany
> > > >
> > > > On Fri, 6 Jan 2023 at 05:30, Siddharth Jain  > (mailto:siddh...@gmail.com)> wrote:
> > > >
> > > > > thanks. unfortunately this is exactly what i don't want to do. i am
> > > > looking
> > > > > for a command line solution. i don't want my users to have to
> write a
> > > > > pom.xml to add additional dependencies to the classpath.
> > > > >
> > > > > On Thu, Jan 5, 2023 at 5:16 PM Greg Chabala <
> greg.chab...@gmail.com
> > (mailto:greg.chab...@gmail.com)>
> > > > > wrote:
> > > > >
> > > > > > Try searching for an example:
> > > > > >
> > > > > >
> > > > >
> > > >
> >
> https://github.com/search?l=Maven+POM=additionalClasspathElements=Code
> > > > > >
> > > > > > On Thu, Jan 5, 2023 at 7:11 PM Siddharth Jain <
> siddh...@gmail.com
> > (mailto:siddh...@gmail.com)>
> > > > > wrote:
> > > > > >
> > > > > > > thanks. how do i separate multiple classpaths? tried : and ,
> and
> > none
> > > > > of
> > > > > > > them work.
> > > > > > >
> > > > > > > On Thu, Jan 5, 2023 at 3:58 PM Laird Nelson <
> ljnel...@gmail.com
> > (mailto:ljnel...@gmail.com)>
> > > > > wrote:
> > > > > > >
> > > > > > > > On Thu, Jan 5, 2023 at 3:20 PM Siddharth Jain <
> > siddh...@gmail.com (mailto:siddh...@gmail.com)>
> > > > > > > wrote:
> > > > > > > >
> > > > > > > > > I am using mvn exec:java to run a program. […] I want to
> add
> > some
> > > > > > more
> > > > > > > > > libraries that I have
> > > > > > > > > installed in M2 repository to the classpath at runtime and
> I
> > do
> > > > NOT
> > > > > > > want
> > > > > > > > to
> > > > > > > > > list them in the project's pom.xml. How can I do this? I
> > tried
> > > > > > > searching
> > > > > > > > > online but could not find an answer.
> > > > > > > > >
> > > > > > > >
> > > > > > > > The documentation for the exec-maven-plugin's java goal
> > contains
> > > > > this:
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> >
> https://www.mojohaus.org/exec-maven-plugin/java-mojo.html#additionalClasspathElements
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> >
>


Re: Re: How to add a library to the classpath

2023-01-06 Thread Laird Nelson
On Fri, Jan 6, 2023 at 8:57 AM Laird Nelson  wrote:

> On Fri, Jan 6, 2023 at 8:55 AM Siddharth Jain  wrote:
>
>> Thanks for your help. To keep the discussion focused, the ask is how to
>> add
>> additional dependencies/jars to the classpath when running a program using
>> mvn exec:java and from what i understand it is not possible.
>>
>
> Correction: it is possible. But actually you want to do it from the
> command line only, which (as documented) would require exec-maven-plugin
> 's java goal's additionalClasspathElements property to have a
> corresponding user.property that you could specify with a -D flag, which,
> as documented, it does not.
>

Finally, as documented, the exec-maven-plugin's java goal runs the
designated program with the classpath of the governing Maven process, so
just add items to the Maven classpath, i.e. the actual java classpath, when
you start Maven.

Best,
Laird

>


Re: Re: How to add a library to the classpath

2023-01-06 Thread Laird Nelson
On Fri, Jan 6, 2023 at 8:55 AM Siddharth Jain  wrote:

> Thanks for your help. To keep the discussion focused, the ask is how to add
> additional dependencies/jars to the classpath when running a program using
> mvn exec:java and from what i understand it is not possible.
>

Correction: it is possible. But actually you want to do it from the command
line only, which (as documented) would require exec-maven-plugin's java
goal's additionalClasspathElements property to have a corresponding
user.property that you could specify with a -D flag, which, as documented,
it does not.

Best,
Laird


Re: Re: How to add a library to the classpath

2023-01-06 Thread Siddharth Jain
Hi All,

Thanks for your help. To keep the discussion focused, the ask is how to add
additional dependencies/jars to the classpath when running a program using
mvn exec:java and from what i understand it is not possible.

I am using mvn dependency:build-classpath to get the full CP and then
augment it with additional jars and pass it to java (instead of
maven exec:java) as workaround. but that is not the question being asked.

Sid

On Fri, Jan 6, 2023 at 5:19 AM Eric Bresie  wrote:

>
> Would using basic batch/shell specifying the dependencies with the Java
> classpath argument (without maven run) and the main runtime class be the
> alternative?
>
> Kind of a side question…when building with maven does it automate the
> addition dependencies within the META-INF/MANIFEST.MF (1) embedded within
> the jar?
>
> Eric Bresie
> ebre...@gmail.com (mailto:ebre...@gmail.com)
>
> References (1)
> https://stackoverflow.com/questions/70216/whats-the-purpose-of-meta-inf
> > On January 6, 2023 at 2:35:16 AM CST, Mantas Gridinas <
> mgridi...@gmail.com (mailto:mgridi...@gmail.com)> wrote:
> > I'm confused. Why would your users write additional entries intk your
> pom?
> >
> > On Fri, Jan 6, 2023, 10:33 (x-apple-data-detectors://4) Delany <
> delany.middle...@gmail.com (mailto:delany.middle...@gmail.com)> wrote:
> >
> > > Could this help?
> > >
> > >
> https://maven.apache.org/plugins/maven-dependency-plugin/build-classpath-mojo.html
> > > Delany
> > >
> > > On Fri, 6 Jan 2023 at 05:30, Siddharth Jain  (mailto:siddh...@gmail.com)> wrote:
> > >
> > > > thanks. unfortunately this is exactly what i don't want to do. i am
> > > looking
> > > > for a command line solution. i don't want my users to have to write a
> > > > pom.xml to add additional dependencies to the classpath.
> > > >
> > > > On Thu, Jan 5, 2023 at 5:16 PM Greg Chabala  (mailto:greg.chab...@gmail.com)>
> > > > wrote:
> > > >
> > > > > Try searching for an example:
> > > > >
> > > > >
> > > >
> > >
> https://github.com/search?l=Maven+POM=additionalClasspathElements=Code
> > > > >
> > > > > On Thu, Jan 5, 2023 at 7:11 PM Siddharth Jain  (mailto:siddh...@gmail.com)>
> > > > wrote:
> > > > >
> > > > > > thanks. how do i separate multiple classpaths? tried : and , and
> none
> > > > of
> > > > > > them work.
> > > > > >
> > > > > > On Thu, Jan 5, 2023 at 3:58 PM Laird Nelson  (mailto:ljnel...@gmail.com)>
> > > > wrote:
> > > > > >
> > > > > > > On Thu, Jan 5, 2023 at 3:20 PM Siddharth Jain <
> siddh...@gmail.com (mailto:siddh...@gmail.com)>
> > > > > > wrote:
> > > > > > >
> > > > > > > > I am using mvn exec:java to run a program. […] I want to add
> some
> > > > > more
> > > > > > > > libraries that I have
> > > > > > > > installed in M2 repository to the classpath at runtime and I
> do
> > > NOT
> > > > > > want
> > > > > > > to
> > > > > > > > list them in the project's pom.xml. How can I do this? I
> tried
> > > > > > searching
> > > > > > > > online but could not find an answer.
> > > > > > > >
> > > > > > >
> > > > > > > The documentation for the exec-maven-plugin's java goal
> contains
> > > > this:
> > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> https://www.mojohaus.org/exec-maven-plugin/java-mojo.html#additionalClasspathElements
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
>


Re: Re: How to add a library to the classpath

2023-01-06 Thread Eric Bresie

Would using basic batch/shell specifying the dependencies with the Java 
classpath argument (without maven run) and the main runtime class be the 
alternative?

Kind of a side question…when building with maven does it automate the addition 
dependencies within the META-INF/MANIFEST.MF (1) embedded within the jar?

Eric Bresie
ebre...@gmail.com (mailto:ebre...@gmail.com)

References (1) 
https://stackoverflow.com/questions/70216/whats-the-purpose-of-meta-inf
> On January 6, 2023 at 2:35:16 AM CST, Mantas Gridinas  (mailto:mgridi...@gmail.com)> wrote:
> I'm confused. Why would your users write additional entries intk your pom?
>
> On Fri, Jan 6, 2023, 10:33 (x-apple-data-detectors://4) Delany 
> mailto:delany.middle...@gmail.com)> wrote:
>
> > Could this help?
> >
> > https://maven.apache.org/plugins/maven-dependency-plugin/build-classpath-mojo.html
> > Delany
> >
> > On Fri, 6 Jan 2023 at 05:30, Siddharth Jain  > (mailto:siddh...@gmail.com)> wrote:
> >
> > > thanks. unfortunately this is exactly what i don't want to do. i am
> > looking
> > > for a command line solution. i don't want my users to have to write a
> > > pom.xml to add additional dependencies to the classpath.
> > >
> > > On Thu, Jan 5, 2023 at 5:16 PM Greg Chabala  > > (mailto:greg.chab...@gmail.com)>
> > > wrote:
> > >
> > > > Try searching for an example:
> > > >
> > > >
> > >
> > https://github.com/search?l=Maven+POM=additionalClasspathElements=Code
> > > >
> > > > On Thu, Jan 5, 2023 at 7:11 PM Siddharth Jain  > > > (mailto:siddh...@gmail.com)>
> > > wrote:
> > > >
> > > > > thanks. how do i separate multiple classpaths? tried : and , and none
> > > of
> > > > > them work.
> > > > >
> > > > > On Thu, Jan 5, 2023 at 3:58 PM Laird Nelson  > > > > (mailto:ljnel...@gmail.com)>
> > > wrote:
> > > > >
> > > > > > On Thu, Jan 5, 2023 at 3:20 PM Siddharth Jain  > > > > > (mailto:siddh...@gmail.com)>
> > > > > wrote:
> > > > > >
> > > > > > > I am using mvn exec:java to run a program. […] I want to add some
> > > > more
> > > > > > > libraries that I have
> > > > > > > installed in M2 repository to the classpath at runtime and I do
> > NOT
> > > > > want
> > > > > > to
> > > > > > > list them in the project's pom.xml. How can I do this? I tried
> > > > > searching
> > > > > > > online but could not find an answer.
> > > > > > >
> > > > > >
> > > > > > The documentation for the exec-maven-plugin's java goal contains
> > > this:
> > > > > >
> > > > > >
> > > > >
> > > >
> > >
> > https://www.mojohaus.org/exec-maven-plugin/java-mojo.html#additionalClasspathElements
> > > > > >
> > > > >
> > > >
> > >
> >


Re: How to add a library to the classpath

2023-01-06 Thread Mantas Gridinas
I'm confused. Why would your users write additional entries intk your pom?

On Fri, Jan 6, 2023, 10:33 Delany  wrote:

> Could this help?
>
> https://maven.apache.org/plugins/maven-dependency-plugin/build-classpath-mojo.html
> Delany
>
> On Fri, 6 Jan 2023 at 05:30, Siddharth Jain  wrote:
>
> > thanks. unfortunately this is exactly what i don't want to do. i am
> looking
> > for a command line solution. i don't want my users to have to write a
> > pom.xml to add additional dependencies to the classpath.
> >
> > On Thu, Jan 5, 2023 at 5:16 PM Greg Chabala 
> > wrote:
> >
> > > Try searching for an example:
> > >
> > >
> >
> https://github.com/search?l=Maven+POM=additionalClasspathElements=Code
> > >
> > > On Thu, Jan 5, 2023 at 7:11 PM Siddharth Jain 
> > wrote:
> > >
> > > > thanks. how do i separate multiple classpaths? tried : and , and none
> > of
> > > > them work.
> > > >
> > > > On Thu, Jan 5, 2023 at 3:58 PM Laird Nelson 
> > wrote:
> > > >
> > > > > On Thu, Jan 5, 2023 at 3:20 PM Siddharth Jain 
> > > > wrote:
> > > > >
> > > > > > I am using mvn exec:java to run a program. […] I want to add some
> > > more
> > > > > > libraries that I have
> > > > > > installed in M2 repository to the classpath at runtime and I do
> NOT
> > > > want
> > > > > to
> > > > > > list them in the project's pom.xml. How can I do this? I tried
> > > > searching
> > > > > > online but could not find an answer.
> > > > > >
> > > > >
> > > > > The documentation for the exec-maven-plugin's java goal contains
> > this:
> > > > >
> > > > >
> > > >
> > >
> >
> https://www.mojohaus.org/exec-maven-plugin/java-mojo.html#additionalClasspathElements
> > > > >
> > > >
> > >
> >
>


Re: How to add a library to the classpath

2023-01-06 Thread Delany
Could this help?
https://maven.apache.org/plugins/maven-dependency-plugin/build-classpath-mojo.html
Delany

On Fri, 6 Jan 2023 at 05:30, Siddharth Jain  wrote:

> thanks. unfortunately this is exactly what i don't want to do. i am looking
> for a command line solution. i don't want my users to have to write a
> pom.xml to add additional dependencies to the classpath.
>
> On Thu, Jan 5, 2023 at 5:16 PM Greg Chabala 
> wrote:
>
> > Try searching for an example:
> >
> >
> https://github.com/search?l=Maven+POM=additionalClasspathElements=Code
> >
> > On Thu, Jan 5, 2023 at 7:11 PM Siddharth Jain 
> wrote:
> >
> > > thanks. how do i separate multiple classpaths? tried : and , and none
> of
> > > them work.
> > >
> > > On Thu, Jan 5, 2023 at 3:58 PM Laird Nelson 
> wrote:
> > >
> > > > On Thu, Jan 5, 2023 at 3:20 PM Siddharth Jain 
> > > wrote:
> > > >
> > > > > I am using mvn exec:java to run a program. […] I want to add some
> > more
> > > > > libraries that I have
> > > > > installed in M2 repository to the classpath at runtime and I do NOT
> > > want
> > > > to
> > > > > list them in the project's pom.xml. How can I do this? I tried
> > > searching
> > > > > online but could not find an answer.
> > > > >
> > > >
> > > > The documentation for the exec-maven-plugin's java goal contains
> this:
> > > >
> > > >
> > >
> >
> https://www.mojohaus.org/exec-maven-plugin/java-mojo.html#additionalClasspathElements
> > > >
> > >
> >
>


Re: How to add a library to the classpath

2023-01-05 Thread Arnaud bourree
Hi,

Maven without pom.xml?
Why don't you write shell script in this case?

Arnaud

Le ven. 6 janv. 2023, 04:30, Siddharth Jain  a écrit :

> thanks. unfortunately this is exactly what i don't want to do. i am looking
> for a command line solution. i don't want my users to have to write a
> pom.xml to add additional dependencies to the classpath.
>
> On Thu, Jan 5, 2023 at 5:16 PM Greg Chabala 
> wrote:
>
> > Try searching for an example:
> >
> >
> https://github.com/search?l=Maven+POM=additionalClasspathElements=Code
> >
> > On Thu, Jan 5, 2023 at 7:11 PM Siddharth Jain 
> wrote:
> >
> > > thanks. how do i separate multiple classpaths? tried : and , and none
> of
> > > them work.
> > >
> > > On Thu, Jan 5, 2023 at 3:58 PM Laird Nelson 
> wrote:
> > >
> > > > On Thu, Jan 5, 2023 at 3:20 PM Siddharth Jain 
> > > wrote:
> > > >
> > > > > I am using mvn exec:java to run a program. […] I want to add some
> > more
> > > > > libraries that I have
> > > > > installed in M2 repository to the classpath at runtime and I do NOT
> > > want
> > > > to
> > > > > list them in the project's pom.xml. How can I do this? I tried
> > > searching
> > > > > online but could not find an answer.
> > > > >
> > > >
> > > > The documentation for the exec-maven-plugin's java goal contains
> this:
> > > >
> > > >
> > >
> >
> https://www.mojohaus.org/exec-maven-plugin/java-mojo.html#additionalClasspathElements
> > > >
> > >
> >
>


Re: How to add a library to the classpath

2023-01-05 Thread Siddharth Jain
thanks. unfortunately this is exactly what i don't want to do. i am looking
for a command line solution. i don't want my users to have to write a
pom.xml to add additional dependencies to the classpath.

On Thu, Jan 5, 2023 at 5:16 PM Greg Chabala  wrote:

> Try searching for an example:
>
> https://github.com/search?l=Maven+POM=additionalClasspathElements=Code
>
> On Thu, Jan 5, 2023 at 7:11 PM Siddharth Jain  wrote:
>
> > thanks. how do i separate multiple classpaths? tried : and , and none of
> > them work.
> >
> > On Thu, Jan 5, 2023 at 3:58 PM Laird Nelson  wrote:
> >
> > > On Thu, Jan 5, 2023 at 3:20 PM Siddharth Jain 
> > wrote:
> > >
> > > > I am using mvn exec:java to run a program. […] I want to add some
> more
> > > > libraries that I have
> > > > installed in M2 repository to the classpath at runtime and I do NOT
> > want
> > > to
> > > > list them in the project's pom.xml. How can I do this? I tried
> > searching
> > > > online but could not find an answer.
> > > >
> > >
> > > The documentation for the exec-maven-plugin's java goal contains this:
> > >
> > >
> >
> https://www.mojohaus.org/exec-maven-plugin/java-mojo.html#additionalClasspathElements
> > >
> >
>


Re: How to add a library to the classpath

2023-01-05 Thread Siddharth Jain
in fact i don't think it works at all. tried using it like
-Dexec.additionalClasspathElements and doesn't work. i notice the
documentation only says:
Additional elements to be appended to the classpath.
for rest of the options the documentation also says:
*User property is*: exec.arguments.
to give an example.

On Thu, Jan 5, 2023 at 5:10 PM Siddharth Jain  wrote:

> thanks. how do i separate multiple classpaths? tried : and , and none of
> them work.
>
> On Thu, Jan 5, 2023 at 3:58 PM Laird Nelson  wrote:
>
>> On Thu, Jan 5, 2023 at 3:20 PM Siddharth Jain  wrote:
>>
>> > I am using mvn exec:java to run a program. […] I want to add some more
>> > libraries that I have
>> > installed in M2 repository to the classpath at runtime and I do NOT
>> want to
>> > list them in the project's pom.xml. How can I do this? I tried searching
>> > online but could not find an answer.
>> >
>>
>> The documentation for the exec-maven-plugin's java goal contains this:
>>
>> https://www.mojohaus.org/exec-maven-plugin/java-mojo.html#additionalClasspathElements
>>
>


Re: How to add a library to the classpath

2023-01-05 Thread Greg Chabala
Try searching for an example:
https://github.com/search?l=Maven+POM=additionalClasspathElements=Code

On Thu, Jan 5, 2023 at 7:11 PM Siddharth Jain  wrote:

> thanks. how do i separate multiple classpaths? tried : and , and none of
> them work.
>
> On Thu, Jan 5, 2023 at 3:58 PM Laird Nelson  wrote:
>
> > On Thu, Jan 5, 2023 at 3:20 PM Siddharth Jain 
> wrote:
> >
> > > I am using mvn exec:java to run a program. […] I want to add some more
> > > libraries that I have
> > > installed in M2 repository to the classpath at runtime and I do NOT
> want
> > to
> > > list them in the project's pom.xml. How can I do this? I tried
> searching
> > > online but could not find an answer.
> > >
> >
> > The documentation for the exec-maven-plugin's java goal contains this:
> >
> >
> https://www.mojohaus.org/exec-maven-plugin/java-mojo.html#additionalClasspathElements
> >
>


Re: How to add a library to the classpath

2023-01-05 Thread Siddharth Jain
thanks. how do i separate multiple classpaths? tried : and , and none of
them work.

On Thu, Jan 5, 2023 at 3:58 PM Laird Nelson  wrote:

> On Thu, Jan 5, 2023 at 3:20 PM Siddharth Jain  wrote:
>
> > I am using mvn exec:java to run a program. […] I want to add some more
> > libraries that I have
> > installed in M2 repository to the classpath at runtime and I do NOT want
> to
> > list them in the project's pom.xml. How can I do this? I tried searching
> > online but could not find an answer.
> >
>
> The documentation for the exec-maven-plugin's java goal contains this:
>
> https://www.mojohaus.org/exec-maven-plugin/java-mojo.html#additionalClasspathElements
>


Re: How to add a library to the classpath

2023-01-05 Thread Laird Nelson
On Thu, Jan 5, 2023 at 3:20 PM Siddharth Jain  wrote:

> I am using mvn exec:java to run a program. […] I want to add some more
> libraries that I have
> installed in M2 repository to the classpath at runtime and I do NOT want to
> list them in the project's pom.xml. How can I do this? I tried searching
> online but could not find an answer.
>

The documentation for the exec-maven-plugin's java goal contains this:
https://www.mojohaus.org/exec-maven-plugin/java-mojo.html#additionalClasspathElements


How to add a library to the classpath

2023-01-05 Thread Siddharth Jain
Hello,

I am using mvn exec:java to run a program. It automatically adds all the
dependencies defined in the project's pom.xml to the Java classpath at
runtime which is good but I want to add some more libraries that I have
installed in M2 repository to the classpath at runtime and I do NOT want to
list them in the project's pom.xml. How can I do this? I tried searching
online but could not find an answer. Thanks,

Sid


Re: Compile classpath in case of dependency conflict

2022-04-12 Thread Alexander Kriegisch
I recommend taking control of the situation by yourself, specifying the desired 
version in your *dependencyManagement* section.-- Alexander Kriegisch
 Ursprüngliche Nachricht Von: Rimvydas Vaidelis 
 Datum: 12.04.22  21:20  (GMT+07:00) An: Maven 
Users List  Betreff: Re: Compile classpath in case of 
dependency conflict Hello Tamas,Thank you for the reply.Reordering of 
dependencies includes guava-30.1-jre.jar into compileclasspath.Dependency 
tree:org.example:dependency-conflict-example:jar:1.0-SNAPSHOT+- 
com.google.inject:guice:jar:5.1.0:compile|  +- 
javax.inject:javax.inject:jar:1:compile|  +- 
aopalliance:aopalliance:jar:1.0:compile|  \- 
com.google.guava:guava:jar:30.1-jre:compile| +- 
com.google.guava:failureaccess:jar:1.0.1:compile| 
+-com.google.guava:listenablefuture:jar:.0-empty-to-avoid-conflict-with-guava:compile|
 +- com.google.code.findbugs:jsr305:jar:3.0.2:compile| +- 
org.checkerframework:checker-qual:jar:3.5.0:compile| +- 
com.google.errorprone:error_prone_annotations:jar:2.3.4:compile| \- 
com.google.j2objc:j2objc-annotations:jar:1.3:compile\- 
org.reflections:reflections:jar:0.9.8:test   +- 
javassist:javassist:jar:3.12.1.GA:test   \- 
dom4j:dom4j:jar:1.6.1:test--RimvydasOn Tue, Apr 12, 2022 at 3:11 PM Tamás 
Cservenák  wrote:> Howdy,>> seems is "known issue" 
https://issues.apache.org/jira/browse/MNG-6224>> what happens if you reorder 
your dependencies in pom, first compile and> then test scoped ones?>> HTH> T>> 
On Tue, Apr 12, 2022 at 1:00 PM Rimvydas Vaidelis <> 
rimvydas.vaide...@gmail.com> wrote:>> > Hello,> >> > I have 2 dependencies 
org.reflections:reflections:jar:0.9.8:test and> > 
com.google.inject:guice:jar:5.1.0:compile.> > 
org.reflections:reflections:jar:0.9.8 uses> > 
com.google.guava:guava:jar:11.0.2:compile> > com.google.inject:guice:jar:5.1.0 
uses> > com.google.guava:guava:30.1-jre:compile> >> > During compiling of the 
module (mvn compile) the compile classpath> contains> > guava-11.0.2.jar. Why? 
It seems> > that occurrence of version conflict changes the scope of the 
transitive> > dependency com.google.guava:guava:jar:11.0.2 to compile.> > Is 
this an expected behavior?> >> > Dependency tree:> >> > 
org.example:dependency-conflict-example:jar:1.0-SNAPSHOT> > +- 
org.reflections:reflections:jar:0.9.8:test> > |  +- 
com.google.guava:guava:jar:11.0.2:compile> > |  |  \- 
com.google.code.findbugs:jsr305:jar:1.3.9:compile> > |  +- 
javassist:javassist:jar:3.12.1.GA:test> > |  \- dom4j:dom4j:jar:1.6.1:test> > 
\- com.google.inject:guice:jar:5.1.0:compile> >    +- 
javax.inject:javax.inject:jar:1:compile> >    \- 
aopalliance:aopalliance:jar:1.0:compile> >> > pom.xml file:> >> > > > http://maven.apache.org/POM/4.0.0;> >  
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;> >  
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0> > 
http://maven.apache.org/xsd/maven-4.0.0.xsd;>> > 
4.0.0> >> > org.example> >  
   dependency-conflict-example> > 
1.0-SNAPSHOT> >> > > > 
11> > 
11> > > >> >
 > > > > 
org.reflections> > 
reflections> > 0.9.8> > 
    test> > > > 
> > com.google.inject> > 
guice> > 5.1.0> >   
  > > > > > >> > --> > Rimvydas> >>

Re: Compile classpath in case of dependency conflict

2022-04-12 Thread Rimvydas Vaidelis
Hello Tamas,

Thank you for the reply.
Reordering of dependencies includes guava-30.1-jre.jar into compile
classpath.

Dependency tree:

org.example:dependency-conflict-example:jar:1.0-SNAPSHOT
+- com.google.inject:guice:jar:5.1.0:compile
|  +- javax.inject:javax.inject:jar:1:compile
|  +- aopalliance:aopalliance:jar:1.0:compile
|  \- com.google.guava:guava:jar:30.1-jre:compile
| +- com.google.guava:failureaccess:jar:1.0.1:compile
| +-
com.google.guava:listenablefuture:jar:.0-empty-to-avoid-conflict-with-guava:compile
| +- com.google.code.findbugs:jsr305:jar:3.0.2:compile
| +- org.checkerframework:checker-qual:jar:3.5.0:compile
| +- com.google.errorprone:error_prone_annotations:jar:2.3.4:compile
| \- com.google.j2objc:j2objc-annotations:jar:1.3:compile
\- org.reflections:reflections:jar:0.9.8:test
   +- javassist:javassist:jar:3.12.1.GA:test
   \- dom4j:dom4j:jar:1.6.1:test

--
Rimvydas

On Tue, Apr 12, 2022 at 3:11 PM Tamás Cservenák  wrote:

> Howdy,
>
> seems is "known issue" https://issues.apache.org/jira/browse/MNG-6224
>
> what happens if you reorder your dependencies in pom, first compile and
> then test scoped ones?
>
> HTH
> T
>
> On Tue, Apr 12, 2022 at 1:00 PM Rimvydas Vaidelis <
> rimvydas.vaide...@gmail.com> wrote:
>
> > Hello,
> >
> > I have 2 dependencies org.reflections:reflections:jar:0.9.8:test and
> > com.google.inject:guice:jar:5.1.0:compile.
> > org.reflections:reflections:jar:0.9.8 uses
> > com.google.guava:guava:jar:11.0.2:compile
> > com.google.inject:guice:jar:5.1.0 uses
> > com.google.guava:guava:30.1-jre:compile
> >
> > During compiling of the module (mvn compile) the compile classpath
> contains
> > guava-11.0.2.jar. Why? It seems
> > that occurrence of version conflict changes the scope of the transitive
> > dependency com.google.guava:guava:jar:11.0.2 to compile.
> > Is this an expected behavior?
> >
> > Dependency tree:
> >
> > org.example:dependency-conflict-example:jar:1.0-SNAPSHOT
> > +- org.reflections:reflections:jar:0.9.8:test
> > |  +- com.google.guava:guava:jar:11.0.2:compile
> > |  |  \- com.google.code.findbugs:jsr305:jar:1.3.9:compile
> > |  +- javassist:javassist:jar:3.12.1.GA:test
> > |  \- dom4j:dom4j:jar:1.6.1:test
> > \- com.google.inject:guice:jar:5.1.0:compile
> >+- javax.inject:javax.inject:jar:1:compile
> >\- aopalliance:aopalliance:jar:1.0:compile
> >
> > pom.xml file:
> >
> > 
> > http://maven.apache.org/POM/4.0.0;
> >  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;
> >  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> > http://maven.apache.org/xsd/maven-4.0.0.xsd;>
> > 4.0.0
> >
> > org.example
> > dependency-conflict-example
> > 1.0-SNAPSHOT
> >
> > 
> > 11
> > 11
> > 
> >
> > 
> > 
> > org.reflections
> > reflections
> > 0.9.8
> > test
> > 
> > 
> > com.google.inject
> > guice
> > 5.1.0
> > 
> > 
> > 
> >
> > --
> > Rimvydas
> >
>


Re: Compile classpath in case of dependency conflict

2022-04-12 Thread Tamás Cservenák
Howdy,

seems is "known issue" https://issues.apache.org/jira/browse/MNG-6224

what happens if you reorder your dependencies in pom, first compile and
then test scoped ones?

HTH
T

On Tue, Apr 12, 2022 at 1:00 PM Rimvydas Vaidelis <
rimvydas.vaide...@gmail.com> wrote:

> Hello,
>
> I have 2 dependencies org.reflections:reflections:jar:0.9.8:test and
> com.google.inject:guice:jar:5.1.0:compile.
> org.reflections:reflections:jar:0.9.8 uses
> com.google.guava:guava:jar:11.0.2:compile
> com.google.inject:guice:jar:5.1.0 uses
> com.google.guava:guava:30.1-jre:compile
>
> During compiling of the module (mvn compile) the compile classpath contains
> guava-11.0.2.jar. Why? It seems
> that occurrence of version conflict changes the scope of the transitive
> dependency com.google.guava:guava:jar:11.0.2 to compile.
> Is this an expected behavior?
>
> Dependency tree:
>
> org.example:dependency-conflict-example:jar:1.0-SNAPSHOT
> +- org.reflections:reflections:jar:0.9.8:test
> |  +- com.google.guava:guava:jar:11.0.2:compile
> |  |  \- com.google.code.findbugs:jsr305:jar:1.3.9:compile
> |  +- javassist:javassist:jar:3.12.1.GA:test
> |  \- dom4j:dom4j:jar:1.6.1:test
> \- com.google.inject:guice:jar:5.1.0:compile
>+- javax.inject:javax.inject:jar:1:compile
>\- aopalliance:aopalliance:jar:1.0:compile
>
> pom.xml file:
>
> 
> http://maven.apache.org/POM/4.0.0;
>  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;
>  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> http://maven.apache.org/xsd/maven-4.0.0.xsd;>
> 4.0.0
>
> org.example
> dependency-conflict-example
> 1.0-SNAPSHOT
>
> 
> 11
> 11
> 
>
> 
> 
> org.reflections
> reflections
> 0.9.8
> test
> 
> 
> com.google.inject
> guice
> 5.1.0
> 
> 
> 
>
> --
> Rimvydas
>


Compile classpath in case of dependency conflict

2022-04-12 Thread Rimvydas Vaidelis
Hello,

I have 2 dependencies org.reflections:reflections:jar:0.9.8:test and
com.google.inject:guice:jar:5.1.0:compile.
org.reflections:reflections:jar:0.9.8 uses
com.google.guava:guava:jar:11.0.2:compile
com.google.inject:guice:jar:5.1.0 uses
com.google.guava:guava:30.1-jre:compile

During compiling of the module (mvn compile) the compile classpath contains
guava-11.0.2.jar. Why? It seems
that occurrence of version conflict changes the scope of the transitive
dependency com.google.guava:guava:jar:11.0.2 to compile.
Is this an expected behavior?

Dependency tree:

org.example:dependency-conflict-example:jar:1.0-SNAPSHOT
+- org.reflections:reflections:jar:0.9.8:test
|  +- com.google.guava:guava:jar:11.0.2:compile
|  |  \- com.google.code.findbugs:jsr305:jar:1.3.9:compile
|  +- javassist:javassist:jar:3.12.1.GA:test
|  \- dom4j:dom4j:jar:1.6.1:test
\- com.google.inject:guice:jar:5.1.0:compile
   +- javax.inject:javax.inject:jar:1:compile
   \- aopalliance:aopalliance:jar:1.0:compile

pom.xml file:


http://maven.apache.org/POM/4.0.0;
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;
 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd;>
4.0.0

org.example
dependency-conflict-example
1.0-SNAPSHOT


11
11




org.reflections
reflections
0.9.8
test


com.google.inject
guice
5.1.0




--
Rimvydas


Re: Using Apache Maven, what is the simplest way to include /lib/ directory in the classpath in the pom.xml

2020-10-17 Thread Jürgen Weber
you could add the whole tomcat.zip to nexus, unpack it before compile
and install-file to local repository.

I had a similar problem, I needed to have the jars of an resource
adapter rar on the classpath:

> I was thinking of adapting maven-warpath-plugin, but in the end I built an 
> uber jar in a sub module with maven-ant-run (unzip, zip and zipgroupfileset) 
> and did an install-file to local repository.

Am Fr., 16. Okt. 2020 um 10:25 Uhr schrieb /dev /local/ca
:
>
> What is the simplest way to specify a directory (and all jars underneath
> this directory) to be in the maven classpath when it compiles .java classes
> and builds a .jar?
>
> The directory is not in my git repo or any directory under my IDE project
> files.
>
> I have a requirement to create a pom.xml that will reference the current
> project, and external jars in a /lib/ directory.
> --
>
> The requirement is to put together a pom.xml for a maven build that depends
> on jars in:
>
> $TOMCAT_HOME/webapps//WEB-INF/lib/
>
> I want to reference that location directly in the maven pom.xml file and
> not copy the /lib/*.jar files to another directory under my git repo.
>
> The .../WEB-INF/lib/ contains .jar files that contains classes that my
> project imports.
>
> The jar that is then built will be put into:
> $TOMCAT_HOME/webapps//WEB-INF/lib/ to extend the product as
> per the vendor instructions.
> --
>
> If anyone has had this exact issue, and has a reference pom.xml that can be
> pasted here, it would be extremely helpful and get me going quickly.
> --
>
> Irrespective of the deployment part where I copy the jar to
> /webapps//WEB-INF/lib/, I would be happy to just get files
> under /src/com/.../.java/ compiled and put into a jar in the /target/
> directory

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



Re: Using Apache Maven, what is the simplest way to include /lib/ directory in the classpath in the pom.xml

2020-10-16 Thread Greg Chabala
I appreciate that you're trying to use Maven to build software, but you've
framed your question unfairly.

What is the simplest way to specify a directory (and all jars underneath
> this directory) to be in the maven classpath when it compiles .java classes
> and builds a .jar?
>

Maven builds from versioned JARs identified by coordinates. You cannot jam
a directory of JARs into the classpath. Maybe you can do that in Ant, but
not Maven.

I need something with no more than 5..10 lines of XML that would include
> this directory so that it would pick up all jars and add to the class path.
>

Doesn't exist, no matter how much you want it.

There are hundreds of jar files in the
> $TOMCAT_HOME//WEB-INF/lib directory.
>

Over time I can create an entry for each one, but I just don't have time
> for that right now, also I would need to determine the version of each and

that would be a nightmare.


The time is now. Don't leave the nightmare for someone else later.

I suspect your real issue is closer to this:
https://blog.sonatype.com/2009/04/how-to-convert-from-ant-to-maven-in-5-minutes/

Greg Chabala

On Fri, Oct 16, 2020 at 9:48 AM /dev /local/ca  wrote:

> Thank you for the suggestion Bernd,
>
> Do you have an example you can share?  There are hundreds of jar files in
> the $TOMCAT_HOME//WEB-INF/lib directory.
>
> I need something with no more than 5..10 lines of XML that would include
> this directory so that it would pick up all jars and add to the class path.
> Over time I can create an entry for each one, but I just don't have time
> for that right now, also I would need to determine the version of each and
> that would be a nightmare.
>
> If you can please help with what the question asks.
>
> On Fri, Oct 16, 2020 at 2:38 AM Bernd Eckenfels 
> wrote:
>
> > Hello,
> >
> > It is really not a good idea to fight maven. If you need something in the
> > classpath for compile, specify it as dependency in the Pom. Otherwise
> your
> > build cannot be repeated and the project is hard to set up.
> >
> > All tomcat libraries needed to compile should be in the maven repository.
> > If you have custom artifacts, the normal method is to upload them to a
> > (own) repository Server and reference them there.
> >
> > There is a way to specify a local („system“) location for dependencies,
> > but I would not recommend that way. (And in all cases not possible to
> use a
> > wildcard/directory search)
> >
> > Gruss
> > Bernd
> >
> >
> > --
> > http://bernd.eckenfels.net
> > 
> > Von: /dev /local/ca 
> > Gesendet: Friday, October 16, 2020 10:24:50 AM
> > An: users@maven.apache.org 
> > Betreff: Using Apache Maven, what is the simplest way to include
> > /lib/ directory in the classpath in the
> > pom.xml
> >
> > What is the simplest way to specify a directory (and all jars underneath
> > this directory) to be in the maven classpath when it compiles .java
> classes
> > and builds a .jar?
> >
> > The directory is not in my git repo or any directory under my IDE project
> > files.
> >
> > I have a requirement to create a pom.xml that will reference the current
> > project, and external jars in a /lib/ directory.
> > --
> >
> > The requirement is to put together a pom.xml for a maven build that
> depends
> > on jars in:
> >
> > $TOMCAT_HOME/webapps//WEB-INF/lib/
> >
> > I want to reference that location directly in the maven pom.xml file and
> > not copy the /lib/*.jar files to another directory under my git repo.
> >
> > The .../WEB-INF/lib/ contains .jar files that contains classes that my
> > project imports.
> >
> > The jar that is then built will be put into:
> > $TOMCAT_HOME/webapps//WEB-INF/lib/ to extend the product as
> > per the vendor instructions.
> > --
> >
> > If anyone has had this exact issue, and has a reference pom.xml that can
> be
> > pasted here, it would be extremely helpful and get me going quickly.
> > --
> >
> > Irrespective of the deployment part where I copy the jar to
> > /webapps//WEB-INF/lib/, I would be happy to just get files
> > under /src/com/.../.java/ compiled and put into a jar in the /target/
> > directory
> >
>


Re: Using Apache Maven, what is the simplest way to include /lib/ directory in the classpath in the pom.xml

2020-10-16 Thread /dev /local/ca
Thank you for the suggestion Bernd,

Do you have an example you can share?  There are hundreds of jar files in
the $TOMCAT_HOME//WEB-INF/lib directory.

I need something with no more than 5..10 lines of XML that would include
this directory so that it would pick up all jars and add to the class path.
Over time I can create an entry for each one, but I just don't have time
for that right now, also I would need to determine the version of each and
that would be a nightmare.

If you can please help with what the question asks.

On Fri, Oct 16, 2020 at 2:38 AM Bernd Eckenfels 
wrote:

> Hello,
>
> It is really not a good idea to fight maven. If you need something in the
> classpath for compile, specify it as dependency in the Pom. Otherwise your
> build cannot be repeated and the project is hard to set up.
>
> All tomcat libraries needed to compile should be in the maven repository.
> If you have custom artifacts, the normal method is to upload them to a
> (own) repository Server and reference them there.
>
> There is a way to specify a local („system“) location for dependencies,
> but I would not recommend that way. (And in all cases not possible to use a
> wildcard/directory search)
>
> Gruss
> Bernd
>
>
> --
> http://bernd.eckenfels.net
> 
> Von: /dev /local/ca 
> Gesendet: Friday, October 16, 2020 10:24:50 AM
> An: users@maven.apache.org 
> Betreff: Using Apache Maven, what is the simplest way to include
> /lib/ directory in the classpath in the
> pom.xml
>
> What is the simplest way to specify a directory (and all jars underneath
> this directory) to be in the maven classpath when it compiles .java classes
> and builds a .jar?
>
> The directory is not in my git repo or any directory under my IDE project
> files.
>
> I have a requirement to create a pom.xml that will reference the current
> project, and external jars in a /lib/ directory.
> --
>
> The requirement is to put together a pom.xml for a maven build that depends
> on jars in:
>
> $TOMCAT_HOME/webapps//WEB-INF/lib/
>
> I want to reference that location directly in the maven pom.xml file and
> not copy the /lib/*.jar files to another directory under my git repo.
>
> The .../WEB-INF/lib/ contains .jar files that contains classes that my
> project imports.
>
> The jar that is then built will be put into:
> $TOMCAT_HOME/webapps//WEB-INF/lib/ to extend the product as
> per the vendor instructions.
> --
>
> If anyone has had this exact issue, and has a reference pom.xml that can be
> pasted here, it would be extremely helpful and get me going quickly.
> --
>
> Irrespective of the deployment part where I copy the jar to
> /webapps//WEB-INF/lib/, I would be happy to just get files
> under /src/com/.../.java/ compiled and put into a jar in the /target/
> directory
>


Re: Using Apache Maven, what is the simplest way to include /lib/ directory in the classpath in the pom.xml

2020-10-16 Thread Bernd Eckenfels
Hello,

It is really not a good idea to fight maven. If you need something in the 
classpath for compile, specify it as dependency in the Pom. Otherwise your 
build cannot be repeated and the project is hard to set up.

All tomcat libraries needed to compile should be in the maven repository. If 
you have custom artifacts, the normal method is to upload them to a (own) 
repository Server and reference them there.

There is a way to specify a local („system“) location for dependencies, but I 
would not recommend that way. (And in all cases not possible to use a 
wildcard/directory search)

Gruss
Bernd


--
http://bernd.eckenfels.net

Von: /dev /local/ca 
Gesendet: Friday, October 16, 2020 10:24:50 AM
An: users@maven.apache.org 
Betreff: Using Apache Maven, what is the simplest way to include 
/lib/ directory in the classpath in the 
pom.xml

What is the simplest way to specify a directory (and all jars underneath
this directory) to be in the maven classpath when it compiles .java classes
and builds a .jar?

The directory is not in my git repo or any directory under my IDE project
files.

I have a requirement to create a pom.xml that will reference the current
project, and external jars in a /lib/ directory.
--

The requirement is to put together a pom.xml for a maven build that depends
on jars in:

$TOMCAT_HOME/webapps//WEB-INF/lib/

I want to reference that location directly in the maven pom.xml file and
not copy the /lib/*.jar files to another directory under my git repo.

The .../WEB-INF/lib/ contains .jar files that contains classes that my
project imports.

The jar that is then built will be put into:
$TOMCAT_HOME/webapps//WEB-INF/lib/ to extend the product as
per the vendor instructions.
--

If anyone has had this exact issue, and has a reference pom.xml that can be
pasted here, it would be extremely helpful and get me going quickly.
--

Irrespective of the deployment part where I copy the jar to
/webapps//WEB-INF/lib/, I would be happy to just get files
under /src/com/.../.java/ compiled and put into a jar in the /target/
directory


Using Apache Maven, what is the simplest way to include /lib/ directory in the classpath in the pom.xml

2020-10-16 Thread /dev /local/ca
What is the simplest way to specify a directory (and all jars underneath
this directory) to be in the maven classpath when it compiles .java classes
and builds a .jar?

The directory is not in my git repo or any directory under my IDE project
files.

I have a requirement to create a pom.xml that will reference the current
project, and external jars in a /lib/ directory.
--

The requirement is to put together a pom.xml for a maven build that depends
on jars in:

$TOMCAT_HOME/webapps//WEB-INF/lib/

I want to reference that location directly in the maven pom.xml file and
not copy the /lib/*.jar files to another directory under my git repo.

The .../WEB-INF/lib/ contains .jar files that contains classes that my
project imports.

The jar that is then built will be put into:
$TOMCAT_HOME/webapps//WEB-INF/lib/ to extend the product as
per the vendor instructions.
--

If anyone has had this exact issue, and has a reference pom.xml that can be
pasted here, it would be extremely helpful and get me going quickly.
--

Irrespective of the deployment part where I copy the jar to
/webapps//WEB-INF/lib/, I would be happy to just get files
under /src/com/.../.java/ compiled and put into a jar in the /target/
directory


Re: Access or generate a classpath for dependency not in any scope but attached to plugin.

2020-06-26 Thread LINUS FERNANDES
Thanks, Herve.
I'd share this with the Checkstyle user group on Github.
I don't have the bandwidth for this right now and I'm not being literal!

Regards,
Linus.

On Fri, 26 Jun 2020, 12:00 Hervé BOUTEMY,  wrote:

> the Maven Checkstyle Plugin source code is here:
> https://github.com/apache/maven-checkstyle-plugin/
> with links to CI and issue tracking
>
> IMHO, updating its code should be easier than trying to tweak scripting
> with
> Ant run.
> And with the integration tests (in src/its, launched with "mvn -Prun-its
> verify"), you could easily check that your new feature has expected results
>
> then provide us a Pull Requests, to get the new feature integrated into
> the
> official plugin, and become a new Maven contributor!
>
> If you're interested, we're having an online "Hack Commit Push" event
> tomorrow, where I will be there the whole day (Paris timezone) to help
> people
> wanting to contribute:
> see https://paris2020.hack-commit-pu.sh/
>
> Regards,
>
> Hervé
>
> Le vendredi 26 juin 2020, 03:21:33 CEST LINUS FERNANDES a écrit :
> > While the exec maven plugin will satisfy the reduced classpath
> > requirements, I'm constricted by the requirement of the Checkstyle CLI
> that
> > requires a list of source files as a parameter to be passed; it doesn't
> > accept a directory and maven apparently works best with directories.
> > There appears to be no maven plugin that lists source files and while I
> can
> > construct the list of source files via Ant Run plugin, I cannot propagate
> > the dynamically added property to the exec maven plugin.
> > Any suggestions?
> >
> > Or should I revert to the original all Ant version?
> >
> >
> >
> > On Thu, 25 Jun 2020, 19:51 LINUS FERNANDES, 
> >
> > wrote:
> > > I think exec maven plugin might need my requirements better of not
> adding
> > > Checkstyle jars to the project's dependencies. I'll have to test that
> out,
> > > though.
> > >
> > > On Thu, 25 Jun 2020, 14:33 LINUS FERNANDES,  >
> > >
> > > wrote:
> > >> I've raised a feature request at
> > >> https://issues.apache.org/jira/browse/MCHECKSTYLE-396
> > >>
> > >> Regards,
> > >> Linus.
> > >>
> > >>
> > >>
> > >>
> > >> On Thu, 25 Jun 2020, 14:19 LINUS FERNANDES, <
> linus.fernan...@gmail.com>
> > >>
> > >> wrote:
> > >>> Thanks, that resolves the issue with running the goal as
> > >>> antrun:run@checkstyleg.
> > >>>
> > >>> Regards,
> > >>> Linus.
> > >>>
> > >>> On Thu, 25 Jun 2020, 13:39 Benjamin Marwell, 
> wrote:
> > >>>> Feature requests can be created here:
> > >>>> https://issues.apache.org/jira/projects/MCHECKSTYLE
> > >>>>
> > >>>> You are welcome to create a pull request.
> > >>>>
> > >>>> Looking at the ant configuration, you could just use the plugin
> > >>>> classpath in your java task:
> > >>>>
> > >>>>
> https://maven.apache.org/plugins/maven-antrun-plugin/examples/classpath
> > >>>> s.html
> > >>>>
> > >>>>
> > >>>> Am Do., 25. Juni 2020 um 09:16 Uhr schrieb LINUS FERNANDES
> > >>>>
> > >>>> :
> > >>>> > I would like to create a feature request---evidently.
> > >>>> >
> > >>>> > This is something that impacts the ant and Gradle tasks as well.
> > >>>> >
> > >>>> > I'm not sure where to make this request.
> > >>>> >
> > >>>> > Should it be on the Checkstyle Github repo or will I have to make
> > >>>>
> > >>>> three
> > >>>>
> > >>>> > separate requests, one for each of the above?
> > >>>> >
> > >>>> > The feature is available on the CLI using the -g option.
> > >>>> >
> > >>>> > I intend to use this during the Maven build, not from my code.
> > >>>> >
> > >>>> > Since I already had Ant configured to do exactly that, I
> preferred to
> > >>>>
> > >>>> use
> > >>>>
> > >>>> > the Ant Run plugin to reproduce the functionality within Maven.
> > >>>> >
> > 

Re: Access or generate a classpath for dependency not in any scope but attached to plugin.

2020-06-26 Thread Hervé BOUTEMY
the Maven Checkstyle Plugin source code is here:
https://github.com/apache/maven-checkstyle-plugin/
with links to CI and issue tracking

IMHO, updating its code should be easier than trying to tweak scripting with 
Ant run.
And with the integration tests (in src/its, launched with "mvn -Prun-its 
verify"), you could easily check that your new feature has expected results

then provide us a Pull Requests, to get the new feature integrated into the 
official plugin, and become a new Maven contributor!

If you're interested, we're having an online "Hack Commit Push" event 
tomorrow, where I will be there the whole day (Paris timezone) to help people 
wanting to contribute:
see https://paris2020.hack-commit-pu.sh/

Regards,

Hervé

Le vendredi 26 juin 2020, 03:21:33 CEST LINUS FERNANDES a écrit :
> While the exec maven plugin will satisfy the reduced classpath
> requirements, I'm constricted by the requirement of the Checkstyle CLI that
> requires a list of source files as a parameter to be passed; it doesn't
> accept a directory and maven apparently works best with directories.
> There appears to be no maven plugin that lists source files and while I can
> construct the list of source files via Ant Run plugin, I cannot propagate
> the dynamically added property to the exec maven plugin.
> Any suggestions?
> 
> Or should I revert to the original all Ant version?
> 
> 
> 
> On Thu, 25 Jun 2020, 19:51 LINUS FERNANDES, 
> 
> wrote:
> > I think exec maven plugin might need my requirements better of not adding
> > Checkstyle jars to the project's dependencies. I'll have to test that out,
> > though.
> > 
> > On Thu, 25 Jun 2020, 14:33 LINUS FERNANDES, 
> > 
> > wrote:
> >> I've raised a feature request at
> >> https://issues.apache.org/jira/browse/MCHECKSTYLE-396
> >> 
> >> Regards,
> >> Linus.
> >> 
> >> 
> >> 
> >> 
> >> On Thu, 25 Jun 2020, 14:19 LINUS FERNANDES, 
> >> 
> >> wrote:
> >>> Thanks, that resolves the issue with running the goal as
> >>> antrun:run@checkstyleg.
> >>> 
> >>> Regards,
> >>> Linus.
> >>> 
> >>> On Thu, 25 Jun 2020, 13:39 Benjamin Marwell,  wrote:
> >>>> Feature requests can be created here:
> >>>> https://issues.apache.org/jira/projects/MCHECKSTYLE
> >>>> 
> >>>> You are welcome to create a pull request.
> >>>> 
> >>>> Looking at the ant configuration, you could just use the plugin
> >>>> classpath in your java task:
> >>>> 
> >>>> https://maven.apache.org/plugins/maven-antrun-plugin/examples/classpath
> >>>> s.html
> >>>> 
> >>>> 
> >>>> Am Do., 25. Juni 2020 um 09:16 Uhr schrieb LINUS FERNANDES
> >>>> 
> >>>> :
> >>>> > I would like to create a feature request---evidently.
> >>>> > 
> >>>> > This is something that impacts the ant and Gradle tasks as well.
> >>>> > 
> >>>> > I'm not sure where to make this request.
> >>>> > 
> >>>> > Should it be on the Checkstyle Github repo or will I have to make
> >>>> 
> >>>> three
> >>>> 
> >>>> > separate requests, one for each of the above?
> >>>> > 
> >>>> > The feature is available on the CLI using the -g option.
> >>>> > 
> >>>> > I intend to use this during the Maven build, not from my code.
> >>>> > 
> >>>> > Since I already had Ant configured to do exactly that, I preferred to
> >>>> 
> >>>> use
> >>>> 
> >>>> > the Ant Run plugin to reproduce the functionality within Maven.
> >>>> > 
> >>>> > The pom file is located at:
> >>>> > 
> >>>> > https://github.com/Fernal73/DSAlgos/blob/master/pom.xml
> >>>> > 
> >>>> > I have no interest in creating my own plugin given the attendant
> >>>> 
> >>>> issues of
> >>>> 
> >>>> > maintaining it and for just this feature.
> >>>> > 
> >>>> > This should really be part of the Maven, Ant and Gradle
> >>>> 
> >>>> configurations.
> >>>> 
> >>>> > Perhaps, it's because the feature is still considered experimental
> >>>> > and
> >>>> > t

Re: Access or generate a classpath for dependency not in any scope but attached to plugin.

2020-06-25 Thread LINUS FERNANDES
While the exec maven plugin will satisfy the reduced classpath
requirements, I'm constricted by the requirement of the Checkstyle CLI that
requires a list of source files as a parameter to be passed; it doesn't
accept a directory and maven apparently works best with directories.
There appears to be no maven plugin that lists source files and while I can
construct the list of source files via Ant Run plugin, I cannot propagate
the dynamically added property to the exec maven plugin.
Any suggestions?

Or should I revert to the original all Ant version?



On Thu, 25 Jun 2020, 19:51 LINUS FERNANDES, 
wrote:

> I think exec maven plugin might need my requirements better of not adding
> Checkstyle jars to the project's dependencies. I'll have to test that out,
> though.
>
> On Thu, 25 Jun 2020, 14:33 LINUS FERNANDES, 
> wrote:
>
>> I've raised a feature request at
>> https://issues.apache.org/jira/browse/MCHECKSTYLE-396
>>
>> Regards,
>> Linus.
>>
>>
>>
>>
>> On Thu, 25 Jun 2020, 14:19 LINUS FERNANDES, 
>> wrote:
>>
>>> Thanks, that resolves the issue with running the goal as
>>> antrun:run@checkstyleg.
>>>
>>> Regards,
>>> Linus.
>>>
>>> On Thu, 25 Jun 2020, 13:39 Benjamin Marwell,  wrote:
>>>
>>>> Feature requests can be created here:
>>>> https://issues.apache.org/jira/projects/MCHECKSTYLE
>>>>
>>>> You are welcome to create a pull request.
>>>>
>>>> Looking at the ant configuration, you could just use the plugin
>>>> classpath in your java task:
>>>>
>>>> https://maven.apache.org/plugins/maven-antrun-plugin/examples/classpaths.html
>>>>
>>>>
>>>> Am Do., 25. Juni 2020 um 09:16 Uhr schrieb LINUS FERNANDES
>>>> :
>>>> >
>>>> > I would like to create a feature request---evidently.
>>>> >
>>>> > This is something that impacts the ant and Gradle tasks as well.
>>>> >
>>>> > I'm not sure where to make this request.
>>>> >
>>>> > Should it be on the Checkstyle Github repo or will I have to make
>>>> three
>>>> > separate requests, one for each of the above?
>>>> >
>>>> > The feature is available on the CLI using the -g option.
>>>> >
>>>> > I intend to use this during the Maven build, not from my code.
>>>> >
>>>> > Since I already had Ant configured to do exactly that, I preferred to
>>>> use
>>>> > the Ant Run plugin to reproduce the functionality within Maven.
>>>> >
>>>> > The pom file is located at:
>>>> >
>>>> > https://github.com/Fernal73/DSAlgos/blob/master/pom.xml
>>>> >
>>>> > I have no interest in creating my own plugin given the attendant
>>>> issues of
>>>> > maintaining it and for just this feature.
>>>> >
>>>> > This should really be part of the Maven, Ant and Gradle
>>>> configurations.
>>>> >
>>>> > Perhaps, it's because the feature is still considered experimental and
>>>> > there's no pressure from users to add the ability to generate Xpath
>>>> > suppressions in the other ways to use Checkstyle.
>>>> >
>>>> > I find it very useful, though although it's complicated to set it up
>>>> in its
>>>> > current Avatar.
>>>> >
>>>> > Regards,
>>>> > Linus.
>>>> >
>>>> >
>>>> >
>>>> >
>>>> > On Thu, 25 Jun 2020, 11:56 Benjamin Marwell, 
>>>> wrote:
>>>> >
>>>> > > Well, you could write your own plugin which has checkstyle as a
>>>> dependency.
>>>> > > But it might be the easiest to just create a PR for the checkstyle
>>>> plugin.
>>>> > > The checkstyle plugin is maintained by maven. So why not just
>>>> create a
>>>> > > feature request?
>>>> > >
>>>> > > Also, where do you want to execute the "new goal"? In the maven
>>>> build
>>>> > > or inside your java code? This will also make a difference.
>>>> > > If it is the latter, you can just pull in the plugin as a regular
>>>> > > dependency.
>>>> > > You can make it optional or provided (or both) if you do not need
>>>>

Re: Access or generate a classpath for dependency not in any scope but attached to plugin.

2020-06-25 Thread LINUS FERNANDES
I think exec maven plugin might need my requirements better of not adding
Checkstyle jars to the project's dependencies. I'll have to test that out,
though.

On Thu, 25 Jun 2020, 14:33 LINUS FERNANDES, 
wrote:

> I've raised a feature request at
> https://issues.apache.org/jira/browse/MCHECKSTYLE-396
>
> Regards,
> Linus.
>
>
>
>
> On Thu, 25 Jun 2020, 14:19 LINUS FERNANDES, 
> wrote:
>
>> Thanks, that resolves the issue with running the goal as
>> antrun:run@checkstyleg.
>>
>> Regards,
>> Linus.
>>
>> On Thu, 25 Jun 2020, 13:39 Benjamin Marwell,  wrote:
>>
>>> Feature requests can be created here:
>>> https://issues.apache.org/jira/projects/MCHECKSTYLE
>>>
>>> You are welcome to create a pull request.
>>>
>>> Looking at the ant configuration, you could just use the plugin
>>> classpath in your java task:
>>>
>>> https://maven.apache.org/plugins/maven-antrun-plugin/examples/classpaths.html
>>>
>>>
>>> Am Do., 25. Juni 2020 um 09:16 Uhr schrieb LINUS FERNANDES
>>> :
>>> >
>>> > I would like to create a feature request---evidently.
>>> >
>>> > This is something that impacts the ant and Gradle tasks as well.
>>> >
>>> > I'm not sure where to make this request.
>>> >
>>> > Should it be on the Checkstyle Github repo or will I have to make three
>>> > separate requests, one for each of the above?
>>> >
>>> > The feature is available on the CLI using the -g option.
>>> >
>>> > I intend to use this during the Maven build, not from my code.
>>> >
>>> > Since I already had Ant configured to do exactly that, I preferred to
>>> use
>>> > the Ant Run plugin to reproduce the functionality within Maven.
>>> >
>>> > The pom file is located at:
>>> >
>>> > https://github.com/Fernal73/DSAlgos/blob/master/pom.xml
>>> >
>>> > I have no interest in creating my own plugin given the attendant
>>> issues of
>>> > maintaining it and for just this feature.
>>> >
>>> > This should really be part of the Maven, Ant and Gradle configurations.
>>> >
>>> > Perhaps, it's because the feature is still considered experimental and
>>> > there's no pressure from users to add the ability to generate Xpath
>>> > suppressions in the other ways to use Checkstyle.
>>> >
>>> > I find it very useful, though although it's complicated to set it up
>>> in its
>>> > current Avatar.
>>> >
>>> > Regards,
>>> > Linus.
>>> >
>>> >
>>> >
>>> >
>>> > On Thu, 25 Jun 2020, 11:56 Benjamin Marwell, 
>>> wrote:
>>> >
>>> > > Well, you could write your own plugin which has checkstyle as a
>>> dependency.
>>> > > But it might be the easiest to just create a PR for the checkstyle
>>> plugin.
>>> > > The checkstyle plugin is maintained by maven. So why not just create
>>> a
>>> > > feature request?
>>> > >
>>> > > Also, where do you want to execute the "new goal"? In the maven build
>>> > > or inside your java code? This will also make a difference.
>>> > > If it is the latter, you can just pull in the plugin as a regular
>>> > > dependency.
>>> > > You can make it optional or provided (or both) if you do not need it
>>> at
>>> > > runtime.
>>> > >
>>> > > Am Do., 25. Juni 2020 um 03:49 Uhr schrieb LINUS FERNANDES
>>> > > :
>>> > > >
>>> > > > My usecase is that I need to execute a feature available in
>>> Checkstyle
>>> > > > that's not provided as a goal in its plugin.
>>> > > >
>>> > > > For that, I need access to the dependency classpath (latest version
>>> > > > always).
>>> > > >
>>> > > > Then I can execute the feature using the Ant Run plugin.
>>> > > >
>>> > > >
>>> > > >
>>> > > >
>>> > > > On Thu, 25 Jun 2020, 06:51 LINUS FERNANDES, <
>>> linus.fernan...@gmail.com>
>>> > > > wrote:
>>> > > >
>>> > > > > Is it possible to generate a classpath for a dependency not
>>> placed in
>>> > > the
>>> > > > > dependencyManagement and/or dependencies section but is attached
>>> to a
>>> > > > > plugin used by the project?
>>> > > > >
>>> > > > > I know it's possible to generate a path to the local repository
>>> and
>>> > > look
>>> > > > > for the latest version directory and specify the jars under it
>>> but is
>>> > > there
>>> > > > > any other way to do this preferably via a Maven plugin and one
>>> of its
>>> > > goals?
>>> > > > >
>>> > > > > build-classpath from the Maven dependency plugin will only
>>> generate
>>> > > > > classpaths for dependencies listed in the project's
>>> dependencies, not a
>>> > > > > plugin's direct dependencies.
>>> > > > >
>>> > > > > I don't wish to add a plugin's specific dependencies to the
>>> project's
>>> > > > > dependencies.
>>> > > > >
>>> > > > > Regards,
>>> > > > > Linus.
>>> > > > >
>>> > >
>>> > > -
>>> > > To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
>>> > > For additional commands, e-mail: users-h...@maven.apache.org
>>> > >
>>> > >
>>>
>>> -
>>> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
>>> For additional commands, e-mail: users-h...@maven.apache.org
>>>
>>>


Re: Access or generate a classpath for dependency not in any scope but attached to plugin.

2020-06-25 Thread LINUS FERNANDES
I've raised a feature request at
https://issues.apache.org/jira/browse/MCHECKSTYLE-396

Regards,
Linus.




On Thu, 25 Jun 2020, 14:19 LINUS FERNANDES, 
wrote:

> Thanks, that resolves the issue with running the goal as
> antrun:run@checkstyleg.
>
> Regards,
> Linus.
>
> On Thu, 25 Jun 2020, 13:39 Benjamin Marwell,  wrote:
>
>> Feature requests can be created here:
>> https://issues.apache.org/jira/projects/MCHECKSTYLE
>>
>> You are welcome to create a pull request.
>>
>> Looking at the ant configuration, you could just use the plugin
>> classpath in your java task:
>>
>> https://maven.apache.org/plugins/maven-antrun-plugin/examples/classpaths.html
>>
>>
>> Am Do., 25. Juni 2020 um 09:16 Uhr schrieb LINUS FERNANDES
>> :
>> >
>> > I would like to create a feature request---evidently.
>> >
>> > This is something that impacts the ant and Gradle tasks as well.
>> >
>> > I'm not sure where to make this request.
>> >
>> > Should it be on the Checkstyle Github repo or will I have to make three
>> > separate requests, one for each of the above?
>> >
>> > The feature is available on the CLI using the -g option.
>> >
>> > I intend to use this during the Maven build, not from my code.
>> >
>> > Since I already had Ant configured to do exactly that, I preferred to
>> use
>> > the Ant Run plugin to reproduce the functionality within Maven.
>> >
>> > The pom file is located at:
>> >
>> > https://github.com/Fernal73/DSAlgos/blob/master/pom.xml
>> >
>> > I have no interest in creating my own plugin given the attendant issues
>> of
>> > maintaining it and for just this feature.
>> >
>> > This should really be part of the Maven, Ant and Gradle configurations.
>> >
>> > Perhaps, it's because the feature is still considered experimental and
>> > there's no pressure from users to add the ability to generate Xpath
>> > suppressions in the other ways to use Checkstyle.
>> >
>> > I find it very useful, though although it's complicated to set it up in
>> its
>> > current Avatar.
>> >
>> > Regards,
>> > Linus.
>> >
>> >
>> >
>> >
>> > On Thu, 25 Jun 2020, 11:56 Benjamin Marwell, 
>> wrote:
>> >
>> > > Well, you could write your own plugin which has checkstyle as a
>> dependency.
>> > > But it might be the easiest to just create a PR for the checkstyle
>> plugin.
>> > > The checkstyle plugin is maintained by maven. So why not just create a
>> > > feature request?
>> > >
>> > > Also, where do you want to execute the "new goal"? In the maven build
>> > > or inside your java code? This will also make a difference.
>> > > If it is the latter, you can just pull in the plugin as a regular
>> > > dependency.
>> > > You can make it optional or provided (or both) if you do not need it
>> at
>> > > runtime.
>> > >
>> > > Am Do., 25. Juni 2020 um 03:49 Uhr schrieb LINUS FERNANDES
>> > > :
>> > > >
>> > > > My usecase is that I need to execute a feature available in
>> Checkstyle
>> > > > that's not provided as a goal in its plugin.
>> > > >
>> > > > For that, I need access to the dependency classpath (latest version
>> > > > always).
>> > > >
>> > > > Then I can execute the feature using the Ant Run plugin.
>> > > >
>> > > >
>> > > >
>> > > >
>> > > > On Thu, 25 Jun 2020, 06:51 LINUS FERNANDES, <
>> linus.fernan...@gmail.com>
>> > > > wrote:
>> > > >
>> > > > > Is it possible to generate a classpath for a dependency not
>> placed in
>> > > the
>> > > > > dependencyManagement and/or dependencies section but is attached
>> to a
>> > > > > plugin used by the project?
>> > > > >
>> > > > > I know it's possible to generate a path to the local repository
>> and
>> > > look
>> > > > > for the latest version directory and specify the jars under it
>> but is
>> > > there
>> > > > > any other way to do this preferably via a Maven plugin and one of
>> its
>> > > goals?
>> > > > >
>> > > > > build-classpath from the Maven dependency plugin will only
>> generate
>> > > > > classpaths for dependencies listed in the project's dependencies,
>> not a
>> > > > > plugin's direct dependencies.
>> > > > >
>> > > > > I don't wish to add a plugin's specific dependencies to the
>> project's
>> > > > > dependencies.
>> > > > >
>> > > > > Regards,
>> > > > > Linus.
>> > > > >
>> > >
>> > > -
>> > > To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
>> > > For additional commands, e-mail: users-h...@maven.apache.org
>> > >
>> > >
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
>> For additional commands, e-mail: users-h...@maven.apache.org
>>
>>


Re: Access or generate a classpath for dependency not in any scope but attached to plugin.

2020-06-25 Thread LINUS FERNANDES
Thanks, that resolves the issue with running the goal as
antrun:run@checkstyleg.

Regards,
Linus.

On Thu, 25 Jun 2020, 13:39 Benjamin Marwell,  wrote:

> Feature requests can be created here:
> https://issues.apache.org/jira/projects/MCHECKSTYLE
>
> You are welcome to create a pull request.
>
> Looking at the ant configuration, you could just use the plugin
> classpath in your java task:
>
> https://maven.apache.org/plugins/maven-antrun-plugin/examples/classpaths.html
>
>
> Am Do., 25. Juni 2020 um 09:16 Uhr schrieb LINUS FERNANDES
> :
> >
> > I would like to create a feature request---evidently.
> >
> > This is something that impacts the ant and Gradle tasks as well.
> >
> > I'm not sure where to make this request.
> >
> > Should it be on the Checkstyle Github repo or will I have to make three
> > separate requests, one for each of the above?
> >
> > The feature is available on the CLI using the -g option.
> >
> > I intend to use this during the Maven build, not from my code.
> >
> > Since I already had Ant configured to do exactly that, I preferred to use
> > the Ant Run plugin to reproduce the functionality within Maven.
> >
> > The pom file is located at:
> >
> > https://github.com/Fernal73/DSAlgos/blob/master/pom.xml
> >
> > I have no interest in creating my own plugin given the attendant issues
> of
> > maintaining it and for just this feature.
> >
> > This should really be part of the Maven, Ant and Gradle configurations.
> >
> > Perhaps, it's because the feature is still considered experimental and
> > there's no pressure from users to add the ability to generate Xpath
> > suppressions in the other ways to use Checkstyle.
> >
> > I find it very useful, though although it's complicated to set it up in
> its
> > current Avatar.
> >
> > Regards,
> > Linus.
> >
> >
> >
> >
> > On Thu, 25 Jun 2020, 11:56 Benjamin Marwell,  wrote:
> >
> > > Well, you could write your own plugin which has checkstyle as a
> dependency.
> > > But it might be the easiest to just create a PR for the checkstyle
> plugin.
> > > The checkstyle plugin is maintained by maven. So why not just create a
> > > feature request?
> > >
> > > Also, where do you want to execute the "new goal"? In the maven build
> > > or inside your java code? This will also make a difference.
> > > If it is the latter, you can just pull in the plugin as a regular
> > > dependency.
> > > You can make it optional or provided (or both) if you do not need it at
> > > runtime.
> > >
> > > Am Do., 25. Juni 2020 um 03:49 Uhr schrieb LINUS FERNANDES
> > > :
> > > >
> > > > My usecase is that I need to execute a feature available in
> Checkstyle
> > > > that's not provided as a goal in its plugin.
> > > >
> > > > For that, I need access to the dependency classpath (latest version
> > > > always).
> > > >
> > > > Then I can execute the feature using the Ant Run plugin.
> > > >
> > > >
> > > >
> > > >
> > > > On Thu, 25 Jun 2020, 06:51 LINUS FERNANDES, <
> linus.fernan...@gmail.com>
> > > > wrote:
> > > >
> > > > > Is it possible to generate a classpath for a dependency not placed
> in
> > > the
> > > > > dependencyManagement and/or dependencies section but is attached
> to a
> > > > > plugin used by the project?
> > > > >
> > > > > I know it's possible to generate a path to the local repository and
> > > look
> > > > > for the latest version directory and specify the jars under it but
> is
> > > there
> > > > > any other way to do this preferably via a Maven plugin and one of
> its
> > > goals?
> > > > >
> > > > > build-classpath from the Maven dependency plugin will only generate
> > > > > classpaths for dependencies listed in the project's dependencies,
> not a
> > > > > plugin's direct dependencies.
> > > > >
> > > > > I don't wish to add a plugin's specific dependencies to the
> project's
> > > > > dependencies.
> > > > >
> > > > > Regards,
> > > > > Linus.
> > > > >
> > >
> > > -
> > > To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> > > For additional commands, e-mail: users-h...@maven.apache.org
> > >
> > >
>
> -
> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> For additional commands, e-mail: users-h...@maven.apache.org
>
>


Re: Access or generate a classpath for dependency not in any scope but attached to plugin.

2020-06-25 Thread Benjamin Marwell
Feature requests can be created here:
https://issues.apache.org/jira/projects/MCHECKSTYLE

You are welcome to create a pull request.

Looking at the ant configuration, you could just use the plugin
classpath in your java task:
https://maven.apache.org/plugins/maven-antrun-plugin/examples/classpaths.html


Am Do., 25. Juni 2020 um 09:16 Uhr schrieb LINUS FERNANDES
:
>
> I would like to create a feature request---evidently.
>
> This is something that impacts the ant and Gradle tasks as well.
>
> I'm not sure where to make this request.
>
> Should it be on the Checkstyle Github repo or will I have to make three
> separate requests, one for each of the above?
>
> The feature is available on the CLI using the -g option.
>
> I intend to use this during the Maven build, not from my code.
>
> Since I already had Ant configured to do exactly that, I preferred to use
> the Ant Run plugin to reproduce the functionality within Maven.
>
> The pom file is located at:
>
> https://github.com/Fernal73/DSAlgos/blob/master/pom.xml
>
> I have no interest in creating my own plugin given the attendant issues of
> maintaining it and for just this feature.
>
> This should really be part of the Maven, Ant and Gradle configurations.
>
> Perhaps, it's because the feature is still considered experimental and
> there's no pressure from users to add the ability to generate Xpath
> suppressions in the other ways to use Checkstyle.
>
> I find it very useful, though although it's complicated to set it up in its
> current Avatar.
>
> Regards,
> Linus.
>
>
>
>
> On Thu, 25 Jun 2020, 11:56 Benjamin Marwell,  wrote:
>
> > Well, you could write your own plugin which has checkstyle as a dependency.
> > But it might be the easiest to just create a PR for the checkstyle plugin.
> > The checkstyle plugin is maintained by maven. So why not just create a
> > feature request?
> >
> > Also, where do you want to execute the "new goal"? In the maven build
> > or inside your java code? This will also make a difference.
> > If it is the latter, you can just pull in the plugin as a regular
> > dependency.
> > You can make it optional or provided (or both) if you do not need it at
> > runtime.
> >
> > Am Do., 25. Juni 2020 um 03:49 Uhr schrieb LINUS FERNANDES
> > :
> > >
> > > My usecase is that I need to execute a feature available in Checkstyle
> > > that's not provided as a goal in its plugin.
> > >
> > > For that, I need access to the dependency classpath (latest version
> > > always).
> > >
> > > Then I can execute the feature using the Ant Run plugin.
> > >
> > >
> > >
> > >
> > > On Thu, 25 Jun 2020, 06:51 LINUS FERNANDES, 
> > > wrote:
> > >
> > > > Is it possible to generate a classpath for a dependency not placed in
> > the
> > > > dependencyManagement and/or dependencies section but is attached to a
> > > > plugin used by the project?
> > > >
> > > > I know it's possible to generate a path to the local repository and
> > look
> > > > for the latest version directory and specify the jars under it but is
> > there
> > > > any other way to do this preferably via a Maven plugin and one of its
> > goals?
> > > >
> > > > build-classpath from the Maven dependency plugin will only generate
> > > > classpaths for dependencies listed in the project's dependencies, not a
> > > > plugin's direct dependencies.
> > > >
> > > > I don't wish to add a plugin's specific dependencies to the project's
> > > > dependencies.
> > > >
> > > > Regards,
> > > > Linus.
> > > >
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> > For additional commands, e-mail: users-h...@maven.apache.org
> >
> >

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



Re: Access or generate a classpath for dependency not in any scope but attached to plugin.

2020-06-25 Thread LINUS FERNANDES
As you can see, I'm using the build-classpath goal to generate the
classpath to be used by the Java ant task.
Unfortunately, filtering by artifactIds on the goal gives me only the main
Checkstyle jar and not the path to the supporting jars.
Is there any way around specifying the full classpath of the project while
including the supporting jars?

On Thu, 25 Jun 2020, 12:46 LINUS FERNANDES, 
wrote:

> I would like to create a feature request---evidently.
>
> This is something that impacts the ant and Gradle tasks as well.
>
> I'm not sure where to make this request.
>
> Should it be on the Checkstyle Github repo or will I have to make three
> separate requests, one for each of the above?
>
> The feature is available on the CLI using the -g option.
>
> I intend to use this during the Maven build, not from my code.
>
> Since I already had Ant configured to do exactly that, I preferred to use
> the Ant Run plugin to reproduce the functionality within Maven.
>
> The pom file is located at:
>
> https://github.com/Fernal73/DSAlgos/blob/master/pom.xml
>
> I have no interest in creating my own plugin given the attendant issues of
> maintaining it and for just this feature.
>
> This should really be part of the Maven, Ant and Gradle configurations.
>
> Perhaps, it's because the feature is still considered experimental and
> there's no pressure from users to add the ability to generate Xpath
> suppressions in the other ways to use Checkstyle.
>
> I find it very useful, though although it's complicated to set it up in
> its current Avatar.
>
> Regards,
> Linus.
>
>
>
>
> On Thu, 25 Jun 2020, 11:56 Benjamin Marwell,  wrote:
>
>> Well, you could write your own plugin which has checkstyle as a
>> dependency.
>> But it might be the easiest to just create a PR for the checkstyle plugin.
>> The checkstyle plugin is maintained by maven. So why not just create a
>> feature request?
>>
>> Also, where do you want to execute the "new goal"? In the maven build
>> or inside your java code? This will also make a difference.
>> If it is the latter, you can just pull in the plugin as a regular
>> dependency.
>> You can make it optional or provided (or both) if you do not need it at
>> runtime.
>>
>> Am Do., 25. Juni 2020 um 03:49 Uhr schrieb LINUS FERNANDES
>> :
>> >
>> > My usecase is that I need to execute a feature available in Checkstyle
>> > that's not provided as a goal in its plugin.
>> >
>> > For that, I need access to the dependency classpath (latest version
>> > always).
>> >
>> > Then I can execute the feature using the Ant Run plugin.
>> >
>> >
>> >
>> >
>> > On Thu, 25 Jun 2020, 06:51 LINUS FERNANDES, 
>> > wrote:
>> >
>> > > Is it possible to generate a classpath for a dependency not placed in
>> the
>> > > dependencyManagement and/or dependencies section but is attached to a
>> > > plugin used by the project?
>> > >
>> > > I know it's possible to generate a path to the local repository and
>> look
>> > > for the latest version directory and specify the jars under it but is
>> there
>> > > any other way to do this preferably via a Maven plugin and one of its
>> goals?
>> > >
>> > > build-classpath from the Maven dependency plugin will only generate
>> > > classpaths for dependencies listed in the project's dependencies, not
>> a
>> > > plugin's direct dependencies.
>> > >
>> > > I don't wish to add a plugin's specific dependencies to the project's
>> > > dependencies.
>> > >
>> > > Regards,
>> > > Linus.
>> > >
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
>> For additional commands, e-mail: users-h...@maven.apache.org
>>
>>


Re: Access or generate a classpath for dependency not in any scope but attached to plugin.

2020-06-25 Thread LINUS FERNANDES
I would like to create a feature request---evidently.

This is something that impacts the ant and Gradle tasks as well.

I'm not sure where to make this request.

Should it be on the Checkstyle Github repo or will I have to make three
separate requests, one for each of the above?

The feature is available on the CLI using the -g option.

I intend to use this during the Maven build, not from my code.

Since I already had Ant configured to do exactly that, I preferred to use
the Ant Run plugin to reproduce the functionality within Maven.

The pom file is located at:

https://github.com/Fernal73/DSAlgos/blob/master/pom.xml

I have no interest in creating my own plugin given the attendant issues of
maintaining it and for just this feature.

This should really be part of the Maven, Ant and Gradle configurations.

Perhaps, it's because the feature is still considered experimental and
there's no pressure from users to add the ability to generate Xpath
suppressions in the other ways to use Checkstyle.

I find it very useful, though although it's complicated to set it up in its
current Avatar.

Regards,
Linus.




On Thu, 25 Jun 2020, 11:56 Benjamin Marwell,  wrote:

> Well, you could write your own plugin which has checkstyle as a dependency.
> But it might be the easiest to just create a PR for the checkstyle plugin.
> The checkstyle plugin is maintained by maven. So why not just create a
> feature request?
>
> Also, where do you want to execute the "new goal"? In the maven build
> or inside your java code? This will also make a difference.
> If it is the latter, you can just pull in the plugin as a regular
> dependency.
> You can make it optional or provided (or both) if you do not need it at
> runtime.
>
> Am Do., 25. Juni 2020 um 03:49 Uhr schrieb LINUS FERNANDES
> :
> >
> > My usecase is that I need to execute a feature available in Checkstyle
> > that's not provided as a goal in its plugin.
> >
> > For that, I need access to the dependency classpath (latest version
> > always).
> >
> > Then I can execute the feature using the Ant Run plugin.
> >
> >
> >
> >
> > On Thu, 25 Jun 2020, 06:51 LINUS FERNANDES, 
> > wrote:
> >
> > > Is it possible to generate a classpath for a dependency not placed in
> the
> > > dependencyManagement and/or dependencies section but is attached to a
> > > plugin used by the project?
> > >
> > > I know it's possible to generate a path to the local repository and
> look
> > > for the latest version directory and specify the jars under it but is
> there
> > > any other way to do this preferably via a Maven plugin and one of its
> goals?
> > >
> > > build-classpath from the Maven dependency plugin will only generate
> > > classpaths for dependencies listed in the project's dependencies, not a
> > > plugin's direct dependencies.
> > >
> > > I don't wish to add a plugin's specific dependencies to the project's
> > > dependencies.
> > >
> > > Regards,
> > > Linus.
> > >
>
> -
> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> For additional commands, e-mail: users-h...@maven.apache.org
>
>


Re: Access or generate a classpath for dependency not in any scope but attached to plugin.

2020-06-25 Thread Benjamin Marwell
Well, you could write your own plugin which has checkstyle as a dependency.
But it might be the easiest to just create a PR for the checkstyle plugin.
The checkstyle plugin is maintained by maven. So why not just create a
feature request?

Also, where do you want to execute the "new goal"? In the maven build
or inside your java code? This will also make a difference.
If it is the latter, you can just pull in the plugin as a regular dependency.
You can make it optional or provided (or both) if you do not need it at runtime.

Am Do., 25. Juni 2020 um 03:49 Uhr schrieb LINUS FERNANDES
:
>
> My usecase is that I need to execute a feature available in Checkstyle
> that's not provided as a goal in its plugin.
>
> For that, I need access to the dependency classpath (latest version
> always).
>
> Then I can execute the feature using the Ant Run plugin.
>
>
>
>
> On Thu, 25 Jun 2020, 06:51 LINUS FERNANDES, 
> wrote:
>
> > Is it possible to generate a classpath for a dependency not placed in the
> > dependencyManagement and/or dependencies section but is attached to a
> > plugin used by the project?
> >
> > I know it's possible to generate a path to the local repository and look
> > for the latest version directory and specify the jars under it but is there
> > any other way to do this preferably via a Maven plugin and one of its goals?
> >
> > build-classpath from the Maven dependency plugin will only generate
> > classpaths for dependencies listed in the project's dependencies, not a
> > plugin's direct dependencies.
> >
> > I don't wish to add a plugin's specific dependencies to the project's
> > dependencies.
> >
> > Regards,
> > Linus.
> >

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



Re: Access or generate a classpath for dependency not in any scope but attached to plugin.

2020-06-24 Thread LINUS FERNANDES
My usecase is that I need to execute a feature available in Checkstyle
that's not provided as a goal in its plugin.

For that, I need access to the dependency classpath (latest version
always).

Then I can execute the feature using the Ant Run plugin.




On Thu, 25 Jun 2020, 06:51 LINUS FERNANDES, 
wrote:

> Is it possible to generate a classpath for a dependency not placed in the
> dependencyManagement and/or dependencies section but is attached to a
> plugin used by the project?
>
> I know it's possible to generate a path to the local repository and look
> for the latest version directory and specify the jars under it but is there
> any other way to do this preferably via a Maven plugin and one of its goals?
>
> build-classpath from the Maven dependency plugin will only generate
> classpaths for dependencies listed in the project's dependencies, not a
> plugin's direct dependencies.
>
> I don't wish to add a plugin's specific dependencies to the project's
> dependencies.
>
> Regards,
> Linus.
>


Access or generate a classpath for dependency not in any scope but attached to plugin.

2020-06-24 Thread LINUS FERNANDES
Is it possible to generate a classpath for a dependency not placed in the
dependencyManagement and/or dependencies section but is attached to a
plugin used by the project?

I know it's possible to generate a path to the local repository and look
for the latest version directory and specify the jars under it but is there
any other way to do this preferably via a Maven plugin and one of its goals?

build-classpath from the Maven dependency plugin will only generate
classpaths for dependencies listed in the project's dependencies, not a
plugin's direct dependencies.

I don't wish to add a plugin's specific dependencies to the project's
dependencies.

Regards,
Linus.


How maven assembly plugin auto-resolves classpath conflicts (example case)

2018-05-22 Thread Michał Siatkowski
Hello.

I have found this to be an issue while migrating a project from Maven to
SBT.
SBT is only here for reference since it reports what I think should be
reported.

To describe the problem I have created an example project with dependencies
that I found to behave differently, depending on the build tool.
https://github.com/atais/mvn-sbt-assembly

The only dependencies are (sbt style)

"com.netflix.astyanax" % "astyanax-cassandra" % "3.9.0",
"org.apache.cassandra" % "cassandra-all" % "3.4",

and what I do not understand is, why mvn package creates the fat jar
successfully, while sbt assembly gives conflicts:

[error] 39 errors were encountered during merge
[error] java.lang.RuntimeException: deduplicate: different file contents
found in the following:
[error]
/home/siatkowskim/.ivy2/cache/org.slf4j/jcl-over-slf4j/jars/jcl-over-slf4j-1.7.7.jar:org/apache/commons/logging/
[error]
/home/siatkowskim/.ivy2/cache/commons-logging/commons-logging/jars/commons-logging-1.1.1.jar:org/apache/commons/logging/
...
[error]
/home/siatkowskim/.ivy2/cache/com.github.stephenc.high-scale-lib/high-scale-lib/jars/high-scale-lib-1.1.2.jar:org/cliffc/high_scale_lib/
[error]
/home/siatkowskim/.ivy2/cache/com.boundary/high-scale-lib/jars/high-scale-lib-1.0.6.jar:org/cliffc/high_scale_lib/
...

How come Maven knows which class to take?
How can it be sure, that it is the correct choice?

There is a question on SO, if you would like to earn some points:
https://stackoverflow.com/questions/50249818/why-maven-assembly-works-when-sbt-assembly-find-conflicts

I have been directed here, from
https://issues.apache.org/jira/projects/MASSEMBLY/issues/MASSEMBLY-887


Re: maven parallel build has intermittent compile error, dependency not added to classpath

2018-05-17 Thread Vivi An
Thanks Dan. Figured out there is a maven-install-plugin:install-files in a 
child pom. So far builds going well. 

Regards,
~ Vivi 

On 5/16/18, 9:26 PM, "Vivi An"  wrote:

Great info. Thanks a lot Dan! 
I don’t see we use any plugin with aggregate goal though, we have around 
120 modules. Wondering how did you pinpoint an internal aggregated plugin?

Thanks again.

Regards,
~ Vivi 

On 5/16/18, 8:30 PM, "Dan Tran"  wrote:

this may help

https://urldefense.proofpoint.com/v2/url?u=http-3A__maven.40175.n5.nabble.com_Hickup-2Din-2Dmulti-2Dthread-2Dbuild-2Dtd5865974.html-23a5866778=DwIFaQ=uilaK90D4TOVoH58JNXRgQ=tYDcStj6mDsTbB35bXONhA=ndqnOoT0h3pNv5piTqZToyi1Oy-8DK6a0XSE7qoM9xI=3BHnnNgvo0syM0ZRgoLw0i-d0xUqJxSoJHjLYl7Wueo=

-D

On Wed, May 16, 2018 at 1:49 PM, Vivi An  wrote:

> Hi all,
>
> Hit intermittent compile error after enabling maven parallel build,
> complains about symbol not found.  Checked the log, it’s not caused by
> racing issue of multithread downloading, though that’s another 
problem even
> with Takari extension. Problem is in case of failure, the dependency 
in the
> pom was not added to the compile path of the project,  the dependency 
tree
> looks correct, did not find a way to enforce injecting pom dependency 
paths
> to class path for the project. I tried with both maven compiler 
plugin 3.1
> and 3.7.0. Wondering if anybody in the list hits similar issue or 
have any
> idea about this.
>
> Thanks for help
> Regards,
> ~ Vivi
>



?B�CB�?�?[��X��ܚX�K??K[XZ[?�?\�\��][��X��ܚX�P?X]�[��\?X�?K�ܙ�B��܈?Y??]?[ۘ[??��[X[�?�??K[XZ[?�?\�\��Z?[???X]�[��\?X�?K�ܙ�B


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


Re: maven parallel build has intermittent compile error, dependency not added to classpath

2018-05-16 Thread Vivi An
Great info. Thanks a lot Dan! 
I don’t see we use any plugin with aggregate goal though, we have around 120 
modules. Wondering how did you pinpoint an internal aggregated plugin?

Thanks again.

Regards,
~ Vivi 

On 5/16/18, 8:30 PM, "Dan Tran"  wrote:

this may help

https://urldefense.proofpoint.com/v2/url?u=http-3A__maven.40175.n5.nabble.com_Hickup-2Din-2Dmulti-2Dthread-2Dbuild-2Dtd5865974.html-23a5866778=DwIFaQ=uilaK90D4TOVoH58JNXRgQ=tYDcStj6mDsTbB35bXONhA=ndqnOoT0h3pNv5piTqZToyi1Oy-8DK6a0XSE7qoM9xI=3BHnnNgvo0syM0ZRgoLw0i-d0xUqJxSoJHjLYl7Wueo=

-D

On Wed, May 16, 2018 at 1:49 PM, Vivi An  wrote:

> Hi all,
>
> Hit intermittent compile error after enabling maven parallel build,
> complains about symbol not found.  Checked the log, it’s not caused by
> racing issue of multithread downloading, though that’s another problem 
even
> with Takari extension. Problem is in case of failure, the dependency in 
the
> pom was not added to the compile path of the project,  the dependency tree
> looks correct, did not find a way to enforce injecting pom dependency 
paths
> to class path for the project. I tried with both maven compiler plugin 3.1
> and 3.7.0. Wondering if anybody in the list hits similar issue or have any
> idea about this.
>
> Thanks for help
> Regards,
> ~ Vivi
>




Re: maven parallel build has intermittent compile error, dependency not added to classpath

2018-05-16 Thread Dan Tran
this may help
http://maven.40175.n5.nabble.com/Hickup-in-multi-thread-build-td5865974.html#a5866778

-D

On Wed, May 16, 2018 at 1:49 PM, Vivi An  wrote:

> Hi all,
>
> Hit intermittent compile error after enabling maven parallel build,
> complains about symbol not found.  Checked the log, it’s not caused by
> racing issue of multithread downloading, though that’s another problem even
> with Takari extension. Problem is in case of failure, the dependency in the
> pom was not added to the compile path of the project,  the dependency tree
> looks correct, did not find a way to enforce injecting pom dependency paths
> to class path for the project. I tried with both maven compiler plugin 3.1
> and 3.7.0. Wondering if anybody in the list hits similar issue or have any
> idea about this.
>
> Thanks for help
> Regards,
> ~ Vivi
>


maven parallel build has intermittent compile error, dependency not added to classpath

2018-05-16 Thread Vivi An
Hi all,

Hit intermittent compile error after enabling maven parallel build, complains 
about symbol not found.  Checked the log, it’s not caused by racing issue of 
multithread downloading, though that’s another problem even with Takari 
extension. Problem is in case of failure, the dependency in the pom was not 
added to the compile path of the project,  the dependency tree looks correct, 
did not find a way to enforce injecting pom dependency paths to class path for 
the project. I tried with both maven compiler plugin 3.1 and 3.7.0. Wondering 
if anybody in the list hits similar issue or have any idea about this.

Thanks for help
Regards,
~ Vivi


download dependencies and ouput build classpath

2018-03-27 Thread Jon Harper
Hi list,

Is there a way to tell maven to download all dependencies and output a
classpath for a given artifact (or a list of artifacts) without having to
create a project and its pom ?

The use case is to prototype or check classes with jshell. I would ideally
want something like https://stackoverflow.com/a/47715029/2748664 but
without a pom:

Something like:
jshell --class-path $( mvn dependency:build-classpath -DincludeTypes=jar \
-Dartifacts=\
com.fasterxml.jackson.core:jackson-databind:2.9.4,\
org.apache.commons:commons-lang3:3.7\
-q -Dmdep.outputFile=/dev/stdout
)

I've seen try-artifact or the maven-jshell-plugin but I want to use
something simpler (and more composable)

Thanks in advance,
Jon

ps: it would also be useful to be able to display the dependency:tree of a
given artifact without a pom. I suspect many more commands could be
usefull. I'm mentioning this since it's the same maven-dependency-plugin..


Re: maven-artifact-transfer: How to build the classpath for arbitrary GAVs?

2017-11-22 Thread Andreas Sewe
Hi Robert,

> have a look at
> https://maven.apache.org/shared/maven-artifact-transfer/comparison.html
> that should explain the difference between type/package/file-extension
> 
> If it is still not clear enough, please help imrpove the documentation.

One way to improve the documentation is to show what Packages these
types come from (the type Artifact is not exactly unique in Maven-land).

It would also help if these concepts (Dependency, Artifact,
MavenProject) could be related to their Artifact Transfer
"counterparts": ArtifactCoordinate and DependableCoordinate, which I
assume are meant as thin abstractions over the concepts from Maven core
-- although I am not sure.

> I can't explain why you only get a subset of the dependencies.
> It looks like only the compile+runtime dependencies are selected.

Yes, stepping through the actual resolver implementation I found that
the DefaultDependencyCollector gets a DependencySelector from the
current RepositorySession. And that selector excludes the "test" and
"provided" scopes.

So using my own ScopeFilter doesn't matter, as it is only used during
the "resolve" step of resolveDependencies. But the test- and provided
scoped dependencies don't make it that far; they are filtered out during
the "collect dependencies" step by the *session's* DependencySelector.

(AFAICT, there's no way to customize the RepositorySession used by
maven-artifact-transfer, right?)

> There should be no specific logic for this in maven-artifact-transfer,
> since this project is meant to be only a bridge to any Aether
> implementation.

I know have a working Aether based implementation which doesn't even
need to change the DependencySelector, thanks to an explicit
ArtifactDescriptorRequest.

Here's the gist:

  ArtifactDescriptorRequest descriptorRequest = new
  ArtifactDescriptorRequest();
  descriptorRequest.setArtifact(artifact);
  ArtifactDescriptorResult descriptorResult =
  system.readArtifactDescriptor(session, descriptorRequest);

  CollectRequest collectRequest = new CollectRequest();
  collectRequest.setRootArtifact(descriptorResult.getArtifact());
  collectRequest.setDependencies(descriptorResult.getDependencies());
  collectRequest.setManagedDependencies(
  descriptorResult.getManagedDependencies());

  DependencyFilter filter =
  DependencyFilterUtils.classpathFilter(JavaScopes.TEST);
  DependencyRequest dependencyRequest =
  new DependencyRequest(collectRequest, filter);
  system.resolveDependencies(session, dependencyRequest);

The key bit seems to be the explicit CollectRequest.setDependencies
call. If I construct the CollectRequest with a single root dependency
instead...

  CollectRequest collectRequest =
  new CollectRequest(new Dependency(artifact, "test"), repos);

...then my final list of resolved dependencies contains the artifact
itself but *not* its test-scoped dependencies. The problem seems to be
that we are "off by one level" in the dependency graph. As my root
artifact is itself already a Dependency, its test-scoped dependencies
are excluded per the normal scoping rules for *transitive* dependencies
[1]. And test-scoped transitive dependencies are never included.

Hope this makes sense.

As to what it means for maven-artifact-transfer: If you really want to
support this use case (I'm fine with limiting myself to new Maven
Resolver versions; I don't have to use the facade), then you need to
support artifact descriptor requests as well. I could then use the
four-argument version of DependencyResolver.resolveDependencies.

Best wishes,

Andreas

[1]




signature.asc
Description: OpenPGP digital signature


Re: maven-artifact-transfer: How to build the classpath for arbitrary GAVs?

2017-11-21 Thread Robert Scholte

Hi Andreas,

have a look at
https://maven.apache.org/shared/maven-artifact-transfer/comparison.html
that should explain the difference between type/package/file-extension

If it is still not clear enough, please help imrpove the documentation.  
There's a reason why it is not yet a 1.0.0.


I can't explain why you only get a subset of the dependencies.
It looks like only the compile+runtime dependencies are selected.

There should be no specific logic for this in maven-artifact-transfer,  
since this project is meant to be only a bridge to any Aether  
implementation.


thanks,
Robert

On Tue, 21 Nov 2017 15:28:43 +0100, Andreas Sewe  
<s...@st.informatik.tu-darmstadt.de> wrote:



Hi Robert,

thank you for the pointer.


This should be the information you were looking for,


Alas, the information doesn't quite solve my problems -- but maybe I'm
just being obtuse.

Let's say I want to built (and resolve) the test-scoped classpath of
org.apache.maven.shared:maven-artifact-transfer:0.9.1. All I have is
this coordinate.

What I do:

  DefaultDependableCoordinate coord = new DefaultDependableCoordinate();
  coord.setGroupId("org.apache.maven.shared");
  coord.setGroupId("maven-artifact-transfer");
  coord.setVersion("0.9.1");
  dependencyResolver.resolveDependencies(
session.getProjectBuildingRequest(), coord, null);

This gives the following list of artifacts (sorted, to allow for better
comparison):


commons-codec:commons-codec:jar:1.6
commons-io:commons-io:jar:2.5
org.apache.maven.shared:maven-artifact-transfer:jar:0.9.1
org.apache.maven.shared:maven-common-artifact-filters:jar:3.0.1
org.apache.maven.shared:maven-shared-utils:jar:3.1.0
org.apache.maven:maven-aether-provider:jar:3.0
org.apache.maven:maven-artifact:jar:3.0
org.apache.maven:maven-core:jar:3.0
org.apache.maven:maven-model-builder:jar:3.0
org.apache.maven:maven-model:jar:3.0
org.apache.maven:maven-plugin-api:jar:3.0
org.apache.maven:maven-repository-metadata:jar:3.0
org.apache.maven:maven-settings-builder:jar:3.0
org.apache.maven:maven-settings:jar:3.0
org.codehaus.plexus:plexus-classworlds:jar:2.2.3
org.codehaus.plexus:plexus-component-annotations:jar:1.7.1
org.codehaus.plexus:plexus-interpolation:jar:1.14
org.codehaus.plexus:plexus-utils:jar:3.0.24
org.slf4j:slf4j-api:jar:1.7.5
org.sonatype.aether:aether-api:jar:1.7
org.sonatype.aether:aether-impl:jar:1.7
org.sonatype.aether:aether-spi:jar:1.7
org.sonatype.aether:aether-util:jar:1.7
org.sonatype.plexus:plexus-cipher:jar:1.4
org.sonatype.plexus:plexus-sec-dispatcher:jar:1.3
org.sonatype.sisu:sisu-guice:jar:noaop:2.1.7
org.sonatype.sisu:sisu-inject-bean:jar:1.4.2
org.sonatype.sisu:sisu-inject-plexus:jar:1.4.2


This differs quite a bit from what "mvn dependency:list" outputs when
run on a SVN checkout of the maven-artifact-transfer project:


commons-codec:commons-codec:jar:1.6:compile
commons-io:commons-io:jar:2.5:compile
junit:junit:jar:4.11:test
org.apache.maven.shared:maven-common-artifact-filters:jar:3.0.1:compile
org.apache.maven.shared:maven-shared-utils:jar:3.1.0:compile
org.apache.maven:maven-aether-provider:jar:3.0:runtime
org.apache.maven:maven-artifact:jar:3.0:compile
org.apache.maven:maven-core:jar:3.0:compile
org.apache.maven:maven-model-builder:jar:3.0:compile
org.apache.maven:maven-model:jar:3.0:compile
org.apache.maven:maven-plugin-api:jar:3.0:compile
org.apache.maven:maven-repository-metadata:jar:3.0:compile
org.apache.maven:maven-settings-builder:jar:3.0:compile
org.apache.maven:maven-settings:jar:3.0:compile
org.codehaus.plexus:plexus-classworlds:jar:2.2.3:compile
org.codehaus.plexus:plexus-component-annotations:jar:1.7.1:compile
org.codehaus.plexus:plexus-interpolation:jar:1.14:compile
org.codehaus.plexus:plexus-utils:jar:3.0.24:compile
org.eclipse.aether:aether-api:jar:0.9.0.M2:provided
org.eclipse.aether:aether-impl:jar:0.9.0.M2:provided
org.eclipse.aether:aether-spi:jar:0.9.0.M2:provided
org.eclipse.aether:aether-util:jar:0.9.0.M2:compile
org.hamcrest:hamcrest-core:jar:1.3:test
org.slf4j:slf4j-api:jar:1.7.5:compile
org.sonatype.aether:aether-api:jar:1.7:provided
org.sonatype.aether:aether-impl:jar:1.7:test
org.sonatype.aether:aether-spi:jar:1.7:test
org.sonatype.aether:aether-util:jar:1.7:provided
org.sonatype.plexus:plexus-cipher:jar:1.4:compile
org.sonatype.plexus:plexus-sec-dispatcher:jar:1.3:compile
org.sonatype.sisu:sisu-guice:jar:noaop:2.1.7:compile
org.sonatype.sisu:sisu-inject-bean:jar:1.4.2:compile
org.sonatype.sisu:sisu-inject-plexus:jar:1.4.2:compile


The list returned by resolveDependencies contains
maven-artifact-transfer (fine), but lacks *some* test-scoped
dependencies (like junit:junit:4.11), while others like
org.sonatype.aether:aether-impl:1.7 are included. However, a lot of
provided-scoped dependency (org.eclipse.aether) are missing, but some
are present (org.sonatype.aether).

Can you explain to me what's going on here? I feel like I am missing an
important conceptual bit.

In a sim

Re: maven-artifact-transfer: How to build the classpath for arbitrary GAVs?

2017-11-21 Thread Andreas Sewe
Hi Robert,

thank you for the pointer.

> This should be the information you were looking for,

Alas, the information doesn't quite solve my problems -- but maybe I'm
just being obtuse.

Let's say I want to built (and resolve) the test-scoped classpath of
org.apache.maven.shared:maven-artifact-transfer:0.9.1. All I have is
this coordinate.

What I do:

  DefaultDependableCoordinate coord = new DefaultDependableCoordinate();
  coord.setGroupId("org.apache.maven.shared");
  coord.setGroupId("maven-artifact-transfer");
  coord.setVersion("0.9.1");
  dependencyResolver.resolveDependencies(
session.getProjectBuildingRequest(), coord, null);

This gives the following list of artifacts (sorted, to allow for better
comparison):

> commons-codec:commons-codec:jar:1.6
> commons-io:commons-io:jar:2.5
> org.apache.maven.shared:maven-artifact-transfer:jar:0.9.1
> org.apache.maven.shared:maven-common-artifact-filters:jar:3.0.1
> org.apache.maven.shared:maven-shared-utils:jar:3.1.0
> org.apache.maven:maven-aether-provider:jar:3.0
> org.apache.maven:maven-artifact:jar:3.0
> org.apache.maven:maven-core:jar:3.0
> org.apache.maven:maven-model-builder:jar:3.0
> org.apache.maven:maven-model:jar:3.0
> org.apache.maven:maven-plugin-api:jar:3.0
> org.apache.maven:maven-repository-metadata:jar:3.0
> org.apache.maven:maven-settings-builder:jar:3.0
> org.apache.maven:maven-settings:jar:3.0
> org.codehaus.plexus:plexus-classworlds:jar:2.2.3
> org.codehaus.plexus:plexus-component-annotations:jar:1.7.1
> org.codehaus.plexus:plexus-interpolation:jar:1.14
> org.codehaus.plexus:plexus-utils:jar:3.0.24
> org.slf4j:slf4j-api:jar:1.7.5
> org.sonatype.aether:aether-api:jar:1.7
> org.sonatype.aether:aether-impl:jar:1.7
> org.sonatype.aether:aether-spi:jar:1.7
> org.sonatype.aether:aether-util:jar:1.7
> org.sonatype.plexus:plexus-cipher:jar:1.4
> org.sonatype.plexus:plexus-sec-dispatcher:jar:1.3
> org.sonatype.sisu:sisu-guice:jar:noaop:2.1.7
> org.sonatype.sisu:sisu-inject-bean:jar:1.4.2
> org.sonatype.sisu:sisu-inject-plexus:jar:1.4.2

This differs quite a bit from what "mvn dependency:list" outputs when
run on a SVN checkout of the maven-artifact-transfer project:

> commons-codec:commons-codec:jar:1.6:compile
> commons-io:commons-io:jar:2.5:compile
> junit:junit:jar:4.11:test
> org.apache.maven.shared:maven-common-artifact-filters:jar:3.0.1:compile
> org.apache.maven.shared:maven-shared-utils:jar:3.1.0:compile
> org.apache.maven:maven-aether-provider:jar:3.0:runtime
> org.apache.maven:maven-artifact:jar:3.0:compile
> org.apache.maven:maven-core:jar:3.0:compile
> org.apache.maven:maven-model-builder:jar:3.0:compile
> org.apache.maven:maven-model:jar:3.0:compile
> org.apache.maven:maven-plugin-api:jar:3.0:compile
> org.apache.maven:maven-repository-metadata:jar:3.0:compile
> org.apache.maven:maven-settings-builder:jar:3.0:compile
> org.apache.maven:maven-settings:jar:3.0:compile
> org.codehaus.plexus:plexus-classworlds:jar:2.2.3:compile
> org.codehaus.plexus:plexus-component-annotations:jar:1.7.1:compile
> org.codehaus.plexus:plexus-interpolation:jar:1.14:compile
> org.codehaus.plexus:plexus-utils:jar:3.0.24:compile
> org.eclipse.aether:aether-api:jar:0.9.0.M2:provided
> org.eclipse.aether:aether-impl:jar:0.9.0.M2:provided
> org.eclipse.aether:aether-spi:jar:0.9.0.M2:provided
> org.eclipse.aether:aether-util:jar:0.9.0.M2:compile
> org.hamcrest:hamcrest-core:jar:1.3:test
> org.slf4j:slf4j-api:jar:1.7.5:compile
> org.sonatype.aether:aether-api:jar:1.7:provided
> org.sonatype.aether:aether-impl:jar:1.7:test
> org.sonatype.aether:aether-spi:jar:1.7:test
> org.sonatype.aether:aether-util:jar:1.7:provided
> org.sonatype.plexus:plexus-cipher:jar:1.4:compile
> org.sonatype.plexus:plexus-sec-dispatcher:jar:1.3:compile
> org.sonatype.sisu:sisu-guice:jar:noaop:2.1.7:compile
> org.sonatype.sisu:sisu-inject-bean:jar:1.4.2:compile
> org.sonatype.sisu:sisu-inject-plexus:jar:1.4.2:compile

The list returned by resolveDependencies contains
maven-artifact-transfer (fine), but lacks *some* test-scoped
dependencies (like junit:junit:4.11), while others like
org.sonatype.aether:aether-impl:1.7 are included. However, a lot of
provided-scoped dependency (org.eclipse.aether) are missing, but some
are present (org.sonatype.aether).

Can you explain to me what's going on here? I feel like I am missing an
important conceptual bit.

In a similar vein, can you enlighten me what the "type" of a
DependableCoordinate is? In particular, how does it differ from the
extension or packaging?

Best wishes,

Andreas



signature.asc
Description: OpenPGP digital signature


Re: maven-artifact-transfer: How to build the classpath for arbitrary GAVs?

2017-11-20 Thread Robert Scholte

Hi Andreas,

DependencyResolver is indeed the correct class to use.
Any of the overloaded methods will do: When you have the dependecy, you  
can use it directly.
In other cases use DependableCoordinate, which represents an instance that  
can contain dependencies.

That can either be a MavenProject, Dependency or Plugin.

To control the scope you need to specify a filter, in your case the  
ScopeFilter[1]


This should be the information you were looking for,
Robert

[1]  
https://maven.apache.org/shared/maven-common-artifact-filters/apidocs/org/apache/maven/shared/artifact/filter/resolve/ScopeFilter.html


On Mon, 20 Nov 2017 17:08:19 +0100, Andreas Sewe  
<s...@st.informatik.tu-darmstadt.de> wrote:

Hi,

I am currently struggling with the maven-artifact-transfer 0.9.1 API.
Here's what I am trying to accomplish: Given an arbitrary GAV and a
scope (compile or test), construct the compile- or test-scoped flat
classpath for that GAV.

DependencyResolver seems to be the class I am after, but I haven't found
 out whether to use the Dependency-based or DependableCoordinate-based
overload of resolveDependencies (the Model-based overload won't work, as
I have just a GAV and no Model for it). Also, I haven't figured out how
to specify the scope I am after (dependency:build-classpath doesn't use
maven-artifact-transfer but rather get its information out of the
current project's Model).

And pointers are greatly appreciated.

Best wishes,

Andreas


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



maven-artifact-transfer: How to build the classpath for arbitrary GAVs?

2017-11-20 Thread Andreas Sewe
Hi,

I am currently struggling with the maven-artifact-transfer 0.9.1 API.
Here's what I am trying to accomplish: Given an arbitrary GAV and a
scope (compile or test), construct the compile- or test-scoped flat
classpath for that GAV.

DependencyResolver seems to be the class I am after, but I haven't found
 out whether to use the Dependency-based or DependableCoordinate-based
overload of resolveDependencies (the Model-based overload won't work, as
I have just a GAV and no Model for it). Also, I haven't figured out how
to specify the scope I am after (dependency:build-classpath doesn't use
maven-artifact-transfer but rather get its information out of the
current project's Model).

And pointers are greatly appreciated.

Best wishes,

Andreas



signature.asc
Description: OpenPGP digital signature


RE: How to add class file to build & classpath?

2017-04-06 Thread Robert Patrick
> Unfortunately the code uses compiled classes from other modules.  So I can't 
> change the phase to prior to compile, if I do that then it doesn't generate 
> the sources.

In a multi-module project, Maven processes the modules in order (the exception 
being when running an aggregate plugin) so as long as you don’t have cyclical 
dependencies between modules (or between the generated classes and the source 
files within the same module), this shouldn’t matter.  Notice in my little 
sample project output (below) how the install plugin runs in each module before 
the next module in the reactor is processed.  Subsequent modules should 
explicitly declare their dependencies on previously built modules in the normal 
way and these dependencies come from the local Maven repository when the 
Classpath is built.

What am I missing?
Robert

C:\test\maven-test\multi-module-test>mvn clean install
[INFO] Scanning for projects...
[INFO] 
[INFO] Reactor Build Order:
[INFO]
[INFO] multi-module-test
[INFO] generator
[INFO] consumer
[INFO]
[INFO] 
[INFO] Building multi-module-test 1.0
[INFO] 
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ multi-module-test ---
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) @ 
multi-module-test ---
[INFO] Installing C:\test\maven-test\multi-module-test\pom.xml to C:\Users\RPATR
ICK\.m2\repository\test\multi-module-test\1.0\multi-module-test-1.0.pom
[INFO]
[INFO] 
[INFO] Building generator 1.0
[INFO] 
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ generator ---
[INFO] Deleting C:\test\maven-test\multi-module-test\generator\target
[INFO]
[INFO] --- maven-resources-plugin:3.0.2:resources (default-resources) @ generato
r ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-resources-plugin:3.0.2:copy-resources (generate-classes) @ gene
rator ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ generator ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-resources-plugin:3.0.2:testResources (default-testResources) @
generator ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory 
C:\test\maven-test\multi-module-test\generator\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ 
generator ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to 
C:\test\maven-test\multi-module-test\generator\target\test-classes
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ generator ---
[INFO] Surefire report directory: 
C:\test\maven-test\multi-module-test\generator\target\surefire-reports

---
 T E S T S
---
Running test.generated.MyGeneratedClassTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.064 sec

Results :

Tests run: 1, Failures: 0, Errors: 0, Skipped: 0

[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ generator ---
[INFO] Building jar: 
C:\test\maven-test\multi-module-test\generator\target\generator-1.0.jar
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) @ generator ---
[INFO] Installing 
C:\test\maven-test\multi-module-test\generator\target\generator-1.0.jar to 
C:\Users\RPATRICK\.m2\repository\test\generator\1.0\generator-1.0.jar
[INFO] Installing C:\test\maven-test\multi-module-test\generator\pom.xml to 
C:\Users\RPATRICK\.m2\repository\test\generator\1.0\generator-1.0.pom
[INFO]
[INFO] 
[INFO] Building consumer 1.0
[INFO] 
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ consumer ---
[INFO] Deleting C:\test\maven-test\multi-module-test\consumer\target
[INFO]
[INFO] --- maven-resources-plugin:3.0.2:resources (default-resources) @ consumer
 ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\test\maven-test\multi-module-test\
consumer\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ consumer ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to C:\test\maven-test\multi-module-test\consumer\
target\classes
[INFO]
[INFO] --- maven-resources-plugin:3.0.2:testResources (default-testResources) @
consumer ---
[INFO] 

Re: How to add class file to build & classpath?

2017-04-06 Thread David Hoffer
I'll try to reply to the last 3 posts...

Unfortunately the code uses compiled classes from other modules.  So I
can't change the phase to prior to compile, if I do that then it doesn't
generate the sources.

I did find a way to generate sources instead of class files as I agree that
is a lot nicer...its not quite as easy as javassist but close enough.

However I could not find any combination of moving phases around/etc to
make this work...as I mentioned above if I changed the exec plugin phase to
be prior to compile then it didn't do anything so there was no generated
sources to compile.  It seems Maven just just does not like subprocesses
that generate more sources using the compiled code.

I will look at the above sample projects to see what I missed.

For now I have changed things so that I put my generated code right in the
src/main/java folder then wrap the exec plugin in a profile so I can
manually run that when needed.  Not ideal but its working.  Will
investigate the other projects.

-Dave

On Thu, Apr 6, 2017 at 1:27 PM, Robert Patrick <robert.patr...@oracle.com>
wrote:

> I also built a little sample project where I simulated a generated class
> using the maven-resources-plugin to copy a class into the target/classes
> directory during the process-resources phase.  My unit test in that module
> works fine and the other module that consumes that class (via a normal
> dependency) works fine in a multi-module build.  Maybe the issue you are
> having can be solved by simply moving the exec-maven-plugin execution to
> the process-resources phase?
>
>
>
> -Original Message-
> From: David Hoffer [mailto:dhoff...@gmail.com]
> Sent: Thursday, April 06, 2017 12:45 PM
> To: Maven Users List
> Subject: Re: How to add class file to build & classpath?
>
> Yes that is the location the class file(s) are being created in.  And yes
> I am binding the exec-maven-plugin to the compile phase in my pom (see
> prior email).  Also the class(s) file is being included in the resulting
> jar.
> However all this is not sufficient for Maven to notice the class(s) file
> was generated and add to the build and classpath.
>
> I think part of the reason is that in multi-module maven builds it does
> not use the jars for the classpath but rather the pre-jar content (not 100%
> certain of that).  However I don't know why Maven doesn't add/use all files
> in the ./target/classes folder but only uses files that it put there itself.
>
> What am I missing here?  It seems this should just work because the files
> are in the ./target/classes folder.
>
> -Dave
>
> On Thu, Apr 6, 2017 at 10:55 AM, Robert Patrick <robert.patr...@oracle.com
> >
> wrote:
>
> > Can't you generated class files in the expected location (in
> > ${project.build.directory}/classes directory) during the compile phase?
> > I would expect these classes to be included in classpath for later
> > pahses and in the JAR created during the packaging phase of the module
> > build (assuming packaging type is "jar").  Have you tried that?
> >
> >
> >
> > -Original Message-
> > From: Curtis Rueden [mailto:ctrue...@wisc.edu]
> > Sent: Thursday, April 06, 2017 11:34 AM
> > To: Maven Users List
> > Subject: Re: How to add class file to build & classpath?
> >
> > Hi Dave,
> >
> > > I'm using exec-maven-plugin to call a main in my code that uses
> > > javassist to generate a class file at build time.
> >
> > The more common pattern is to generate .java source files, and then
> > include them in the build.
> >
> > Since you are generating .class file(s), could you do it in a separate
> > module of a multi-module build, then add that module as a dependency
> > to your main project module?
> >
> > Could you post an MCVE, particularly your POM, which shows your
> > current approach?
> >
> > Regards,
> > Curtis
> >
> > --
> > Curtis Rueden
> > LOCI software architect - https://urldefense.proofpoint.
> com/v2/url?u=https-3A__urldefense.proofpoint=DwIBaQ=
> RoP1YumCXCgaWHvlZYR8PQcxBKCX5YTpkKY057SbK10=
> Ql5uwmbofQMW0iErugdCnFgO-CBGr_pt_OzwdxJosG0=hpzCbX-p3CruRsEhA_
> MZO805q6XsrzWSSqkZCm7IfAs=K-Fe2PmitKUNWXWy2vB1JvN-Ih5TBC0VwxThPwDenU8=
> .
> > com/v2/url?u=https-3A__loci.wisc.edu_software=DwIBaQ=
> > RoP1YumCXCgaWHvlZYR8PQcxBKCX5YTpkKY057SbK10=
> > Ql5uwmbofQMW0iErugdCnFgO-CBGr_pt_OzwdxJosG0=
> > sAgPJflD39NrfRATxD1qVSvbRHcZlzbPxQqHpteGc0M=
> > yDl8PjVnueV1WAKs6W36AGN5yriHr-5eTXTPZi_k0kk=
> > ImageJ2 lead, Fiji maintainer - https://urldefense.proofpoint.
> com/v2/url?u=https-3A__urldefense.proofpoint=DwIBaQ=
> RoP1YumCXCgaWHvlZYR8PQcxBKCX5YTpkKY057SbK10=
> Ql

RE: How to add class file to build & classpath?

2017-04-06 Thread Robert Patrick
I also built a little sample project where I simulated a generated class using 
the maven-resources-plugin to copy a class into the target/classes directory 
during the process-resources phase.  My unit test in that module works fine and 
the other module that consumes that class (via a normal dependency) works fine 
in a multi-module build.  Maybe the issue you are having can be solved by 
simply moving the exec-maven-plugin execution to the process-resources phase?



-Original Message-
From: David Hoffer [mailto:dhoff...@gmail.com] 
Sent: Thursday, April 06, 2017 12:45 PM
To: Maven Users List
Subject: Re: How to add class file to build & classpath?

Yes that is the location the class file(s) are being created in.  And yes I am 
binding the exec-maven-plugin to the compile phase in my pom (see prior email). 
 Also the class(s) file is being included in the resulting jar.
However all this is not sufficient for Maven to notice the class(s) file was 
generated and add to the build and classpath.

I think part of the reason is that in multi-module maven builds it does not use 
the jars for the classpath but rather the pre-jar content (not 100% certain of 
that).  However I don't know why Maven doesn't add/use all files in the 
./target/classes folder but only uses files that it put there itself.

What am I missing here?  It seems this should just work because the files are 
in the ./target/classes folder.

-Dave

On Thu, Apr 6, 2017 at 10:55 AM, Robert Patrick <robert.patr...@oracle.com>
wrote:

> Can't you generated class files in the expected location (in 
> ${project.build.directory}/classes directory) during the compile phase?
> I would expect these classes to be included in classpath for later 
> pahses and in the JAR created during the packaging phase of the module 
> build (assuming packaging type is "jar").  Have you tried that?
>
>
>
> -Original Message-
> From: Curtis Rueden [mailto:ctrue...@wisc.edu]
> Sent: Thursday, April 06, 2017 11:34 AM
> To: Maven Users List
> Subject: Re: How to add class file to build & classpath?
>
> Hi Dave,
>
> > I'm using exec-maven-plugin to call a main in my code that uses 
> > javassist to generate a class file at build time.
>
> The more common pattern is to generate .java source files, and then 
> include them in the build.
>
> Since you are generating .class file(s), could you do it in a separate 
> module of a multi-module build, then add that module as a dependency 
> to your main project module?
>
> Could you post an MCVE, particularly your POM, which shows your 
> current approach?
>
> Regards,
> Curtis
>
> --
> Curtis Rueden
> LOCI software architect - 
> https://urldefense.proofpoint.com/v2/url?u=https-3A__urldefense.proofpoint=DwIBaQ=RoP1YumCXCgaWHvlZYR8PQcxBKCX5YTpkKY057SbK10=Ql5uwmbofQMW0iErugdCnFgO-CBGr_pt_OzwdxJosG0=hpzCbX-p3CruRsEhA_MZO805q6XsrzWSSqkZCm7IfAs=K-Fe2PmitKUNWXWy2vB1JvN-Ih5TBC0VwxThPwDenU8=
>  .
> com/v2/url?u=https-3A__loci.wisc.edu_software=DwIBaQ=
> RoP1YumCXCgaWHvlZYR8PQcxBKCX5YTpkKY057SbK10=
> Ql5uwmbofQMW0iErugdCnFgO-CBGr_pt_OzwdxJosG0=
> sAgPJflD39NrfRATxD1qVSvbRHcZlzbPxQqHpteGc0M=
> yDl8PjVnueV1WAKs6W36AGN5yriHr-5eTXTPZi_k0kk=
> ImageJ2 lead, Fiji maintainer - 
> https://urldefense.proofpoint.com/v2/url?u=https-3A__urldefense.proofpoint=DwIBaQ=RoP1YumCXCgaWHvlZYR8PQcxBKCX5YTpkKY057SbK10=Ql5uwmbofQMW0iErugdCnFgO-CBGr_pt_OzwdxJosG0=hpzCbX-p3CruRsEhA_MZO805q6XsrzWSSqkZCm7IfAs=K-Fe2PmitKUNWXWy2vB1JvN-Ih5TBC0VwxThPwDenU8=
>  .
> com/v2/url?u=https-3A__imagej.net_User-3ARueden=DwIBaQ=
> RoP1YumCXCgaWHvlZYR8PQcxBKCX5YTpkKY057SbK10=
> Ql5uwmbofQMW0iErugdCnFgO-CBGr_pt_OzwdxJosG0=
> sAgPJflD39NrfRATxD1qVSvbRHcZlzbPxQqHpteGc0M=
> biFYk60WuoVvD5FQonUNvMwQmBxfAOcXn6XyvvRRVDw=
>
>
> On Thu, Apr 6, 2017 at 10:48 AM, David Hoffer <dhoff...@gmail.com> wrote:
>
> > I'm using exec-maven-plugin to call a main in my code that uses 
> > javassist to generate a class file at build time.  My code places 
> > the class file in the ./target/classes folder so it gets included in 
> > the modules normal binary jar.
> >
> > However the rest of the build and other code needs to know that the 
> > class exists.  I've added that module/artifact as a dependency but 
> > the build
> and
> > the runtime classpath has no idea that class exists.
> >
> > How do I add it to the build and runtime classpath?
> >
> > -Dave
> >
>
> -
> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> For additional commands, e-mail: users-h...@maven.apache.org
>
>

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



Re: How to add class file to build & classpath?

2017-04-06 Thread Curtis Rueden
Hi Dave,

I cooked up an example of the multi-module approach which I hope helps:

https://github.com/ctrueden/adhoc-classes

The adhoc-dependency modules just generates a class file by some arbitrary
means via the exec-maven-plugin. In my case, this is a shell script which
calls javac, but in your case it will be your javassist-based approach of
course.

The main-project module depends on the adhoc-dependency module just fine,
and is able to see the generated class without issue.

Does it work for you?

Regards,
Curtis

--
Curtis Rueden
LOCI software architect - https://loci.wisc.edu/software
ImageJ2 lead, Fiji maintainer - https://imagej.net/User:Rueden


On Thu, Apr 6, 2017 at 12:45 PM, David Hoffer <dhoff...@gmail.com> wrote:

> Yes that is the location the class file(s) are being created in.  And yes I
> am binding the exec-maven-plugin to the compile phase in my pom (see prior
> email).  Also the class(s) file is being included in the resulting jar.
> However all this is not sufficient for Maven to notice the class(s) file
> was generated and add to the build and classpath.
>
> I think part of the reason is that in multi-module maven builds it does not
> use the jars for the classpath but rather the pre-jar content (not 100%
> certain of that).  However I don't know why Maven doesn't add/use all files
> in the ./target/classes folder but only uses files that it put there
> itself.
>
> What am I missing here?  It seems this should just work because the files
> are in the ./target/classes folder.
>
> -Dave
>
> On Thu, Apr 6, 2017 at 10:55 AM, Robert Patrick <robert.patr...@oracle.com
> >
> wrote:
>
> > Can't you generated class files in the expected location (in
> > ${project.build.directory}/classes directory) during the compile phase?
> > I would expect these classes to be included in classpath for later pahses
> > and in the JAR created during the packaging phase of the module build
> > (assuming packaging type is "jar").  Have you tried that?
> >
> >
> >
> > -Original Message-
> > From: Curtis Rueden [mailto:ctrue...@wisc.edu]
> > Sent: Thursday, April 06, 2017 11:34 AM
> > To: Maven Users List
> > Subject: Re: How to add class file to build & classpath?
> >
> > Hi Dave,
> >
> > > I'm using exec-maven-plugin to call a main in my code that uses
> > > javassist to generate a class file at build time.
> >
> > The more common pattern is to generate .java source files, and then
> > include them in the build.
> >
> > Since you are generating .class file(s), could you do it in a separate
> > module of a multi-module build, then add that module as a dependency to
> > your main project module?
> >
> > Could you post an MCVE, particularly your POM, which shows your current
> > approach?
> >
> > Regards,
> > Curtis
> >
> > --
> > Curtis Rueden
> > LOCI software architect - https://urldefense.proofpoint.
> > com/v2/url?u=https-3A__loci.wisc.edu_software=DwIBaQ=
> > RoP1YumCXCgaWHvlZYR8PQcxBKCX5YTpkKY057SbK10=
> > Ql5uwmbofQMW0iErugdCnFgO-CBGr_pt_OzwdxJosG0=
> > sAgPJflD39NrfRATxD1qVSvbRHcZlzbPxQqHpteGc0M=
> > yDl8PjVnueV1WAKs6W36AGN5yriHr-5eTXTPZi_k0kk=
> > ImageJ2 lead, Fiji maintainer - https://urldefense.proofpoint.
> > com/v2/url?u=https-3A__imagej.net_User-3ARueden=DwIBaQ=
> > RoP1YumCXCgaWHvlZYR8PQcxBKCX5YTpkKY057SbK10=
> > Ql5uwmbofQMW0iErugdCnFgO-CBGr_pt_OzwdxJosG0=
> > sAgPJflD39NrfRATxD1qVSvbRHcZlzbPxQqHpteGc0M=
> > biFYk60WuoVvD5FQonUNvMwQmBxfAOcXn6XyvvRRVDw=
> >
> >
> > On Thu, Apr 6, 2017 at 10:48 AM, David Hoffer <dhoff...@gmail.com>
> wrote:
> >
> > > I'm using exec-maven-plugin to call a main in my code that uses
> javassist
> > > to generate a class file at build time.  My code places the class file
> in
> > > the ./target/classes folder so it gets included in the modules normal
> > > binary jar.
> > >
> > > However the rest of the build and other code needs to know that the
> class
> > > exists.  I've added that module/artifact as a dependency but the build
> > and
> > > the runtime classpath has no idea that class exists.
> > >
> > > How do I add it to the build and runtime classpath?
> > >
> > > -Dave
> > >
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> > For additional commands, e-mail: users-h...@maven.apache.org
> >
> >
>


Re: How to add class file to build & classpath?

2017-04-06 Thread Russell Gold
Hi David,

Is this class generated from data files rather than compiled classes? If so, 
can you bind the plugin run with the generate-resources phase? That would make 
it available at compile time. 


> On Apr 6, 2017, at 11:48 AM, David Hoffer <dhoff...@gmail.com> wrote:
> 
> I'm using exec-maven-plugin to call a main in my code that uses javassist
> to generate a class file at build time.  My code places the class file in
> the ./target/classes folder so it gets included in the modules normal
> binary jar.
> 
> However the rest of the build and other code needs to know that the class
> exists.  I've added that module/artifact as a dependency but the build and
> the runtime classpath has no idea that class exists.
> 
> How do I add it to the build and runtime classpath?
> 
> -Dave


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



Re: How to add class file to build & classpath?

2017-04-06 Thread David Hoffer
Yes that is the location the class file(s) are being created in.  And yes I
am binding the exec-maven-plugin to the compile phase in my pom (see prior
email).  Also the class(s) file is being included in the resulting jar.
However all this is not sufficient for Maven to notice the class(s) file
was generated and add to the build and classpath.

I think part of the reason is that in multi-module maven builds it does not
use the jars for the classpath but rather the pre-jar content (not 100%
certain of that).  However I don't know why Maven doesn't add/use all files
in the ./target/classes folder but only uses files that it put there itself.

What am I missing here?  It seems this should just work because the files
are in the ./target/classes folder.

-Dave

On Thu, Apr 6, 2017 at 10:55 AM, Robert Patrick <robert.patr...@oracle.com>
wrote:

> Can't you generated class files in the expected location (in
> ${project.build.directory}/classes directory) during the compile phase?
> I would expect these classes to be included in classpath for later pahses
> and in the JAR created during the packaging phase of the module build
> (assuming packaging type is "jar").  Have you tried that?
>
>
>
> -Original Message-
> From: Curtis Rueden [mailto:ctrue...@wisc.edu]
> Sent: Thursday, April 06, 2017 11:34 AM
> To: Maven Users List
> Subject: Re: How to add class file to build & classpath?
>
> Hi Dave,
>
> > I'm using exec-maven-plugin to call a main in my code that uses
> > javassist to generate a class file at build time.
>
> The more common pattern is to generate .java source files, and then
> include them in the build.
>
> Since you are generating .class file(s), could you do it in a separate
> module of a multi-module build, then add that module as a dependency to
> your main project module?
>
> Could you post an MCVE, particularly your POM, which shows your current
> approach?
>
> Regards,
> Curtis
>
> --
> Curtis Rueden
> LOCI software architect - https://urldefense.proofpoint.
> com/v2/url?u=https-3A__loci.wisc.edu_software=DwIBaQ=
> RoP1YumCXCgaWHvlZYR8PQcxBKCX5YTpkKY057SbK10=
> Ql5uwmbofQMW0iErugdCnFgO-CBGr_pt_OzwdxJosG0=
> sAgPJflD39NrfRATxD1qVSvbRHcZlzbPxQqHpteGc0M=
> yDl8PjVnueV1WAKs6W36AGN5yriHr-5eTXTPZi_k0kk=
> ImageJ2 lead, Fiji maintainer - https://urldefense.proofpoint.
> com/v2/url?u=https-3A__imagej.net_User-3ARueden=DwIBaQ=
> RoP1YumCXCgaWHvlZYR8PQcxBKCX5YTpkKY057SbK10=
> Ql5uwmbofQMW0iErugdCnFgO-CBGr_pt_OzwdxJosG0=
> sAgPJflD39NrfRATxD1qVSvbRHcZlzbPxQqHpteGc0M=
> biFYk60WuoVvD5FQonUNvMwQmBxfAOcXn6XyvvRRVDw=
>
>
> On Thu, Apr 6, 2017 at 10:48 AM, David Hoffer <dhoff...@gmail.com> wrote:
>
> > I'm using exec-maven-plugin to call a main in my code that uses javassist
> > to generate a class file at build time.  My code places the class file in
> > the ./target/classes folder so it gets included in the modules normal
> > binary jar.
> >
> > However the rest of the build and other code needs to know that the class
> > exists.  I've added that module/artifact as a dependency but the build
> and
> > the runtime classpath has no idea that class exists.
> >
> > How do I add it to the build and runtime classpath?
> >
> > -Dave
> >
>
> -
> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> For additional commands, e-mail: users-h...@maven.apache.org
>
>


RE: How to add class file to build & classpath?

2017-04-06 Thread Robert Patrick
Can't you generated class files in the expected location (in 
${project.build.directory}/classes directory) during the compile phase?  I 
would expect these classes to be included in classpath for later pahses and in 
the JAR created during the packaging phase of the module build (assuming 
packaging type is "jar").  Have you tried that?



-Original Message-
From: Curtis Rueden [mailto:ctrue...@wisc.edu] 
Sent: Thursday, April 06, 2017 11:34 AM
To: Maven Users List
Subject: Re: How to add class file to build & classpath?

Hi Dave,

> I'm using exec-maven-plugin to call a main in my code that uses 
> javassist to generate a class file at build time.

The more common pattern is to generate .java source files, and then include 
them in the build.

Since you are generating .class file(s), could you do it in a separate module 
of a multi-module build, then add that module as a dependency to your main 
project module?

Could you post an MCVE, particularly your POM, which shows your current 
approach?

Regards,
Curtis

--
Curtis Rueden
LOCI software architect - 
https://urldefense.proofpoint.com/v2/url?u=https-3A__loci.wisc.edu_software=DwIBaQ=RoP1YumCXCgaWHvlZYR8PQcxBKCX5YTpkKY057SbK10=Ql5uwmbofQMW0iErugdCnFgO-CBGr_pt_OzwdxJosG0=sAgPJflD39NrfRATxD1qVSvbRHcZlzbPxQqHpteGc0M=yDl8PjVnueV1WAKs6W36AGN5yriHr-5eTXTPZi_k0kk=
ImageJ2 lead, Fiji maintainer - 
https://urldefense.proofpoint.com/v2/url?u=https-3A__imagej.net_User-3ARueden=DwIBaQ=RoP1YumCXCgaWHvlZYR8PQcxBKCX5YTpkKY057SbK10=Ql5uwmbofQMW0iErugdCnFgO-CBGr_pt_OzwdxJosG0=sAgPJflD39NrfRATxD1qVSvbRHcZlzbPxQqHpteGc0M=biFYk60WuoVvD5FQonUNvMwQmBxfAOcXn6XyvvRRVDw=
 


On Thu, Apr 6, 2017 at 10:48 AM, David Hoffer <dhoff...@gmail.com> wrote:

> I'm using exec-maven-plugin to call a main in my code that uses javassist
> to generate a class file at build time.  My code places the class file in
> the ./target/classes folder so it gets included in the modules normal
> binary jar.
>
> However the rest of the build and other code needs to know that the class
> exists.  I've added that module/artifact as a dependency but the build and
> the runtime classpath has no idea that class exists.
>
> How do I add it to the build and runtime classpath?
>
> -Dave
>

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



Re: How to add class file to build & classpath?

2017-04-06 Thread David Hoffer
Yes I know its more common to start with java source files but in this case
that is not possible unless someone knows how to generate sources from a
javassist generated CtClass.  If I could do that then yes I could just add
the sources instead of the class.

Here is the best I have so far and sort of works.  Since my class generator
writes to the target/classes folder I told the exec-maven-plugin that and
now it is part of the build as other modules can use the generated class
but its not a great solution as my IDE does not know about the class so it
shows errors.  So apparently IntelliJ's Maven support does not extend this
sort of exec-maven-plugin configuration.  I need to find a better way to do
this so IDE is happy as well.

Here is the relevant part of my pom.



org.codehaus.mojo
exec-maven-plugin
1.6.0


code-generator
compile

java



com.issinc.odin.display.metadata.generator.UiDisplayMetadataGenerator

true
true

${project.build.directory}/classes






-Dave



On Thu, Apr 6, 2017 at 10:34 AM, Curtis Rueden <ctrue...@wisc.edu> wrote:

> Hi Dave,
>
> > I'm using exec-maven-plugin to call a main in my code that uses
> > javassist to generate a class file at build time.
>
> The more common pattern is to generate .java source files, and then include
> them in the build.
>
> Since you are generating .class file(s), could you do it in a separate
> module of a multi-module build, then add that module as a dependency to
> your main project module?
>
> Could you post an MCVE, particularly your POM, which shows your current
> approach?
>
> Regards,
> Curtis
>
> --
> Curtis Rueden
> LOCI software architect - https://loci.wisc.edu/software
> ImageJ2 lead, Fiji maintainer - https://imagej.net/User:Rueden
>
>
> On Thu, Apr 6, 2017 at 10:48 AM, David Hoffer <dhoff...@gmail.com> wrote:
>
> > I'm using exec-maven-plugin to call a main in my code that uses javassist
> > to generate a class file at build time.  My code places the class file in
> > the ./target/classes folder so it gets included in the modules normal
> > binary jar.
> >
> > However the rest of the build and other code needs to know that the class
> > exists.  I've added that module/artifact as a dependency but the build
> and
> > the runtime classpath has no idea that class exists.
> >
> > How do I add it to the build and runtime classpath?
> >
> > -Dave
> >
>


Re: How to add class file to build & classpath?

2017-04-06 Thread Curtis Rueden
Hi Dave,

> I'm using exec-maven-plugin to call a main in my code that uses
> javassist to generate a class file at build time.

The more common pattern is to generate .java source files, and then include
them in the build.

Since you are generating .class file(s), could you do it in a separate
module of a multi-module build, then add that module as a dependency to
your main project module?

Could you post an MCVE, particularly your POM, which shows your current
approach?

Regards,
Curtis

--
Curtis Rueden
LOCI software architect - https://loci.wisc.edu/software
ImageJ2 lead, Fiji maintainer - https://imagej.net/User:Rueden


On Thu, Apr 6, 2017 at 10:48 AM, David Hoffer <dhoff...@gmail.com> wrote:

> I'm using exec-maven-plugin to call a main in my code that uses javassist
> to generate a class file at build time.  My code places the class file in
> the ./target/classes folder so it gets included in the modules normal
> binary jar.
>
> However the rest of the build and other code needs to know that the class
> exists.  I've added that module/artifact as a dependency but the build and
> the runtime classpath has no idea that class exists.
>
> How do I add it to the build and runtime classpath?
>
> -Dave
>


How to add class file to build & classpath?

2017-04-06 Thread David Hoffer
I'm using exec-maven-plugin to call a main in my code that uses javassist
to generate a class file at build time.  My code places the class file in
the ./target/classes folder so it gets included in the modules normal
binary jar.

However the rest of the build and other code needs to know that the class
exists.  I've added that module/artifact as a dependency but the build and
the runtime classpath has no idea that class exists.

How do I add it to the build and runtime classpath?

-Dave


Re: Maven Jar Plugin - Custom classpath with different style

2017-02-07 Thread Robert Scholte

Hi,

there's only a per-artifact transformation possible right now with one  
layout pattern.
You cannot apply a custom pattern on just a subset of artifacts, that  
would require several enhancements.


thanks,
Robert

On Mon, 06 Feb 2017 15:15:18 +0100, Rolf Rosenbaum, sdbn Solutions GmbH  
<rolf.rosenb...@sdbn-solutions.de> wrote:



Hi,

i have a question concerning the Maven Jar Plugin. Is it possible to  
create a classpath entry in the Manifest, which contains version numbers  
for foreign depencies ans no version number for dependencies of my own  
modules of a multi module project?


E.g.: Class-Path: module1.jar module2.jar libA-1.2.0.jar libB-2.0.0.jar

I tried to work with a custom classpath layout, but i get only either  
all dependencies with or without versionnumber.


Kind regards
Rolf


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



Maven Jar Plugin - Custom classpath with different style

2017-02-06 Thread Rolf Rosenbaum, sdbn Solutions GmbH
Hi,

i have a question concerning the Maven Jar Plugin. Is it possible to create a 
classpath entry in the Manifest, which contains version numbers for foreign 
depencies ans no version number for dependencies of my own modules of a multi 
module project?

E.g.: Class-Path: module1.jar module2.jar libA-1.2.0.jar libB-2.0.0.jar

I tried to work with a custom classpath layout, but i get only either all 
dependencies with or without versionnumber.

Kind regards
Rolf


mvn dependency:build-classpath not considering includeScope parameter

2017-02-04 Thread salilsurendran
`mvn dependency:build-classpath -DincludeScope=test` 

doesn't show test jars that have been added to the pom.xml 


  org.apache.spark
  spark-streaming_${scala.binary.version}
  ${project.version}


  org.apache.spark
  spark-streaming_${scala.binary.version}
  ${project.version}
  test-jar
  test


However, `mvn -f pom.xml dependency:tree|grep tests` does show these test
jars. Is this some kind of a bug in maven?

Using `mvn` from path: /usr/bin/mvn
[INFO] --- maven-dependency-plugin:2.10:tree (default-cli) @
java8-tests_2.10 ---
[INFO] org.apache.spark:java8-tests_2.10:pom:1.6.0-cdh5.11.0-SNAPSHOT
[INFO] |  |  +-
org.apache.avro:avro-ipc:jar:tests:1.7.6-cdh5.11.0-SNAPSHOT:compile
[INFO] +-
org.apache.spark:spark-core_2.10:test-jar:tests:1.6.0-cdh5.11.0-SNAPSHOT:test
[INFO] +-
org.apache.spark:spark-streaming_2.10:test-jar:tests:1.6.0-cdh5.11.0-SNAPSHOT:test

I am trying the above in a more complicated project mixing scala and java
code. On a simpler sample project this does work.



--
View this message in context: 
http://maven.40175.n5.nabble.com/mvn-dependency-build-classpath-not-considering-includeScope-parameter-tp5897291.html
Sent from the Maven - Users mailing list archive at Nabble.com.

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



Re: Compiler plugin & JDK 9 & classpath/modulepath question

2016-11-11 Thread Robert Scholte
On Wed, 09 Nov 2016 13:24:02 +0100, Matej Novotny <manov...@redhat.com>  
wrote:



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)


Right now there's no simple way to do that. While working on the  
modulepath I assumed that once people add the module-info, that they would  
also use auto modules by default to get a 100% pure module instead a  
hybrid.
I've talked with the jigsaw team and there are still some issues with  
transitive (jigsaw) modules, which might effect the current implementation.


I think it is good to track this, so could you add a jira issue at  
https://issues.apache.org/jira/browse/MCOMPILER ?




 => 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?


This is the ever returning question :) So in Java 9 jdeps is capable to  
generate a module-info template for you based on the code. It exports all  
packages, defines the requires and is often capable to detect which ones  
should be transitive, but is cannot detect the optionals. Be aware: this  
is a template, something to start with and which you MUST adjust. It is  
not an incremental tool.


Maven might create the "requires" part and know the optionals, but it  
cannot know about the transitivity (because it jigsaw transitive has a  
different definition than Maven transitive. They're still looking for a  
better keyword to prevent confusion, so any suggestion is welcome).


However, both Maven and the Jigsaw team need to come with a clear  
explanation, because dependencies and modules have different purposes.
I'll give it a try: dependencies resolve into coordinates of multiple  
files which will be added to the classpath (and with Java9 it could also  
be the module path). Having too much dependencies is not an issue, it is  
simply another jar on the path.
The "requires" of the module-info is there to enforce that certain files  
are available, either at compile time or at runtime.
So you can compare this as 2 partly overlapping circles. For the larger  
part is could be possible, but especially the parts that don't overlap are  
hard (impossible?) to identify.
It is very easy to add dependencies, but you never want any irrelevant  
"requires" inside your module-info.


I hope you understand that the purpose of dependencies and required  
modules are very different. Any attempt to try to solve this with magic is  
a potential failure. Any generated file must always be validated by the  
developer, there's no 1 to 1 translation.


Robert




Many thanks
Matej

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


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



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
>


maven dependency plugin - build-classpath goal

2016-11-03 Thread LEBOULANGER Aurélien
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


Removing classpath entries for shaded aritfacts

2016-04-16 Thread tic01
Hello Maven team,

I have the following scenario. I have several libraries which I am building,
and an application which depends on those libraries. While I am building
using the maven-jar-plugin, a manifest is created with several entries,
including the classpath, which naturally include all the libraries.

However, I am also trying to create a shaded version of my application which
shades the libraries I am building. What happens is that the libraries get
shaded fine, but the manifest still has the original classpath created by
the maven-jar-plugin embedded in it.

Is there a way to exclude the included shaded libraries from the manifest of
the shaded application jar?

Thanks



--
View this message in context: 
http://maven.40175.n5.nabble.com/Removing-classpath-entries-for-shaded-aritfacts-tp5865658.html
Sent from the Maven - Users mailing list archive at Nabble.com.

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



Re: How to run jar dependent on maven repo jars? How to extract dependent jars into folder to include in classpath?

2015-05-11 Thread Mark Eggers
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 5/11/2015 12:46 PM, Richard Catlin wrote:
 I built a jar using a pom.  The jar depends on jars in the maven 
 repository.  How do I run my jar and include the jars in the maven 
 repository in the classpath?  If it possible to extract all the
 dependent jars into a /lib directory that I can add to my classpath
 at runtime?
 
 Thanks. Richard
 

Richard,

I can think of two ways to do this.

1. Uber jar (I've not tried this)

See the Shade plugin at:
https://maven.apache.org/plugins/maven-shade-plugin/

2. Assembly plugin (this is what I do)

A. JAR Plugin
In your POM, configure the JAR plugin to contain three pieces of
information.

a) mainClass - this is obviously the class that has the main method
b) addClassPath - set this to true
c) classpathPrefix - I've set mine to lib

B. Dependency Plugin
In your POM, configure the dependency plugin to copy all of the
dependencies to the subdirectory of the target directory. The
subdirectory name should be the same as the classpathPrefix value

For example:

plugin
  groupIdorg.apache.maven.plugins/groupId
  artifactIdmaven-dependency-plugin/artifactId
  version2.8/version
  executions
execution
  phasepackage/phase
  goals
goalcopy-dependencies/goal
  /goals
  configuration
   outputDirectory${project.build.directory}/lib/outputDirectory
   includeScopecompile/includeScope
 /configuration
/execution
  /executions
/plugin

(This is an old project, update as appropriate).

C. Assembly Plugin

Configure the assembly plugin to create a zip file, tar.gz file,
whatever . . .

In src/main/assembly/assembly.xml, put in something like the following
(note that I've left out the namespaces for brevity):

assembly
idbin/id
formats
formattar.gz/format
formatzip/format
/formats
includeBaseDirectoryfalse/includeBaseDirectory
includeSiteDirectoryfalse/includeSiteDirectory
fileSets
fileSet
directorytarget/directory
outputDirectory/outputDirectory
includes
include*.jar/include
includelib//include
/includes
/fileSet
/fileSets
/assembly

C. Construct your package:

mvn package
mvn assembly:single

This will leave you a .tar.gz file and a .zip file (using the
assembly.xml above).

D. Unzip (or untar) and run

Now when you unarchive your .tar.gz file or .zip file, you'll end up
with a JAR file (your code) and a lib subdirectory with all of the
compile time dependencies. You should be able to run the JAR file from
the command line with:

java -jar [your-jar-file-name]

I'm a relative newcomer to Maven, but I hope this helps.

. . . just my two cents.
/mde/
-BEGIN PGP SIGNATURE-
Version: GnuPG v2

iQEcBAEBAgAGBQJVUQxCAAoJEEFGbsYNeTwtJ6MIAKdAktpSRvs8c+e8gxQSZ0Ce
zTGUi90FxH1tDS5BKhWVxAFH+UA6ZPA/rFl/UCG0S698ZDZ7CHBZbhp0AxDHZg8j
M9TvSOx0OauTiqubY4PmpYDE34oTSUVQPBvn7BQxgUa6PXLMNYTN+ex8OZzXpG7G
yWyU0IW5o1mHwo/zCOy7yetHPezRC0KGPiQc7esjpiubuwHWPOUebBNeiqD/0/Fg
iS0rIUDHOZaoryumYr9gFvRpQ0Tyorz/PT51f/6t0cceWNfgPls0yCxdQmzsaUVD
FA4Ck2fkIeAquRCmxdDOXtM5PKSVFj8Sd1O2OHkcYPMgCJm38GVd4fSfx17s+dU=
=MNr0
-END PGP SIGNATURE-

---
This email is free from viruses and malware because avast! Antivirus protection 
is active.
http://www.avast.com


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



Re: How to run jar dependent on maven repo jars? How to extract dependent jars into folder to include in classpath?

2015-05-11 Thread Anders Hammar
There is also the app assembly maven plugin:
http://mojo.codehaus.org/appassembler/appassembler-maven-plugin/

/Anders

On Mon, May 11, 2015 at 10:08 PM, Mark Eggers its_toas...@yahoo.com.invalid
 wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 On 5/11/2015 12:46 PM, Richard Catlin wrote:
  I built a jar using a pom.  The jar depends on jars in the maven
  repository.  How do I run my jar and include the jars in the maven
  repository in the classpath?  If it possible to extract all the
  dependent jars into a /lib directory that I can add to my classpath
  at runtime?
 
  Thanks. Richard
 

 Richard,

 I can think of two ways to do this.

 1. Uber jar (I've not tried this)

 See the Shade plugin at:
 https://maven.apache.org/plugins/maven-shade-plugin/

 2. Assembly plugin (this is what I do)

 A. JAR Plugin
 In your POM, configure the JAR plugin to contain three pieces of
 information.

 a) mainClass - this is obviously the class that has the main method
 b) addClassPath - set this to true
 c) classpathPrefix - I've set mine to lib

 B. Dependency Plugin
 In your POM, configure the dependency plugin to copy all of the
 dependencies to the subdirectory of the target directory. The
 subdirectory name should be the same as the classpathPrefix value

 For example:

 plugin
   groupIdorg.apache.maven.plugins/groupId
   artifactIdmaven-dependency-plugin/artifactId
   version2.8/version
   executions
 execution
   phasepackage/phase
   goals
 goalcopy-dependencies/goal
   /goals
   configuration
outputDirectory${project.build.directory}/lib/outputDirectory
includeScopecompile/includeScope
  /configuration
 /execution
   /executions
 /plugin

 (This is an old project, update as appropriate).

 C. Assembly Plugin

 Configure the assembly plugin to create a zip file, tar.gz file,
 whatever . . .

 In src/main/assembly/assembly.xml, put in something like the following
 (note that I've left out the namespaces for brevity):

 assembly
 idbin/id
 formats
 formattar.gz/format
 formatzip/format
 /formats
 includeBaseDirectoryfalse/includeBaseDirectory
 includeSiteDirectoryfalse/includeSiteDirectory
 fileSets
 fileSet
 directorytarget/directory
 outputDirectory/outputDirectory
 includes
 include*.jar/include
 includelib//include
 /includes
 /fileSet
 /fileSets
 /assembly

 C. Construct your package:

 mvn package
 mvn assembly:single

 This will leave you a .tar.gz file and a .zip file (using the
 assembly.xml above).

 D. Unzip (or untar) and run

 Now when you unarchive your .tar.gz file or .zip file, you'll end up
 with a JAR file (your code) and a lib subdirectory with all of the
 compile time dependencies. You should be able to run the JAR file from
 the command line with:

 java -jar [your-jar-file-name]

 I'm a relative newcomer to Maven, but I hope this helps.

 . . . just my two cents.
 /mde/
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v2

 iQEcBAEBAgAGBQJVUQxCAAoJEEFGbsYNeTwtJ6MIAKdAktpSRvs8c+e8gxQSZ0Ce
 zTGUi90FxH1tDS5BKhWVxAFH+UA6ZPA/rFl/UCG0S698ZDZ7CHBZbhp0AxDHZg8j
 M9TvSOx0OauTiqubY4PmpYDE34oTSUVQPBvn7BQxgUa6PXLMNYTN+ex8OZzXpG7G
 yWyU0IW5o1mHwo/zCOy7yetHPezRC0KGPiQc7esjpiubuwHWPOUebBNeiqD/0/Fg
 iS0rIUDHOZaoryumYr9gFvRpQ0Tyorz/PT51f/6t0cceWNfgPls0yCxdQmzsaUVD
 FA4Ck2fkIeAquRCmxdDOXtM5PKSVFj8Sd1O2OHkcYPMgCJm38GVd4fSfx17s+dU=
 =MNr0
 -END PGP SIGNATURE-

 ---
 This email is free from viruses and malware because avast! Antivirus
 protection is active.
 http://www.avast.com


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




How to run jar dependent on maven repo jars? How to extract dependent jars into folder to include in classpath?

2015-05-11 Thread Richard Catlin
I built a jar using a pom.  The jar depends on jars in the maven
repository.  How do I run my jar and include the jars in the maven
repository in the classpath?  If it possible to extract all the dependent
jars into a /lib directory that I can add to my classpath at runtime?

Thanks.
Richard


Re: Resolving classpath hell issues by allowing libraries to only use the version they request?

2015-01-06 Thread Stephen Connolly
On Monday, January 5, 2015, Kevin Burton bur...@spinn3r.com wrote:

 Breaking your application into smaller independent services may give you a
  way to reduce the number of conflicts related to these different
 transitive
  dependencies but that may not be as easy as testing your app with the
  updated versions or doing some research with the teams that are building
  with the old libraries to see if they will upgrade and run their
 acceptance
  tests within a time frame that meets your project's timeline
 requirements.


 I agree.  in this case the issue is testing. I need to embed cassandra so I
 can test it but it’s conflicting with spark.


Cassandra is not really designed for embedding. Better to start it in a
separate JVM which would allow controlling the classpath

Take a look at Cassandra-maven-plugin either as a solution or for some
example code for forking a JVM with Cassandra



 Ideally I could just start a container and I think that’s the way we’re
 going to evolve things.  Essentially, start a container for the daemons I
 need to test against and then make sure all my components work.  Then just
 kill the containers.

 —

 Founder/CEO Spinn3r.com
 Location: *San Francisco, CA*
 blog: http://burtonator.wordpress.com
 … or check out my Google+ profile
 https://plus.google.com/102718274791889610666/posts
 http://spinn3r.com



-- 
Sent from my phone


Re: Resolving classpath hell issues by allowing libraries to only use the version they request?

2015-01-05 Thread Mark Derricutt
On 6 Jan 2015, at 12:29, Kevin Burton wrote:

 I agree.  in this case the issue is testing. I need to embed cassandra so I
 can test it but it’s conflicting with spark.

As a total side issue - have you considered using Docker?

http://blog.xebia.com/2014/10/13/fast-and-easy-integration-testing-with-docker-and-overcast/

I'm sorely tempted to switch a lot of our integration tests over to using 
overcast, assuming I can create a local registry of docker images ( I believe 
Artifactory can do it, but not nexus (yet?) ).

Mark

-- 
Mark Derricutt
http://www.theoryinpractice.net
http://plus.google.com/+MarkDerricutt
http://twitter.com/talios
http://facebook.com/mderricutt


signature.asc
Description: OpenPGP digital signature


Re: Resolving classpath hell issues by allowing libraries to only use the version they request?

2015-01-05 Thread Ron Wheeler


You are right that jar hell and dll hell are not that easy to deal with.

OSGi is supposed to be a way to reduce this problem but IMHUO brings it 
own problems.


Most reputable projects are pretty careful about compatibility since it 
is really tough on developers if new versions break existing code.
Developers will just refuse to use the library if updates repeatedly 
break their code.


Breaking your application into smaller independent services may give you 
a way to reduce the number of conflicts related to these different 
transitive dependencies but that may not be as easy as testing your app 
with the updated versions or doing some research with the teams that are 
building with the old libraries to see if they will upgrade and run 
their acceptance tests within a time frame that meets your project's 
timeline requirements.


If the project is open source, you may be able to run the acceptance 
tests for the dependencies that use old libraries after you change their 
build to use later versions.
That would give you a higher level of confidence and perhaps be a bit of 
a pay-back to the team that is giving you a helpful library, if you give 
them the feedback.


Ron

On 05/01/2015 4:03 PM, Kevin Burton wrote:

I spent a ton of time tonight in classpath hell.

Basically, Apache Spark, Cassandra, and Cassandra Unit, and Guava, Jackson
JSON, and Jetty have an INSANE dependency graph.  They're all trampling on
each other with broken
dependencies.  This results in a lot of exclusion work to get them to use
sane bindings.

And it’s not necessarily anyone’s fault.  Library A will use library B
which depend on library C version 1.1 but then library D will use library C
which depends on 1.2…

I *mostly* end up with NoClassDefFoundException.

But I’m worried about other smaller bugs.  For example, if my library
wasn’t tested with a later version of a library it isn’t necessarily as
reliable out of the box since it wasn’t tested with that config.

Has anyone done any work with only allowing a library to use the version of
a class it requested?

If you release your library fully tested on version 1.1.1 of some library,
and
someone accidentally starts using 1.1.2 becuase of dependency hell, then
we're
going to break the build and introduce bugs.

So what would happen is every dependency would only be sourced from the
version you require.

This could be done via a hierarchical class loader. Of course this would
probably end up burning up some memory but probably worth it.

The main issue, is it WORTH it.. would this introduce new bugs?

For example, it’s possible that libraries could step on each other by
creating duplicate threads with the same names, or messing up system
properties.




--
Ron Wheeler
President
Artifact Software Inc
email: rwhee...@artifact-software.com
skype: ronaldmwheeler
phone: 866-970-2435, ext 102


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



Re: Resolving classpath hell issues by allowing libraries to only use the version they request?

2015-01-05 Thread Curtis Rueden
Hi Kevin,

I agree with Steven. One way of resolving this sort of problem without OSGi
is to use a consistent, meaningful versioning system such as Semantic
Versioning (http://semver.org/).  Once you have the ability to reason about
forwards and backwards compatibility, it is easier to resolve version
conflicts in a more reliable (ideally automated) way.

Of course, all the tools you are using do not necessarily abide by such
versioning standards. So then conflict resolution becomes more complicated.
Steven's suggestion of managing them upwards to the latest needed is
often good enough...

Regards,
Curtis

On Mon, Jan 5, 2015 at 3:20 PM, Steven Schlansker 
stevenschlans...@gmail.com wrote:


 On Jan 5, 2015, at 1:03 PM, Kevin Burton bur...@spinn3r.com wrote:

  I spent a ton of time tonight in classpath hell.
 
  Basically, Apache Spark, Cassandra, and Cassandra Unit, and Guava,
 Jackson
  JSON, and Jetty have an INSANE dependency graph.  They're all trampling
 on
  each other with broken
  dependencies.  This results in a lot of exclusion work to get them to
 use
  sane bindings.
 
  Has anyone done any work with only allowing a library to use the version
 of
  a class it requested?
 
  So what would happen is every dependency would only be sourced from the
  version you require.
 
  This could be done via a hierarchical class loader. Of course this would
  probably end up burning up some memory but probably worth it.
 
  The main issue, is it WORTH it.. would this introduce new bugs?

 You are basically talking about OSGi or some other such module system.
 https://en.wikipedia.org/wiki/OSGi

 In my opinion, it is actually easier to resolve the dependency conflicts
 among
 the modules (usually by managing them upwards to the latest needed by any
 dependency)
 and tracking this via a plugin [1]

 Having such complicated class loader situations just leads to even more
 subtle and confusing bugs IMO.

 [1] https://github.com/ning/maven-dependency-versions-check-plugin



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




Re: Resolving classpath hell issues by allowing libraries to only use the version they request?

2015-01-05 Thread Kevin Burton
Breaking your application into smaller independent services may give you a
 way to reduce the number of conflicts related to these different transitive
 dependencies but that may not be as easy as testing your app with the
 updated versions or doing some research with the teams that are building
 with the old libraries to see if they will upgrade and run their acceptance
 tests within a time frame that meets your project's timeline requirements.


I agree.  in this case the issue is testing. I need to embed cassandra so I
can test it but it’s conflicting with spark.

Ideally I could just start a container and I think that’s the way we’re
going to evolve things.  Essentially, start a container for the daemons I
need to test against and then make sure all my components work.  Then just
kill the containers.

—

Founder/CEO Spinn3r.com
Location: *San Francisco, CA*
blog: http://burtonator.wordpress.com
… or check out my Google+ profile
https://plus.google.com/102718274791889610666/posts
http://spinn3r.com


Re: Resolving classpath hell issues by allowing libraries to only use the version they request?

2015-01-05 Thread Ron Wheeler

On 05/01/2015 6:29 PM, Kevin Burton wrote:

Breaking your application into smaller independent services may give you a

way to reduce the number of conflicts related to these different transitive
dependencies but that may not be as easy as testing your app with the
updated versions or doing some research with the teams that are building
with the old libraries to see if they will upgrade and run their acceptance
tests within a time frame that meets your project's timeline requirements.


I agree.  in this case the issue is testing. I need to embed cassandra so I
can test it but it’s conflicting with spark.

These are both Apache projects that I don't know.
Have you asked the one using the older dependencies if they can upgrade 
their dependencies and run their acceptance tests?


Even if you have to download the sources and upgrade the dependencies 
and run their acceptance tests, this might be easier than trying to test 
your own application to the extent required to ensure that the software 
has no problems with the updated versions.

This assumes that these projects have strong test suites.

I would state your problems in the forum of the offending project. There 
might be a lot of enthusiasm for an upgrade.


Ron



Ideally I could just start a container and I think that’s the way we’re
going to evolve things.  Essentially, start a container for the daemons I
need to test against and then make sure all my components work.  Then just
kill the containers.

—

Founder/CEO Spinn3r.com
Location: *San Francisco, CA*
blog: http://burtonator.wordpress.com
… or check out my Google+ profile
https://plus.google.com/102718274791889610666/posts
http://spinn3r.com




--
Ron Wheeler
President
Artifact Software Inc
email: rwhee...@artifact-software.com
skype: ronaldmwheeler
phone: 866-970-2435, ext 102


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



Re: Resolving classpath hell issues by allowing libraries to only use the version they request?

2015-01-05 Thread Barrie Treloar
On 6 January 2015 at 14:50, Ron Wheeler rwhee...@artifact-software.com
wrote:

 On 05/01/2015 6:29 PM, Kevin Burton wrote:

 Breaking your application into smaller independent services may give you a

 way to reduce the number of conflicts related to these different
 transitive
 dependencies but that may not be as easy as testing your app with the
 updated versions or doing some research with the teams that are building
 with the old libraries to see if they will upgrade and run their
 acceptance
 tests within a time frame that meets your project's timeline
 requirements.


 I agree.  in this case the issue is testing. I need to embed cassandra so
 I
 can test it but it’s conflicting with spark.

 These are both Apache projects that I don't know.


Same.

Or alternatively from my brief reading of these two it appears that they
can run independently.
If you can avoid having them running in the same process you can separate
out your dependency hell.

This may be as simple as creating a new module to do your integration
testing and to control starting the external dependencies needed to do your
integration testing.


Resolving classpath hell issues by allowing libraries to only use the version they request?

2015-01-05 Thread Kevin Burton
I spent a ton of time tonight in classpath hell.

Basically, Apache Spark, Cassandra, and Cassandra Unit, and Guava, Jackson
JSON, and Jetty have an INSANE dependency graph.  They're all trampling on
each other with broken
dependencies.  This results in a lot of exclusion work to get them to use
sane bindings.

And it’s not necessarily anyone’s fault.  Library A will use library B
which depend on library C version 1.1 but then library D will use library C
which depends on 1.2…

I *mostly* end up with NoClassDefFoundException.

But I’m worried about other smaller bugs.  For example, if my library
wasn’t tested with a later version of a library it isn’t necessarily as
reliable out of the box since it wasn’t tested with that config.

Has anyone done any work with only allowing a library to use the version of
a class it requested?

If you release your library fully tested on version 1.1.1 of some library,
and
someone accidentally starts using 1.1.2 becuase of dependency hell, then
we're
going to break the build and introduce bugs.

So what would happen is every dependency would only be sourced from the
version you require.

This could be done via a hierarchical class loader. Of course this would
probably end up burning up some memory but probably worth it.

The main issue, is it WORTH it.. would this introduce new bugs?

For example, it’s possible that libraries could step on each other by
creating duplicate threads with the same names, or messing up system
properties.

-- 

Founder/CEO Spinn3r.com
Location: *San Francisco, CA*
blog: http://burtonator.wordpress.com
… or check out my Google+ profile
https://plus.google.com/102718274791889610666/posts
http://spinn3r.com


Re: Resolving classpath hell issues by allowing libraries to only use the version they request?

2015-01-05 Thread Steven Schlansker

On Jan 5, 2015, at 1:03 PM, Kevin Burton bur...@spinn3r.com wrote:

 I spent a ton of time tonight in classpath hell.
 
 Basically, Apache Spark, Cassandra, and Cassandra Unit, and Guava, Jackson
 JSON, and Jetty have an INSANE dependency graph.  They're all trampling on
 each other with broken
 dependencies.  This results in a lot of exclusion work to get them to use
 sane bindings.
 
 Has anyone done any work with only allowing a library to use the version of
 a class it requested?
 
 So what would happen is every dependency would only be sourced from the
 version you require.
 
 This could be done via a hierarchical class loader. Of course this would
 probably end up burning up some memory but probably worth it.
 
 The main issue, is it WORTH it.. would this introduce new bugs?

You are basically talking about OSGi or some other such module system.
https://en.wikipedia.org/wiki/OSGi

In my opinion, it is actually easier to resolve the dependency conflicts among
the modules (usually by managing them upwards to the latest needed by any 
dependency)
and tracking this via a plugin [1]

Having such complicated class loader situations just leads to even more subtle 
and confusing bugs IMO.

[1] https://github.com/ning/maven-dependency-versions-check-plugin



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



RE: Classpath issue in custom maven plugin

2014-09-16 Thread Martin Gainty
   

From: mgai...@hotmail.com
To: users@maven.apache.org
Subject: RE: Classpath issue in custom maven plugin
Date: Mon, 15 Sep 2014 18:49:41 -0400





Date: Mon, 15 Sep 2014 19:06:56 +0530
Subject: Classpath issue in custom maven plugin
From: kavita.gpt1...@gmail.com
To: users@maven.apache.org
CC: shailesh.man...@gmail.com

Hi!
I have created my own custom maven plugin(api-docs) for developing apiary 
blueprint. While triggering my custom plugin using m2Eclipse I am getting a 
classpath issue that classPath.getresources is fetching resources from plexus 
jar, while when I debug the swagger plugin (which I am taking as a reference) 
it is picking up the resources from rt.jar. In swagger I am getting 
web/target/classes in URLS but in my custom project I am not getting the  
web/target/classes in URLS. Code snippet is:
MGas previously mentioned...
If the tests pass on command line with maven 3.0.2 or newer but fail from m2e, 
please open a
bugreport in https://bugs.eclipse.org/bugs/enter_bug.cgi?product=m2e

Make sure to attach complete standalone example project and steps to reproduce 
the problem.

https://docs.sonatype.org/display/M2ECLIPSE/Runtime+classpath
MG

ClassLoader classLoader = 
Thread.currentThread().getContextClassLoader();
System.out.println(classLoader.getResources(com/abc/service/rest/resource));  
  assert classLoader != null;String path = packageName.replace('.', 
'/');EnumerationURL resources = classLoader.getResources(path);
My custom plugin's dependency tree is attached(apidocsTree.txt). I have 
integrated it in my other project i.e web. Here is the web pom configuration 
for the plugin.
plugin  groupIdcom.thed/groupId  
artifactIdapi-docs/artifactId  version1.0-SNAPSHOT/version  
configuration
packageNamecom.thed.service.rest.resource/packageName 
vmFileapiary.vm/vmFile
outputFileName${basedir}/target/apiary.apib/outputFileName
/configuration executions   execution 
phaseprepare-package/phase  goals 
goalgenerateApiDocs/goal
/goals/execution/executions   
 /plugin

I am taking swagger-plugin as a reference. Its dependency tree is attached as 
swaggerTree.txt. Its configuration in web is:plugin   
groupIdcom.github.kongchen/groupId   
artifactIdswagger-maven-plugin/artifactId   version1.0-SNAPSHOT/version 
   configurationapiSources   apiSource
apiPackagecom.thed.service.rest.resource/apiPackage 
apiVersionv1/apiVersion 
basePathhttp://localhost:8080/flex/services/rest/latest/basePath

outputTemplate${basedir}/src/site/docs/template/rest/zephyr_html.mustache/outputTemplate

outputPath${basedir}/src/main/webapp/data/rest-doc.html/outputPath  
 /apiSource  /apiSources/configurationexecutions   
execution  phaseprepare-package/phase   
goals  goalgenerate/goal   /goals   
/execution/executions/plugin
Please provide me the input to solve this classpath issue.​

-- 
Thanks, Kavita Gupta Agarwal


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

Classpath issue in custom maven plugin

2014-09-15 Thread Kavita Gupta
Hi!

I have created my own custom maven plugin(api-docs) for developing apiary
blueprint. While triggering my custom plugin using m2Eclipse I am getting a
classpath issue that classPath.getresources is fetching resources from
plexus jar, while when I debug the swagger plugin (which I am taking as a
reference) it is picking up the resources from rt.jar. In swagger I am
getting web/target/classes in URLS but in my custom project I am not
getting the  web/target/classes in URLS. Code snippet is:

ClassLoader classLoader =
Thread.currentThread().getContextClassLoader();


System.out.println(classLoader.getResources(com/abc/service/rest/resource));

assert classLoader != null;

String path = packageName.replace('.', '/');

EnumerationURL resources = classLoader.getResources(path);


My custom plugin's dependency tree is attached(apidocsTree.txt). I have
integrated it in my other project i.e web. Here is the web pom
configuration for the plugin.

plugin

  groupIdcom.thed/groupId

  artifactIdapi-docs/artifactId

  version1.0-SNAPSHOT/version

  configuration

packageNamecom.thed.service.rest.resource/packageName

vmFileapiary.vm/vmFile


outputFileName${basedir}/target/apiary.apib/outputFileName

  /configuration

 executions

execution

phaseprepare-package/phase

goals

goalgenerateApiDocs/goal

/goals

/execution

/executions

 /plugin



I am taking swagger-plugin as a reference. Its dependency tree is attached
as swaggerTree.txt. Its configuration in web is:

plugin

   groupIdcom.github.kongchen/groupId

   artifactIdswagger-maven-plugin/artifactId

   version1.0-SNAPSHOT/version

configuration

apiSources

apiSource

   apiPackagecom.thed.service.rest.resource/apiPackage

   apiVersionv1/apiVersion

   basePathhttp://localhost:8080/flex/services/rest/latest
/basePath


 
outputTemplate${basedir}/src/site/docs/template/rest/zephyr_html.mustache/outputTemplate


 outputPath${basedir}/src/main/webapp/data/rest-doc.html/outputPath

/apiSource

  /apiSources

  /configuration

  executions

  execution

   phaseprepare-package/phase

goals

 goalgenerate/goal

 /goals

/execution

  /executions

/plugin


Please provide me the input to solve this classpath issue.
​

-- 
Thanks,
Kavita Gupta Agarwal
[INFO] Scanning for projects...
[INFO] 
[INFO] 
[INFO] Building api-docs Maven Plugin 1.0-SNAPSHOT
[INFO] 
[INFO] 
[INFO] --- maven-dependency-plugin:2.1:tree (default-cli) @ api-docs ---
[INFO] com.thed:api-docs:maven-plugin:1.0-SNAPSHOT
[INFO] +- org.apache.maven:maven-artifact:jar:2.2.1:compile
[INFO] |  \- org.codehaus.plexus:plexus-utils:jar:1.5.15:compile
[INFO] +- org.apache.maven:maven-plugin-api:jar:2.2.1:compile
[INFO] +- org.apache.maven:maven-project:jar:2.2.1:compile
[INFO] |  +- org.apache.maven:maven-settings:jar:2.2.1:compile
[INFO] |  +- org.apache.maven:maven-profile:jar:2.2.1:compile
[INFO] |  +- org.apache.maven:maven-artifact-manager:jar:2.2.1:compile
[INFO] |  |  \- 
backport-util-concurrent:backport-util-concurrent:jar:3.1:compile
[INFO] |  +- org.apache.maven:maven-plugin-registry:jar:2.2.1:compile
[INFO] |  +- org.codehaus.plexus:plexus-interpolation:jar:1.11:compile
[INFO] |  \- 
org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-9-stable-1:compile
[INFO] +- org.apache.maven:maven-model:jar:2.2.1:compile
[INFO] +- org.apache.maven:maven-core:jar:2.0.9:compile
[INFO] |  +- org.apache.maven.wagon:wagon-file:jar:1.0-beta-2:runtime
[INFO] |  +- 
org.apache.maven:maven-plugin-parameter-documenter:jar:2.0.9:compile
[INFO] |  +- org.apache.maven.wagon:wagon-webdav:jar:1.0-beta-2:runtime
[INFO] |  |  \- slide:slide-webdavlib:jar:2.1:runtime
[INFO] |  | +- commons-httpclient:commons-httpclient:jar:2.0.2:runtime
[INFO] |  | +- jdom:jdom:jar:1.0:runtime
[INFO] |  | \- de.zeigermann.xml:xml-im-exporter:jar:1.1:runtime
[INFO] |  +- 
org.apache.maven.wagon:wagon-http-lightweight:jar:1.0-beta-2:runtime
[INFO] |  |  \- org.apache.maven.wagon:wagon-http-shared:jar:1.0-beta-2:runtime
[INFO] |  | \- jtidy:jtidy:jar:4aug2000r7-dev:runtime
[INFO] |  +- org.apache.maven.reporting:maven-reporting-api:jar:2.0.9:compile
[INFO] |  |  \- org.apache.maven.doxia:doxia-sink-api:jar:1.0-alpha-10:compile
[INFO] |  +- org.apache.maven.wagon:wagon-provider-api:jar:1.0-beta-2:compile
[INFO] |  +- org.apache.maven:maven-repository-metadata:jar:2.0.9:compile
[INFO] |  +- org.apache.maven:maven-error-diagnostics:jar:2.0.9:compile
[INFO] |  +- commons-cli:commons-cli:jar:1.0:compile
[INFO

Re: Classpath issue in custom maven plugin

2014-09-15 Thread shailesh mangal
Limitation perhaps comes from OSGi where each bundle has its own class
loader. Did u try to run it from command line?
On Sep 15, 2014 6:36 AM, Kavita Gupta kavita.gpt1...@gmail.com wrote:


 Hi!

 I have created my own custom maven plugin(api-docs) for developing apiary
 blueprint. While triggering my custom plugin using m2Eclipse I am getting a
 classpath issue that classPath.getresources is fetching resources from
 plexus jar, while when I debug the swagger plugin (which I am taking as a
 reference) it is picking up the resources from rt.jar. In swagger I am
 getting web/target/classes in URLS but in my custom project I am not
 getting the  web/target/classes in URLS. Code snippet is:

 ClassLoader classLoader =
 Thread.currentThread().getContextClassLoader();


 System.out.println(classLoader.getResources(com/abc/service/rest/resource));

 assert classLoader != null;

 String path = packageName.replace('.', '/');

 EnumerationURL resources = classLoader.getResources(path);


 My custom plugin's dependency tree is attached(apidocsTree.txt). I have
 integrated it in my other project i.e web. Here is the web pom
 configuration for the plugin.

 plugin

   groupIdcom.thed/groupId

   artifactIdapi-docs/artifactId

   version1.0-SNAPSHOT/version

   configuration

 packageNamecom.thed.service.rest.resource/packageName

 vmFileapiary.vm/vmFile


 outputFileName${basedir}/target/apiary.apib/outputFileName

   /configuration

  executions

 execution

 phaseprepare-package/phase

 goals

 goalgenerateApiDocs/goal

 /goals

 /execution

 /executions

  /plugin



 I am taking swagger-plugin as a reference. Its dependency tree is attached
 as swaggerTree.txt. Its configuration in web is:

 plugin

groupIdcom.github.kongchen/groupId

artifactIdswagger-maven-plugin/artifactId

version1.0-SNAPSHOT/version

 configuration

 apiSources

 apiSource

apiPackagecom.thed.service.rest.resource/apiPackage

apiVersionv1/apiVersion

basePathhttp://localhost:8080/flex/services/rest/latest
 /basePath


  
 outputTemplate${basedir}/src/site/docs/template/rest/zephyr_html.mustache/outputTemplate


  outputPath${basedir}/src/main/webapp/data/rest-doc.html/outputPath

 /apiSource

   /apiSources

   /configuration

   executions

   execution

phaseprepare-package/phase

 goals

  goalgenerate/goal

  /goals

 /execution

   /executions

 /plugin


 Please provide me the input to solve this classpath issue.
 ​

 --
 Thanks,
 Kavita Gupta Agarwal



RE: Classpath issue in custom maven plugin

2014-09-15 Thread Martin Gainty

Date: Mon, 15 Sep 2014 19:06:56 +0530
Subject: Classpath issue in custom maven plugin
From: kavita.gpt1...@gmail.com
To: users@maven.apache.org
CC: shailesh.man...@gmail.com

Hi!
I have created my own custom maven plugin(api-docs) for developing apiary 
blueprint. While triggering my custom plugin using m2Eclipse I am getting a 
classpath issue that classPath.getresources is fetching resources from plexus 
jar, while when I debug the swagger plugin (which I am taking as a reference) 
it is picking up the resources from rt.jar. In swagger I am getting 
web/target/classes in URLS but in my custom project I am not getting the  
web/target/classes in URLS. Code snippet is:MG
ClassLoader classLoader = 
Thread.currentThread().getContextClassLoader();
System.out.println(classLoader.getResources(com/abc/service/rest/resource));  
  assert classLoader != null;String path = packageName.replace('.', 
'/');EnumerationURL resources = classLoader.getResources(path);
My custom plugin's dependency tree is attached(apidocsTree.txt). I have 
integrated it in my other project i.e web. Here is the web pom configuration 
for the plugin.
plugin  groupIdcom.thed/groupId  
artifactIdapi-docs/artifactId  version1.0-SNAPSHOT/version  
configuration
packageNamecom.thed.service.rest.resource/packageName 
vmFileapiary.vm/vmFile
outputFileName${basedir}/target/apiary.apib/outputFileName
/configuration executions   execution 
phaseprepare-package/phase  goals 
goalgenerateApiDocs/goal
/goals/execution/executions   
 /plugin

I am taking swagger-plugin as a reference. Its dependency tree is attached as 
swaggerTree.txt. Its configuration in web is:plugin   
groupIdcom.github.kongchen/groupId   
artifactIdswagger-maven-plugin/artifactId   version1.0-SNAPSHOT/version 
   configurationapiSources   apiSource
apiPackagecom.thed.service.rest.resource/apiPackage 
apiVersionv1/apiVersion 
basePathhttp://localhost:8080/flex/services/rest/latest/basePath

outputTemplate${basedir}/src/site/docs/template/rest/zephyr_html.mustache/outputTemplate

outputPath${basedir}/src/main/webapp/data/rest-doc.html/outputPath  
 /apiSource  /apiSources/configurationexecutions   
execution  phaseprepare-package/phase   
goals  goalgenerate/goal   /goals   
/execution/executions/plugin
Please provide me the input to solve this classpath issue.​

-- 
Thanks, Kavita Gupta Agarwal


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

antrun classpath with taskdef

2014-07-24 Thread Mansour Al Akeel
I am running a target in ant. This target depends on external task
from ddlutils.


profile
iddb/id
build
plugins
plugin
groupIdorg.apache.maven.
plugins/groupId
artifactIdmaven-antrun-plugin/artifactId
version1.7/version
executions
execution
idsetup-db/id
phaseprocess-resources/phase
goals
goalrun/goal
/goals
/execution
/executions
configuration
detailtrue/detail
target name=database-setup  
path id=current.classpath
path refid=maven.plugin.classpath /
path refid=maven.compile.classpath /
path refid=maven.runtime.classpath /
/path
taskdef name=ddlToDatabase
classname=org.apache.ddlutils.task.DdlToDatabaseTask
classpathref=current.classpath
!-- classpath
refid=current.classpath / --
/taskdef
property name=current_classpath
refid=current.classpath /
!-- pathconvert
pathsep=${line.separator}| |.  property=formatted.classpath
refid=current.classpath  / --
ddlToDatabase
database
driverClassName=org.postgresql.Driver
url=jdbc:postgresql://localhost/test username=postgres
password=postgres /
fileset dir=src/sql/
include name=schema.xml /
/fileset
createDatabase failonerror=true /
writeSchemaToDatabase /
/ddlToDatabase
/target
/configuration
dependencies
dependency
groupIdorg.apache.ddlutils/groupId
artifactIdddlutils/artifactId
version1.0/version
/dependency
dependency
groupIdlog4j/groupId
artifactIdlog4j/artifactId
version1.2.17/version
/dependency
!-- dependency --
!-- groupIdorg.postgresql/groupId --
!-- artifactIdpostgresql/artifactId --
!-- version9.3-1100-jdbc41/version --
!-- /dependency --
/dependencies
/plugin


The task creates a jdbc connection to load data into a DB. The
connection needs the JDBC driver.
If I add the driver to the dependencies section, everything works
fine. However, the dependency on the driver is declared somewhere else
(in the global dependencies), and this driver may change depending on
the DB. Therefore we don't want to declare it twice. The option we
have is to use maven.compile.classpath. However, for some reason, I
am getting an  exception about the driver class not found:

Caused by: org.apache.ddlutils.DatabaseOperationException: Error while
trying to create a database: org.postgresql.Driver
at 
org.apache.ddlutils.platform.postgresql.PostgreSqlPlatform.createOrDropDatabase(PostgreSqlPlatform.java:164)
at 
org.apache.ddlutils.platform.postgresql.PostgreSqlPlatform.createDatabase(PostgreSqlPlatform.java:201)
at 
org.apache.ddlutils.task.CreateDatabaseCommand.execute(CreateDatabaseCommand.java:80)
... 35 more
Caused by: java.lang.ClassNotFoundException: org.postgresql.Driver
at 
org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)
at 
org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass(ClassRealm.java:259)
at 
org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:235)
at 
org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:227)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:188)
at 
org.apache.ddlutils.platform.postgresql.PostgreSqlPlatform.createOrDropDatabase(PostgreSqlPlatform.java:155)
... 37 more


To troubleshoot the issue, I printed out the classpath ref
current.classpath, and the driver jar

Re: antrun classpath with taskdef

2014-07-24 Thread Ron Wheeler
Can you not just add all database drivers and have any of them available 
at run-time?


Ron


On 24/07/2014 5:18 PM, Mansour Al Akeel wrote:

I am running a target in ant. This target depends on external task
from ddlutils.


profile
 iddb/id
 build
 plugins
 plugin
 groupIdorg.apache.maven.
plugins/groupId
 artifactIdmaven-antrun-plugin/artifactId
 version1.7/version
 executions
 execution
 idsetup-db/id
 phaseprocess-resources/phase
 goals
 goalrun/goal
 /goals
 /execution
 /executions
 configuration
 detailtrue/detail
 target name=database-setup  
 path id=current.classpath
 path refid=maven.plugin.classpath /
 path refid=maven.compile.classpath /
 path refid=maven.runtime.classpath /
 /path
 taskdef name=ddlToDatabase
classname=org.apache.ddlutils.task.DdlToDatabaseTask
classpathref=current.classpath
 !-- classpath
refid=current.classpath / --
 /taskdef
 property name=current_classpath
refid=current.classpath /
 !-- pathconvert
pathsep=${line.separator}| |.  property=formatted.classpath
refid=current.classpath  / --
 ddlToDatabase
 database
driverClassName=org.postgresql.Driver
url=jdbc:postgresql://localhost/test username=postgres
password=postgres /
 fileset dir=src/sql/
 include name=schema.xml /
 /fileset
 createDatabase failonerror=true /
 writeSchemaToDatabase /
 /ddlToDatabase
 /target
 /configuration
 dependencies
 dependency
 groupIdorg.apache.ddlutils/groupId
 artifactIdddlutils/artifactId
 version1.0/version
 /dependency
 dependency
 groupIdlog4j/groupId
 artifactIdlog4j/artifactId
 version1.2.17/version
 /dependency
 !-- dependency --
 !-- groupIdorg.postgresql/groupId --
 !-- artifactIdpostgresql/artifactId --
 !-- version9.3-1100-jdbc41/version --
 !-- /dependency --
 /dependencies
 /plugin


The task creates a jdbc connection to load data into a DB. The
connection needs the JDBC driver.
If I add the driver to the dependencies section, everything works
fine. However, the dependency on the driver is declared somewhere else
(in the global dependencies), and this driver may change depending on
the DB. Therefore we don't want to declare it twice. The option we
have is to use maven.compile.classpath. However, for some reason, I
am getting an  exception about the driver class not found:

Caused by: org.apache.ddlutils.DatabaseOperationException: Error while
trying to create a database: org.postgresql.Driver
 at 
org.apache.ddlutils.platform.postgresql.PostgreSqlPlatform.createOrDropDatabase(PostgreSqlPlatform.java:164)
 at 
org.apache.ddlutils.platform.postgresql.PostgreSqlPlatform.createDatabase(PostgreSqlPlatform.java:201)
 at 
org.apache.ddlutils.task.CreateDatabaseCommand.execute(CreateDatabaseCommand.java:80)
 ... 35 more
Caused by: java.lang.ClassNotFoundException: org.postgresql.Driver
 at 
org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)
 at 
org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass(ClassRealm.java:259)
 at 
org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:235)
 at 
org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:227)
 at java.lang.Class.forName0(Native Method)
 at java.lang.Class.forName(Class.java:188

Re: antrun classpath with taskdef

2014-07-24 Thread Mansour Al Akeel
Let me make sure I understand what you suggest.

You are suggesting to add all available JDBC drivers to the plugin
dependencies list. This should solve the problem.
It might be a work around, but wondering if there's a solution that
allows me to access maven pom dependencies from taskdef, for the
future as well.

Please note that ddlutils needs log4j. log4j is included in the pom
dependencies as well.



On Thu, Jul 24, 2014 at 5:32 PM, Ron Wheeler
rwhee...@artifact-software.com wrote:
 Can you not just add all database drivers and have any of them available at
 run-time?

 Ron




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



Re: antrun classpath with taskdef

2014-07-24 Thread Ron Wheeler

On 24/07/2014 5:52 PM, Mansour Al Akeel wrote:

Let me make sure I understand what you suggest.

You are suggesting to add all available JDBC drivers to the plugin
dependencies list. This should solve the problem.


It also allows the system administrator to select the database at 
installation or  run-time rather than have to build a bunch of separate 
installation packages.

It might be a work around, but wondering if there's a solution that
allows me to access maven pom dependencies from taskdef, for the
future as well.
If you use an installer, you could make the jars part of package options 
that could be selected during the installation.

Please note that ddlutils needs log4j. log4j is included in the pom
dependencies as well.



On Thu, Jul 24, 2014 at 5:32 PM, Ron Wheeler
rwhee...@artifact-software.com wrote:

Can you not just add all database drivers and have any of them available at
run-time?

Ron






--
Ron Wheeler
President
Artifact Software Inc
email: rwhee...@artifact-software.com
skype: ronaldmwheeler
phone: 866-970-2435, ext 102


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



Re: Netbeans maven project with invalid POM/classpath problem

2014-05-01 Thread Glenn Brown
 how it got there!

 The 'injection' project has the following POM:

 --
 ?xml version=1.0 encoding=UTF-8?
 project xmlns=http://maven.apache.org/POM/4.0.0; xmlns:xsi=
 http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http://
 maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd;
 modelVersion4.0.0/modelVersion

 groupIdcom.oracle.cepdemo/groupId
 artifactIdTradeInjector4/artifactId
 version1.0-SNAPSHOT/version
 packagingapp-client/packaging

 nameTradeInjector4/name

 properties
 endorsed.dir${project.build.directory}/endorsed/endorsed.dir
 project.build.sourceEncodingUTF-8/project.build.sourceEncoding
 /properties

 dependencies
 dependency
 groupIdcom.oracle.cepdemo/groupId
 artifactIdcepdemopersistence/artifactId
 version1.0/version
 /dependency
 dependency
 groupIdcom.oracle/groupId
 artifactIdojdbc6/artifactId
 version11.2.0/version
 scoperuntime/scope
 /dependency
 dependency
 groupIdjavax/groupId
 artifactIdjavaee-api/artifactId
 version7.0/version
 scopeprovided/scope
 /dependency
 /dependencies

 build
 plugins
 plugin
 groupIdorg.apache.maven.plugins/groupId
 artifactIdmaven-compiler-plugin/artifactId
 version3.1/version
 configuration
 source1.7/source
 target1.7/target
 compilerArguments
 endorseddirs${endorsed.dir}/endorseddirs
 /compilerArguments
 /configuration
 /plugin
 plugin
 groupIdorg.apache.maven.plugins/groupId
 artifactIdmaven-acr-plugin/artifactId
 version1.0/version
 extensionstrue/extensions
 configuration
 archive
 manifest

 mainClasscom.oracle.cepdemo.tradeinjector4.Main/mainClass
 /manifest
 /archive
 /configuration
 /plugin
 plugin
 groupIdorg.apache.maven.plugins/groupId
 artifactIdmaven-jar-plugin/artifactId
 version2.4/version
 configuration
   archive
 manifest
   addClasspathtrue/addClasspath
 /manifest
   /archive
 /configuration
 /plugin
 plugin
 groupIdorg.apache.maven.plugins/groupId
 artifactIdmaven-dependency-plugin/artifactId
 version2.6/version
 executions
 execution
 phasevalidate/phase
 goals
 goalcopy/goal
 /goals
 configuration

 outputDirectory${endorsed.dir}/outputDirectory
 silenttrue/silent
 artifactItems
 artifactItem
 groupIdjavax/groupId

 artifactIdjavaee-endorsed-api/artifactId
 version7.0/version
 typejar/type
 /artifactItem
 /artifactItems
 /configuration
 /execution
 /executions
 /plugin
 /plugins
 /build

 /project

 ---

 The ojdbc jar is also colocated with the injection project jar. It is
 included as a runtime dependency in the persistence project and the
 injection project. I have tried to use the following fragment from the
 above POM to include the driver jar in the Class-path attribute in the
 Manifest file but this doesn't seem to do anything:

 plugin
 groupIdorg.apache.maven.plugins/groupId
 artifactIdmaven-jar-plugin/artifactId
 version2.4/version
 configuration
 archive
 manifest
 addClasspathtrue/addClasspath
 /manifest
 /archive
 /configuration
 /plugin


 I've set the classpath environment variable to include the driver jar and
 I've tried running appclient with the -classpath option but I cannot seem
 to set the appropriate classpath for appclient no matter what I try. 2
 weeks of misguided hacking in the evenings is enough so  I'm hoping someone
 out there who understands this technology can help

Re: Netbeans maven project with invalid POM/classpath problem

2014-05-01 Thread Glenn Brown
 is not used in any code
 - don't know how it got there!

 The 'injection' project has the following POM:

 --
 ?xml version=1.0 encoding=UTF-8?
 project xmlns=http://maven.apache.org/POM/4.0.0; xmlns:xsi=
 http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http://
 maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd;
 modelVersion4.0.0/modelVersion

 groupIdcom.oracle.cepdemo/groupId
 artifactIdTradeInjector4/artifactId
 version1.0-SNAPSHOT/version
 packagingapp-client/packaging

 nameTradeInjector4/name

 properties
 endorsed.dir${project.build.directory}/endorsed/endorsed.dir
 project.build.sourceEncodingUTF-8/project.build.sourceEncoding
 /properties

 dependencies
 dependency
 groupIdcom.oracle.cepdemo/groupId
 artifactIdcepdemopersistence/artifactId
 version1.0/version
 /dependency
 dependency
 groupIdcom.oracle/groupId
 artifactIdojdbc6/artifactId
 version11.2.0/version
 scoperuntime/scope
 /dependency
 dependency
 groupIdjavax/groupId
 artifactIdjavaee-api/artifactId
 version7.0/version
 scopeprovided/scope
 /dependency
 /dependencies

 build
 plugins
 plugin
 groupIdorg.apache.maven.plugins/groupId
 artifactIdmaven-compiler-plugin/artifactId
 version3.1/version
 configuration
 source1.7/source
 target1.7/target
 compilerArguments
 endorseddirs${endorsed.dir}/endorseddirs
 /compilerArguments
 /configuration
 /plugin
 plugin
 groupIdorg.apache.maven.plugins/groupId
 artifactIdmaven-acr-plugin/artifactId
 version1.0/version
 extensionstrue/extensions
 configuration
 archive
 manifest

 mainClasscom.oracle.cepdemo.tradeinjector4.Main/mainClass
 /manifest
 /archive
 /configuration
 /plugin
 plugin
 groupIdorg.apache.maven.plugins/groupId
 artifactIdmaven-jar-plugin/artifactId
 version2.4/version
 configuration
   archive
 manifest
   addClasspathtrue/addClasspath
 /manifest
   /archive
 /configuration
 /plugin
 plugin
 groupIdorg.apache.maven.plugins/groupId
 artifactIdmaven-dependency-plugin/artifactId
 version2.6/version
 executions
 execution
 phasevalidate/phase
 goals
 goalcopy/goal
 /goals
 configuration

 outputDirectory${endorsed.dir}/outputDirectory
 silenttrue/silent
 artifactItems
 artifactItem
 groupIdjavax/groupId

 artifactIdjavaee-endorsed-api/artifactId
 version7.0/version
 typejar/type
 /artifactItem
 /artifactItems
 /configuration
 /execution
 /executions
 /plugin
 /plugins
 /build

 /project

 ---

 The ojdbc jar is also colocated with the injection project jar. It is
 included as a runtime dependency in the persistence project and the
 injection project. I have tried to use the following fragment from the
 above POM to include the driver jar in the Class-path attribute in the
 Manifest file but this doesn't seem to do anything:

 plugin
 groupIdorg.apache.maven.plugins/groupId
 artifactIdmaven-jar-plugin/artifactId
 version2.4/version
 configuration
 archive
 manifest
 addClasspathtrue/addClasspath
 /manifest
 /archive
 /configuration
 /plugin


 I've set the classpath environment variable to include the driver jar and
 I've tried running appclient with the -classpath option but I cannot seem
 to set the appropriate classpath for appclient no matter what I try. 2
 weeks of misguided hacking in the evenings is enough so  I'm hoping someone
 out there who

Netbeans maven project with invalid POM/classpath problem

2014-04-30 Thread Mark
;

modelVersion4.0.0/modelVersion

groupIdcom.oracle.cepdemo/groupId
artifactIdTradeInjector4/artifactId
version1.0-SNAPSHOT/version
packagingapp-client/packaging

nameTradeInjector4/name

properties
endorsed.dir${project.build.directory}/endorsed/endorsed.dir
project.build.sourceEncodingUTF-8/project.build.sourceEncoding
/properties

dependencies
dependency
groupIdcom.oracle.cepdemo/groupId
artifactIdcepdemopersistence/artifactId
version1.0/version
/dependency
dependency
groupIdcom.oracle/groupId
artifactIdojdbc6/artifactId
version11.2.0/version
scoperuntime/scope
/dependency
dependency
groupIdjavax/groupId
artifactIdjavaee-api/artifactId
version7.0/version
scopeprovided/scope
/dependency
/dependencies

build
plugins
plugin
groupIdorg.apache.maven.plugins/groupId
artifactIdmaven-compiler-plugin/artifactId
version3.1/version
configuration
source1.7/source
target1.7/target
compilerArguments
endorseddirs${endorsed.dir}/endorseddirs
/compilerArguments
/configuration
/plugin
plugin
groupIdorg.apache.maven.plugins/groupId
artifactIdmaven-acr-plugin/artifactId
version1.0/version
extensionstrue/extensions
configuration
archive
manifest

mainClasscom.oracle.cepdemo.tradeinjector4.Main/mainClass
/manifest
/archive
/configuration
/plugin
plugin
groupIdorg.apache.maven.plugins/groupId
artifactIdmaven-jar-plugin/artifactId
version2.4/version
configuration
  archive
manifest
  addClasspathtrue/addClasspath
/manifest
  /archive
/configuration
/plugin
plugin
groupIdorg.apache.maven.plugins/groupId
artifactIdmaven-dependency-plugin/artifactId
version2.6/version
executions
execution
phasevalidate/phase
goals
goalcopy/goal
/goals
configuration

outputDirectory${endorsed.dir}/outputDirectory
silenttrue/silent
artifactItems
artifactItem
groupIdjavax/groupId

artifactIdjavaee-endorsed-api/artifactId
version7.0/version
typejar/type
/artifactItem
/artifactItems
/configuration
/execution
/executions
/plugin
/plugins
/build

/project

---

The ojdbc jar is also colocated with the injection project jar. It is 
included as a runtime dependency in the persistence project and the 
injection project. I have tried to use the following fragment from the 
above POM to include the driver jar in the Class-path attribute in the 
Manifest file but this doesn't seem to do anything:


plugin
groupIdorg.apache.maven.plugins/groupId
artifactIdmaven-jar-plugin/artifactId
version2.4/version
configuration
archive
manifest
addClasspathtrue/addClasspath
/manifest
/archive
/configuration
/plugin


I've set the classpath environment variable to include the driver jar 
and I've tried running appclient with the -classpath option but I cannot 
seem to set the appropriate classpath for appclient no matter what I 
try. 2 weeks of misguided hacking in the evenings is enough so  I'm 
hoping someone out there who understands this technology can help (as I 
clearly don't get sufficient understanding from 
tutorials/blogs/manuals/hacking..)


I am using :

Netbeans 8
Glassfish 4
JDK 1.7 (tried with 1.6 too with no difference)
Oracle 11.2.0.1
Oracle driver 'ojdbc6.jar', download from OTN
...  on a Windows 7 64-bit laptop

Thanks in advance for any help

Kind regards
Mark

-
To unsubscribe, e-mail: users-unsubscr

Re: Netbeans maven project with invalid POM/classpath problem

2014-04-30 Thread Barrie Treloar
On 1 May 2014 06:48, Mark mark@gmail.com wrote:

 Browsing the local Maven repository using Netbeans I find the following
  if I right-click on the ojdbc 11.2.0 jar and select 'View Details'

 --
 org.apache.maven.project.InvalidProjectModelException: 1 problem was
 encountered while building the effective model
 [FATAL] Non-parseable POM C:\Users\mcedward\.m2\
 repository\com\oracle\ojdbc6\11.2.0\ojdbc6-11.2.0.pom: end tag name
 /body must be the same as start tag meta from line 142 (position: TEXT
 seen ...!-- End of carousel script --\n/body... @453:8)  @ line 453,
 column 8  for project  for project
 at org.apache.maven.project.DefaultMavenProjectBuilder.
 transformError(DefaultMavenProjectBuilder.java:193)
 at org.apache.maven.project.DefaultMavenProjectBuilder.
 buildFromRepository(DefaultMavenProjectBuilder.java:240)
 at org.apache.maven.project.DefaultMavenProjectBuilder.
 buildFromRepository(DefaultMavenProjectBuilder.java:251)
 at org.apache.maven.project.DefaultMavenProjectBuilder.
 buildFromRepository(DefaultMavenProjectBuilder.java:258)
 at org.netbeans.modules.maven.repository.ui.
 ArtifactMultiViewFactory.readMavenProject(ArtifactMultiViewFactory.java:
 231)
 at org.netbeans.modules.maven.repository.ui.
 ArtifactMultiViewFactory.access$000(ArtifactMultiViewFactory.java:104)
 at org.netbeans.modules.maven.repository.ui.
 ArtifactMultiViewFactory$1.run(ArtifactMultiViewFactory.java:187)
 at org.openide.util.RequestProcessor$Task.run(
 RequestProcessor.java:1423)
 at
 org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2033)


Have you opened that file in a text editor?
It looks like malformed xml to me.

How did you install the ojdbc jars?
These need to be manually installed since they require you to agree to the OTN
License Agreement.


Excluding the main compile class from the classpath in failsafe

2014-04-11 Thread Benson Margulies
Strange as it might seem, I need to exclude the main compiled artifact
from the classpath while running an integration test.

The integration test is testing a framework that has it's own way to
get the stuff into the classpath. Obviously, I want to keep the
_test_.

Will 
http://maven.apache.org/surefire/maven-failsafe-plugin/integration-test-mojo.html#classpathDependencyExcludes
allow me to exclude the main project artifact without losing the test
itself?

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



Adding a classpath element within a Mojo

2014-01-19 Thread William Ferguson
I have a Mojo which needs to add an element to the compile time classpath
for future Mojos.

I'm struggling to find any doco that points in the right direction.

Is it possible?
If so, how should I go about it?


William


Re: Adding a classpath element within a Mojo

2014-01-19 Thread Anders Hammar
Do you want to change the classpath of the project or of other mojos?

Don't think either is possible. And if it was, I don't think it's wise. The
dependencies of the project should be declared and not magically added.

/Anders



On Sun, Jan 19, 2014 at 1:18 PM, William Ferguson 
william.fergu...@xandar.com.au wrote:

 I have a Mojo which needs to add an element to the compile time classpath
 for future Mojos.

 I'm struggling to find any doco that points in the right direction.

 Is it possible?
 If so, how should I go about it?


 William



Re: Adding a classpath element within a Mojo

2014-01-19 Thread William Ferguson
OK, let me clarify.

Project has dependencies on artifacts of type AAR (Android archive - an
archive that contains several sub-artifacts including a classes jar).

My Mojo unpacks the AAR artifacts and makes the sub-artifacts available to
other build components.

One of those build components is the maven-compiler-plugin. We want to add
the classes contained in the AAR dependencies to the compile classpath so
that the maven-compiler-plugin can compile our classes against the classes
from the AARs.

How do we do that?

William



On Mon, Jan 20, 2014 at 1:14 AM, Anders Hammar and...@hammar.net wrote:

 Do you want to change the classpath of the project or of other mojos?

 Don't think either is possible. And if it was, I don't think it's wise. The
 dependencies of the project should be declared and not magically added.

 /Anders



 On Sun, Jan 19, 2014 at 1:18 PM, William Ferguson 
 william.fergu...@xandar.com.au wrote:

  I have a Mojo which needs to add an element to the compile time classpath
  for future Mojos.
 
  I'm struggling to find any doco that points in the right direction.
 
  Is it possible?
  If so, how should I go about it?
 
 
  William
 



Re: Adding a classpath element within a Mojo

2014-01-19 Thread Ron Wheeler
I don't do any Android development but since no one had responded, I 
thought that I wight try to get you started (or unblocked).


Perhaps some of these references will help.
http://www.vandalsoftware.com/post/52468430435/publishing-an-android-library-aar-to-a-maven
http://stackoverflow.com/questions/15173923/external-android-library-projects-with-gradle
http://blog.glassdiary.com/post/67134169807/how-to-share-android-archive-library-aar-across

You might want to do some Googling to find exactly what you need.

Ron

On 19/01/2014 4:47 PM, William Ferguson wrote:

OK, let me clarify.

Project has dependencies on artifacts of type AAR (Android archive - an
archive that contains several sub-artifacts including a classes jar).

My Mojo unpacks the AAR artifacts and makes the sub-artifacts available to
other build components.

One of those build components is the maven-compiler-plugin. We want to add
the classes contained in the AAR dependencies to the compile classpath so
that the maven-compiler-plugin can compile our classes against the classes
from the AARs.

How do we do that?

William



On Mon, Jan 20, 2014 at 1:14 AM, Anders Hammar and...@hammar.net wrote:


Do you want to change the classpath of the project or of other mojos?

Don't think either is possible. And if it was, I don't think it's wise. The
dependencies of the project should be declared and not magically added.

/Anders



On Sun, Jan 19, 2014 at 1:18 PM, William Ferguson 
william.fergu...@xandar.com.au wrote:


I have a Mojo which needs to add an element to the compile time classpath
for future Mojos.

I'm struggling to find any doco that points in the right direction.

Is it possible?
If so, how should I go about it?


William




--
Ron Wheeler
President
Artifact Software Inc
email: rwhee...@artifact-software.com
skype: ronaldmwheeler
phone: 866-970-2435, ext 102


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



Re: Adding a classpath element within a Mojo

2014-01-19 Thread William Ferguson
Hi Ron, appreciate the references, but I am not attempting to build an
Android project, I am working on the android-maven-plugin which builds
Android projects. The AAR consumption within android-maven-plugin is
currently incomplete.

Ie I need to know how to add a compile time dependency within the Mojo that
consumes AAR artifacts. Not looking for a way to use Gradle to build.

William


On Mon, Jan 20, 2014 at 9:56 AM, Ron Wheeler rwhee...@artifact-software.com
 wrote:

 I don't do any Android development but since no one had responded, I
 thought that I wight try to get you started (or unblocked).

 Perhaps some of these references will help.
 http://www.vandalsoftware.com/post/52468430435/publishing-
 an-android-library-aar-to-a-maven
 http://stackoverflow.com/questions/15173923/external-
 android-library-projects-with-gradle
 http://blog.glassdiary.com/post/67134169807/how-to-share-
 android-archive-library-aar-across

 You might want to do some Googling to find exactly what you need.

 Ron


 On 19/01/2014 4:47 PM, William Ferguson wrote:

 OK, let me clarify.

 Project has dependencies on artifacts of type AAR (Android archive - an
 archive that contains several sub-artifacts including a classes jar).

 My Mojo unpacks the AAR artifacts and makes the sub-artifacts available to
 other build components.

 One of those build components is the maven-compiler-plugin. We want to add
 the classes contained in the AAR dependencies to the compile classpath so
 that the maven-compiler-plugin can compile our classes against the classes
 from the AARs.

 How do we do that?

 William



 On Mon, Jan 20, 2014 at 1:14 AM, Anders Hammar and...@hammar.net wrote:

  Do you want to change the classpath of the project or of other mojos?

 Don't think either is possible. And if it was, I don't think it's wise.
 The
 dependencies of the project should be declared and not magically added.

 /Anders



 On Sun, Jan 19, 2014 at 1:18 PM, William Ferguson 
 william.fergu...@xandar.com.au wrote:

  I have a Mojo which needs to add an element to the compile time
 classpath
 for future Mojos.

 I'm struggling to find any doco that points in the right direction.

 Is it possible?
 If so, how should I go about it?


 William



 --
 Ron Wheeler
 President
 Artifact Software Inc
 email: rwhee...@artifact-software.com
 skype: ronaldmwheeler
 phone: 866-970-2435, ext 102


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




Re: dependency build-classpath returns wrong order

2013-10-21 Thread dsilve
I have been able to understand where the issue is, but not how to solve it.
The wrong classpath is generated when I use the configuration property
excludeScope=provided.

So if I run:
mvn dependency:build-classpath 
I get the correct classpath, but if I run:
mvn dependency:build-classpath -DexcludeScope=provided
then the classpath has a weird order that doesn't correspond to the
dependency tree.

Is this a known bug of the dependency plugin?



--
View this message in context: 
http://maven.40175.n5.nabble.com/dependency-build-classpath-returns-wrong-order-tp5773306p5773488.html
Sent from the Maven - Users mailing list archive at Nabble.com.

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



dependency build-classpath returns wrong order

2013-10-18 Thread dsilve
Hi,
I am using the maven-dependency-plugin version 2.8.
If I run mvn dependency:build-classpath for one of my project I get the
correct order of the dependencies, but if I generate the classpath in the
maven build itself of my project then the order is messed up.
The plugin configuration I am using (from the effective pom) is below. 
I also tried using older versions of this plugin. 
Why is the order different for the same project and the same version of the
dependency plugin?

   plugin
artifactIdmaven-dependency-plugin/artifactId
version2.8/version
executions
  execution
idbuild-classpath/id
phasegenerate-sources/phase
goals
  goalbuild-classpath/goal
/goals
configuration
  excludeScopeprovided/excludeScope
  prefix\/prefix
  pathSeparator;/pathSeparator
  outputFileclasspath.txt/outputFile
  useBaseVersiontrue/useBaseVersion
/configuration
  /execution




--
View this message in context: 
http://maven.40175.n5.nabble.com/dependency-build-classpath-returns-wrong-order-tp5773306.html
Sent from the Maven - Users mailing list archive at Nabble.com.

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



adding directories to maven exec runtime classpath?

2013-08-29 Thread Karl Gierach
Greetings!

I had a question regarding adding 2 well known directories to the runtime 
classpath of the Exec Maven Plugin for the exec:exec action.

I had found some tips that ultimately don't work in this case wherein a 
directory being added to the class path is a requirement.

The various things I've tried, which don't work are:
1) tried package up the contents of these 2 directories as resources.  this 
didn't work and it really is not a real feasible long term solution for my 
problem anyway.  this involved trying to use the build-helper-maven-plugin
2) tried to add to the maven-surefire-plugin some 
additionalClasspathElements entries.  this had no effect.
3) tried adding 2 executableDependency elements underneath the 
exec-maven-plugin's configuration area.  This won't work because these 
executableDependencies are assumed to be normal Maven dependencies, of which 
the type 'directory' is not supported [as far as I can tell].

I'm looking for advice on what my next steps should be in order to get this 
working.  Are there any other known techniques, or do we need to patch the exec 
plugin code? (I'm certainly willing to give that a shot if that's required).

Sincerely,
Karl Gierach


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



  1   2   3   4   5   6   7   8   9   10   >