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

Unable to load processor #1002

Closed
ttben opened this issue Nov 23, 2016 · 4 comments
Closed

Unable to load processor #1002

ttben opened this issue Nov 23, 2016 · 4 comments

Comments

@ttben
Copy link

ttben commented Nov 23, 2016

Hi there

I am trying to do a dead-simple example of spoon for teaching purpose and facing an Unable to load processor issue that I don't understand.

Context:

  • maven project
  • using spoon-core version 5.4.0 according to the official website
  • using spoon maven plugin in v. 2.4
  • executing mvn clean install command at the root of my project

Below, an extract of my pom.xml file:

<dependencies> <dependency> <groupId>fr.inria.gforge.spoon</groupId> <artifactId>spoon-core</artifactId> <version>5.3.0</version> </dependency> </dependencies>

` <build>
    <plugins>
        <plugin>
            <groupId>fr.inria.gforge.spoon</groupId>
            <artifactId>spoon-maven-plugin</artifactId>
            <version>2.4</version>
            <executions>
                <execution>
                    <phase>generate-sources</phase>
                    <goals>
                        <goal>generate</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>
                <processors>
                    <processor>fr.unice.test.spoon.processor.GTToLTProcessor</processor>
                    <processor>fr.unice.test.spoon.processor.LTToGTProcessor</processor>
                </processors>
            </configuration>
            <!-- To be sure that you use the latest version of Spoon, specify it as dependency. -->
            <dependencies>
                <dependency>
                    <groupId>fr.inria.gforge.spoon</groupId>
                    <artifactId>spoon-core</artifactId>
                    <version>5.3.0</version>
                </dependency>
            </dependencies>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <configuration>
                <source>1.6</source>
                <target>1.6</target>
            </configuration>
            <version>3.5.1</version>
        </plugin>

    </plugins>
</build>`

I don't understand why I need to specify a precompile option or to include something in the classpath since my processor are in the current project:

src/main/java/fr/unice/test/spoon/processor : GTToLTProcessor.java | LTToGTProcessor.java

I have found this issue that may be related or not.

I expected that mvn clean install will run my processors on all java files in classpath, and output the result in a specific folder.

Need help on this !

thanks !

@monperrus
Copy link
Collaborator

The processors are in the same project as the code to be transformed? (this is not recommended)

Does it work with the precompile flag?

@ttben
Copy link
Author

ttben commented Nov 23, 2016

I tried to specify the precompile flag and it did not worked

About my maven project structure, I have now:

  • parent pom, containing dependencies on spoon core, spoon plugin and processors
  • a submodule containing processors
  • a submodule containing sources to handle

Is that correct?

@monperrus
Copy link
Collaborator

that's better. and the second submodule must depend on the first one.

@ttben
Copy link
Author

ttben commented Nov 23, 2016

Ok thanks !
It is working :)

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

2 participants