-
1. Re: prevent from compiling and packaging classes
mkouba Sep 12, 2012 4:52 AM (in response to nimo22)1 of 1 people found this helpfulHi,
this is not a task for Weld, Solder or any other extension but rather for your build tool (Ant, Maven, Gradle, ...). @Veto will just cause the type to be ignored during bean discovery.
-
2. Re: prevent from compiling and packaging classes
nimo22 Sep 12, 2012 6:54 AM (in response to mkouba)yes, I know, I can exclude packages or classes by maven (but not methods).
However, I have thought solder can do that job, too.
-
3. Re: prevent from compiling and packaging classes
mkouba Sep 12, 2012 7:29 AM (in response to nimo22)Well, normally you just can't do any packaging/compilation tasks at runtime, it's simply too late . I believe it's possible but would require some magic bytecode manipulation... (like JRebel, Byteman, etc. do). Nevertheless I wonder what use-case are you're thinking of?
-
4. Re: prevent from compiling and packaging classes
nimo22 Sep 13, 2012 7:47 AM (in response to mkouba)Yes, you are right, It is best to use build tool. With Maven I can exclude files (classes). However, look at the following use case:
@Exclude(value=true)
public void test(){
}
This can be achieved by commenting the method "test" (The compiler does not insert comments within the compiled code):
/*
public void test(){
}
*/
I can imagine to use this to decide on-the-air compilation of needed/unused methods because of "precompiling".
Or I can use permutations of my compilations. But I guess, the best is to use build tools.