Code Monkey home page Code Monkey logo

Comments (7)

hpehl avatar hpehl commented on May 27, 2024 1

Great. I'll leave this open then.

from elemento.

ibaca avatar ibaca commented on May 27, 2024 1

But this is totally NOT an elemento problem, it's either a maven or an IntelliJ issue not copying resources to the target folder (expected to be in the classpath). OTOH, IntelliJ updates the resources correctly when you "Build Project" which is the expected behavior for IntelliJ, and eclipse compiles constantly so it will probably copy the resource constantly too (not checked).

from elemento.

hpehl avatar hpehl commented on May 27, 2024

AFAICT the annotation processing API only supports reading resources from the class path: javax.annotation.processing.Filer.getResource(JavaFileManager.Location location, CharSequence pkg, CharSequence relativeName) using javax.tools.StandardLocation.CLASS_PATH as location.

I've tried different locations w/o success. As a workaround you can place your templates into src/main/java and configure HTML files as resources:

<build>
    <resources>
        <resource>
            <directory>src/main/java</directory>
            <includes>
                <include>**/*.html</include>
            </includes>
        </resource>
    </resources>
</build>

from elemento.

hpehl avatar hpehl commented on May 27, 2024

@vegegoku Does this work for you?

from elemento.

vegegoku avatar vegegoku commented on May 27, 2024

with this elemento can locate the file and generate the template, but yet this does not solve the stale copy of the file issue, since this does exactly what putting the file into the resources folder, it is still copying the file to the target folder, and intellij wont update the file after the edit until the rebuild project is triggered.

the actual solution for this is to detect the file without copying to the target folder.
i might help in this one and work on it later, and if i got a solution i will make PR. would you accept that?

from elemento.

hpehl avatar hpehl commented on May 27, 2024

I agree. We should not try to add "magic" into Elemento to workaround maven / IntelliJ issues or to support non standard builds.

from elemento.

vegegoku avatar vegegoku commented on May 27, 2024

TBH, i prefer the template to live in the resources folder, and also with the current issue with APT and resources even if we put the template in the sources folder instead of the resources folder we will still need to fire the apt processors, which means we are not really solving the issue.

from elemento.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.