Filipe Sousa created MCOMPILER-312:
--------------------------------------

             Summary: Maven annotation processor compiler error after changing 
the code
                 Key: MCOMPILER-312
                 URL: https://issues.apache.org/jira/browse/MCOMPILER-312
             Project: Maven Compiler Plugin
          Issue Type: Bug
    Affects Versions: 3.7.0
         Environment: ./mvnw --version
Apache Maven 3.5.0 (ff8f5e7444045639af65f6095c62210b5713f426; 
2017-04-03T20:39:06+01:00)
Maven home: 
/Users/fsousa/.m2/wrapper/dists/apache-maven-3.5.0-bin/6ps54u5pnnbbpr6ds9rppcc7iv/apache-maven-3.5.0
Java version: 1.8.0_144, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.13.1", arch: "x86_64", family: "mac"

            Reporter: Filipe Sousa


Hi,

I'm having some using dagger with maven. Is this project 
([https://github.com/natros/dagger2-mcp-test]) when I make a change I have to 
clean install otherwise I'm getting compiler errors.

Steps to reproduce:

first time compile, compiles ok

{noformat}
./mvnw clean compile
{noformat}

changing the code

{noformat}
sed -i -e 's@AuthService@//AuthService@' 
src/main/java/com/github/natros/mcp/Main.java
{noformat}

compile without clean and fail

{noformat}
./mvnw compile
{noformat}

clean compile and no errors

{noformat}
./mvnw clean compile
{noformat}


On a large project it does not makes sense to clean before compiling.

This is the error I'm getting:

{noformat}
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] 
/Users/fsousa/Projects/tmp/dagger2-mcp-test/target/generated-sources/annotations/com/github/natros/mcp/DaggerMyComponent.java:[30,37]
 method create in class com.github.natros.mcp.Main_Factory cannot be applied to 
given types;
  required: 
javax.inject.Provider<com.github.natros.mcp.AuthService>,javax.inject.Provider<com.github.natros.mcp.UserService>
  found: dagger.internal.Factory<com.github.natros.mcp.UserService>
  reason: actual and formal argument lists differ in length
[ERROR] 
/Users/fsousa/Projects/tmp/dagger2-mcp-test/target/generated-sources/annotations/com/github/natros/mcp/Main_Factory.java:[26,12]
 constructor Main in class com.github.natros.mcp.Main cannot be applied to 
given types;
  required: com.github.natros.mcp.UserService
  found: com.github.natros.mcp.AuthService,com.github.natros.mcp.UserService
  reason: actual and formal argument lists differ in length
[INFO] 2 errors 
{noformat}

I asked this question to dagger creators who told me that this is a maven bug 
not a dagger one.
[https://github.com/google/dagger/issues/881#issuecomment-335854660]




--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to