jbosstools / m2e-wro4j

m2e connector for WRO4J
Eclipse Public License 2.0
34 stars 12 forks source link

First time clean is not setting ${project.build.finalName} value to m2e-wtp #23

Open manikantag opened 9 years ago

manikantag commented 9 years ago

Hi,

My project structure is very typical (plugin conf is at the end).

When cleaning for first time, seems ${project.build.finalName} is not set to m2e-wtp, but Maven is evaluating it to regular artifact name. Below is how the js-min and css-min dir are coming.

target
    ├───.wro4j
    ├───bo-web-0.0.1-SNAPSHOT
    │   ├───css-min            // generated here instead of m2e-wtp
    │   └───js-min
    ├───classes
    ├───m2e-wtp
    │   └───web-resources
    │       └───META-INF
    │           └─── ...
    └───test-classes

If I clean again (i.e., second time), files are generating correctly.

target
    ├───.wro4j
    ├───bo-web-0.0.1-SNAPSHOT
    │   ├───css-min
    │   └───js-min
    ├───classes
    ├───m2e-wtp
    │   └───web-resources
    │       ├───css-min            // generated correct
    │       ├───js-min
    │       └───META-INF
    │           └─── ...
    └───test-classes

wro4j plugin config:

<plugin>
    <groupId>ro.isdc.wro4j</groupId>
    <artifactId>wro4j-maven-plugin</artifactId>
    <executions>
        <execution>
            <id>js-minify</id>
            <phase>compile</phase>
            <goals>
                <goal>run</goal>
            </goals>
            <configuration>
                <debug>true</debug>
                <targetGroups>angular-deps,app-bundle</targetGroups>
                <minimize>true</minimize>
                <wroManagerFactory>com.manikanta.wro4j.maven.CustomWroManagerFactory</wroManagerFactory>
                <groupNameMappingFile>${project.build.directory}/${project.build.finalName}/js-min/group-mapping.properties</groupNameMappingFile>
            </configuration>
        </execution>
        <execution>
            <id>css-minify</id>
            <phase>compile</phase>
            <goals>
                <goal>run</goal>
            </goals>
            <configuration>
                <targetGroups>styles</targetGroups>
                <minimize>true</minimize>
                <groupNameMappingFile>${project.build.directory}/${project.build.finalName}/css-min/group-mapping.properties</groupNameMappingFile>
            </configuration>
        </execution>
    </executions>

    <configuration>
        <contextFolder>${basedir}/src/main/webapp/</contextFolder>
        <destinationFolder>${project.build.directory}/${project.build.finalName}</destinationFolder>
        <jsDestinationFolder>${project.build.directory}/${project.build.finalName}/js-min</jsDestinationFolder>
        <cssDestinationFolder>${project.build.directory}/${project.build.finalName}/css-min</cssDestinationFolder>
        <wroFile>${basedir}/src/main/resources/wro.xml</wroFile>
        <extraConfigFile>${basedir}/src/main/resources/wro.properties</extraConfigFile>
        <wroManagerFactory>ro.isdc.wro.maven.plugin.manager.factory.ConfigurableWroManagerFactory</wroManagerFactory>
        <ignoreMissingResources>false</ignoreMissingResources>
        <incrementalBuildEnabled>true</incrementalBuildEnabled>
        <parallelProcessing>true</parallelProcessing>
    </configuration>
</plugin>
fbricon commented 9 years ago

How do you clean it? mvn clean or Project > Clean in eclipse?

fbricon commented 9 years ago

Providing a sample project to reproduce the problem would help

manikantag commented 9 years ago

Project > Clean. Normal Maven build is working fine. I'll create a new project and will share with you.