maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anders Hammar <and...@hammar.net>
Subject Re: Add dependency to maven-compiler-plugin classpath
Date Wed, 20 Jan 2010 14:22:37 GMT
I don't understand what you're trying to do. You're saying you have a
compile time dependency you don't want to add as a normal dependency? It
doesn't make sense to me. Is it a dependency of your code or something
different?

/Anders

On Wed, Jan 20, 2010 at 15:00, Jan-Kees van Andel <
jankeesvanandel@apache.org> wrote:

> Hey,
>
> In my project I have a dependency that I only want to have on my
> compiler-plugin classpath, but not on my normal project classpath.
>
> This is my code:
> <build>
>  ...
>  <plugins>
>   ...
>   <plugin>
>     <groupId>org.apache.maven.plugins</groupId>
>     <artifactId>maven-compiler-plugin</artifactId>
>     <configuration>
>       <verbose>true</verbose>
>       <compilerArguments>
>         <s>${basedir}/target/generated-sources</s>
>       </compilerArguments>
>     </configuration>
>     <dependencies>
>       <dependency>
>         <groupId>my.dependency.groupId</groupId>
>         <artifactId>artifactId</artifactId>
>         <version>${parent.version}</version>
>         <scope>compile</scope>
>       </dependency>
>     </dependencies>
>   </plugin>
>   ...
>  </plugins>
>  ...
> </build>
>
> When I run Maven with -X, I see the following output by the compiler
> plugin:
> [INFO] [compiler:compile]
> [DEBUG] Using compiler 'javac'.
> [DEBUG] Source directories:
> [C:\java\work\idea-9\...\buildergenerator\test\src\main\java]
> [DEBUG] Classpath:
> [C:\java\work\idea-9\...\buildergenerator\test\target\classes
>
>  C:\java\maven-repo\nl\...\buildergenerator\buildergenerator-annotations\0.1-SNAPSHOT\buildergenerator-annotations-0.1-SNAPSHOT.jar
>  C:\java\maven-repo\joda-time\joda-time\1.6\joda-time-1.6.jar]
>
> When I add the same dependency as a project dependency, I see the
> following output:
> [INFO] [compiler:compile]
> [DEBUG] Using compiler 'javac'.
> [DEBUG] Source directories:
> [C:\java\work\idea-9\...\buildergenerator\test\src\main\java]
> [DEBUG] Classpath:
> [C:\java\work\idea-9\...\buildergenerator\test\target\classes
>
>  C:\java\maven-repo\nl\...\buildergenerator\buildergenerator-annotations\0.1-SNAPSHOT\buildergenerator-annotations-0.1-SNAPSHOT.jar
>
>  C:\java\maven-repo\nl\...\buildergenerator\buildergenerator-core\0.1-SNAPSHOT\buildergenerator-core-0.1-SNAPSHOT.jar
>  C:\java\maven-repo\org\freemarker\freemarker\2.3.15\freemarker-2.3.15.jar
>  C:\java\maven-repo\joda-time\joda-time\1.6\joda-time-1.6.jar]
>
> As you can see, I have one more dependency on my compiler classpath
> (buildergenerator-core-0.1-SNAPSHOT.jar).
>
> For some reason, the plugin dependency is not added to the compiler
> classpath.
>
> Is there a way to fix this? I've also tried to add a <classpath>
> element to <compilerArguments>, but this had the effect of removing
> all other dependencies from the classpath, which is of course also not
> desirable.
>
> Thanks ans regards,
> Jan-Kees
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message