jlgrock / ClosureJavascriptFramework

A group of plug-ins that can be used in conjunction with maven to execute the Google Closure Compiler on JavaScript code. This Framework allows for scaling and modularity.
MIT License
16 stars 7 forks source link

skipTests not honoured if property value set in profile #51

Closed lukas-vlcek closed 10 years ago

lukas-vlcek commented 10 years ago

I think I found one issue related to #50 -DskipTests seems to work as expected if it is set on the command line but it does not seem to work if it is configured in the profile section like this:

<profile>
        <id>skipTest_profile</id>
        <properties>
            <skipTests>true</skipTests>
        </properties>
        <build> [...] </build>
</profile>

I think such use case is pretty rare but may be there are other more common ways how to hit it or this might be a symptom of something more serious.

jlgrock commented 10 years ago

Is that even valid? I think you have to do something like this:

<profile>
       <id>skipTest_profile</id>
       <plugins>
              <plugin>
                     <groupId>com.github.jlgrock.javascript-framework</groupId>
                     <artifactId>closure-testing-maven-plugin</artifactId>
                     <version>1.18.2</version>
                     <configuration>
                            <skipTests>true</skipTests>
                     </configuration>
              </plugin>
        </plugins>
</profile>

Does adding a property like that work with the surefire plugin?

lukas-vlcek commented 10 years ago

Is that even valid?

Good question, I am not maven expert but I found this notation on some StackOverflow site and if I used it then I noticed that it was respected by other testing plugins. Specifically by

<plugin>
    <groupId>com.googlecode.jstd-maven-plugin</groupId>
    <artifactId>jstd-maven-plugin</artifactId>
    <version>1.3.5.1</version>
</plugin>

so I thought that it might be ok. However, looking at Maven POM Profiles reference it seems I should put the <properties/> under <activation/>. I will give it try and report back.

lukas-vlcek commented 10 years ago

Ah... the <property> thing under <activation> is for something else. The doc reads: "The profile will activate if Maven detects a property (a value which can be dereferenced within the POM by ${name}) of the corresponding name=value pair."

lukas-vlcek commented 10 years ago

Hey... it works after all! I was putting the code into wrong pom.xml file. So here it how it works:

<profile>
    <id>profile_wihtout_tests</id>
    <properties>
        <skipTests>true</skipTests>
        <maven.test.skip>true</maven.test.skip>
    </properties>
    [...]
</profile>

Both the skipTests and maven.test.skip options do what they are expected to do and can be used separately of course.

For sure this requires com.github.jlgrock.javascript-framework version 1.18.2 and above.

jlgrock commented 10 years ago

Well, that's good to know. I've added it to the wiki so that I don't forget :)

On Wed, Aug 20, 2014 at 1:29 PM, Lukáš Vlček notifications@github.com wrote:

Hey... it works after all! I was putting the code into wrong pom.xml file. So here it how it works:

profile_wihtout_tests true true [...]

Both the skipTests and maven.test.skip options do what they are expected to do and can be used separately of course.

For sure this requires com.github.jlgrock.javascript-framework version 1.18.2 and above.

— Reply to this email directly or view it on GitHub https://github.com/jlgrock/ClosureJavascriptFramework/issues/51#issuecomment-52812090 .