Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No sources files in "src/main/java" aborts the compilation processing #25

Closed
GoogleCodeExporter opened this issue Mar 18, 2015 · 8 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. create a parent pom project
2. create a child module of the parent 
3. in the child module, no java source in src/main/java

The child module have no java source in src/main/java, because it is a 
integration test module. Sources are in src/it/java or src/test/java.

What is the expected output? What do you see instead?

[INFO] [processor:process {execution: process}]
[INFO] Source directory: XXX added
[INFO] javac option: -cp
[INFO] javac option: XXX
[INFO] javac option: -proc:only
[INFO] javac option: -processor
[INFO] javac option: 
org.kaleidofoundry.core.plugin.processor.PluginAnnotationProcessor
[INFO] javac option: -d
[INFO] javac option: XXX\my_module\target\classes
[INFO] javac option: -s
[INFO] javac option: XXX\my_module\src\main\resources
javacTask: no source files
Usage: javacTask <options> <source files>
use -help for a list of possible options
[ERROR] execute error
java.lang.Exception: error during compilation
    at org.bsc.maven.plugin.processor.AbstractAnnotationProcessorMojo.executeWithExceptionsHandled(AbstractAnnotationProcessorMojo.java:250)
    at org.bsc.maven.plugin.processor.AbstractAnnotationProcessorMojo.execute(AbstractAnnotationProcessorMojo.java:129)
    at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
    at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
    at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
    at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
    at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] error during compilation

What version of the product are you using? On what operating system?

            <plugin>
                <groupId>org.bsc.maven</groupId>
                <artifactId>maven-processor-plugin</artifactId>
                <version>1.3.6</version>
                <executions>
                    <execution>
                        <id>process</id>
                        <goals>
                            <goal>process</goal>
                        </goals>
                        <phase>process-classes</phase>
                        <configuration>
                            <outputDirectory>${project.basedir}/src/main/resources</outputDirectory>
                            <processors>
                                <processor>org.kaleidofoundry.core.plugin.processor.PluginAnnotationProcessor</processor>
                            </processors>
                        </configuration>
                    </execution>
                </executions>
                <dependencies />
            </plugin>

Please provide any additional information below.

Regards,


Original issue reported on code.google.com by jerome.raduget on 24 Aug 2010 at 8:56

@GoogleCodeExporter
Copy link
Author

the maven-annotation-plugin is configure in the parent POM (multi modules)

Original comment by jerome.raduget on 24 Aug 2010 at 8:58

@GoogleCodeExporter
Copy link
Author

problem reproduced 

thx for feedbacks

Original comment by [email protected] on 24 Aug 2010 at 10:10

  • Changed state: Accepted

@GoogleCodeExporter
Copy link
Author

seems that is not possible run a javac CompilationTask without at least one 
source file.

This means that the possible solutions are:

1. skip annotations processor if no source files are detected
2. set <failOnError> parameter to false
3. set a different source location using <sourceDirectory> parameter

Which solution would be better for you?

Original comment by [email protected] on 24 Aug 2010 at 10:46

@GoogleCodeExporter
Copy link
Author

right, first solution suits me, i will try this in the given child module :

    <build>
        <plugins>
            <plugin>
                <groupId>org.bsc.maven</groupId>
                <artifactId>maven-processor-plugin</artifactId>
                <configuration>
                    <skip>true</skip>
                </configuration>
            </plugin>
        </plugins>
    </build>

I give you feed back as soon as possible

thanks for your work !

Original comment by jerome.raduget on 25 Aug 2010 at 7:31

@GoogleCodeExporter
Copy link
Author


I've deployed snapshot 1.3.7-SNAPSHOT 

It skip, automatically without need of further configuration, the processor 
task if no source file(s) will be detected

Please , as soon as possible, test it and give me feedback ... so that i'll 
make a new release 

Thx  

Original comment by [email protected] on 25 Aug 2010 at 9:58

  • Changed state: Started

@GoogleCodeExporter
Copy link
Author

Fine, it works perfectly!

Thx & Regards

Original comment by jerome.raduget on 26 Aug 2010 at 8:45

@GoogleCodeExporter
Copy link
Author

Fix has been deployed in 1.3.7 release

Thx  for feedbacks

Regards

Original comment by [email protected] on 27 Aug 2010 at 8:05

  • Changed state: Fixed

@GoogleCodeExporter
Copy link
Author

Issue 30 has been merged into this issue.

Original comment by [email protected] on 28 Jun 2011 at 8:13

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant