facebook

Maven MyEclipse 7.0 fails to build war with current classes

  1. MyEclipse IDE
  2.  > 
  3. Maven for MyEclipse (Maven4MyEclipse)
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #295298 Reply

    mdurbin
    Member

    Maven MyEclipse 7.0 fails to build war with current classes

    I can do the exact same thing in MyEclipse 6.0 and the classes are current

    Here are some details to the

    Version: 7.0
    Build id: 7.0-20081201

    It is likely not in the cvs project as the exact same project in MyEclise 6.0 work and does not generate the most current class in the ./WEB-INF/class of the war file

    Here is part the debug mode of maven output during package goal
    DEBUG] – WEB-INF/classes/com/tektools/ttlgs/servlets/Training4Servlet.class wasn’t copied because it has already been packaged for overlay[currentBuild].
    [DEBUG] – WEB-INF/classes/com/tektools/ttlgs/servlets/Training5Servlet.class wasn’t copied because it has already been packaged for overlay[currentBuild].
    [DEBUG] – WEB-INF/classes/com/tektools/ttlgs/servlets/Training6Servlet.class wasn’t copied because it has already been packaged for overlay[currentBuild].
    [DEBUG] – WEB-INF/classes/com/tektools/ttlgs/servlets/TrainingServlet.class wasn’t copied because it has already been packaged for overlay[currentBuild].

    #295320 Reply

    mdurbin
    Member

    Putting the following entry into the pom.xml (or settings.xml not to screw up the other developers) seems (so far) to fix the problem. Note I was doing a clean before but it was working to package the new classes.
    <build>
    <plugins>
    <plugin>
    <artifactId>maven-clean-plugin</artifactId>
    <configuration>
    <filesets>
    <fileset>
    <directory>src/main/webapp/WEB-INF/</directory>
    <includes>
    <include>lib/</include>
    <include>classes</include>
    </includes>
    </fileset>
    </filesets>
    </configuration>
    </plugin>

    #295321 Reply

    I can’t see the issue? Is this breaking your build?

    MyEclipse compiles all Java files on-the-fly. On my setup Maven only says that “nothing to compile”.

    #295333 Reply

    mdurbin
    Member

    It does break the build in that it creates a package war that has older classes in the ./WEB-INF/classes folder. In other words, the package goal runs and makes a war file but the war file contains older classes in it.

    #295339 Reply

    Do you use pom.xml generated by MyEclipse or you have customized it somehow?

    #295340 Reply

    mdurbin
    Member

    It was a customer one. In fact, to address the other coders in our team whom do not use MyEclipse … the fix was moved out of the pom.xml and into my own ./m2/settings.xml file.

    #295341 Reply

    mdurbin
    Member

    Here is the pom file contents. Recall the fix is in the settings.xml

    <?xml version=”1.0″ encoding=”UTF-8″?>
    <project xmlns=”http://maven.apache.org/POM/4.0.0&#8243; xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance&#8221; xsi:schemaLocation=”http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd”&gt;
    <modelVersion>4.0.0</modelVersion>
    <artifactId>OurCompany-main-web</artifactId>
    <name>OurCompany-main-web</name>
    <packaging>war</packaging>
    <version>1.0.0-SNAPSHOT</version>
    <description>Our Website</description>
    <parent>
    <groupId>com.OurCompany</groupId>
    <artifactId>OurCompany</artifactId>
    <version>1</version>
    </parent>
    <scm>
    <connection>scm:cvs:local:/home/source:OurCompany-main-web</connection>
    <developerConnection>scm:cvs:local:/home/source:OurCompany-main-web</developerConnection>
    </scm>
    <build>
    <plugins>
    <plugin>
    <groupId>org.mortbay.jetty</groupId>
    <artifactId>maven-jetty-plugin</artifactId>
    <version>6.1.5</version>
    <configuration>
    <systemProperties>
    <systemPropery>
    <name>log4j.configuration</name>
    <value>file:./src/main/resources/log4j.xml</value>
    </systemPropery>
    </systemProperties>
    </configuration>
    </plugin>
    <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-scm-plugin</artifactId>
    <version>1.0</version>
    <configuration>
    <goals>install</goals>
    </configuration>
    </plugin>
    </plugins>
    </build>
    <dependencies>
    <dependency>
    <groupId>tomcat</groupId>
    <artifactId>servlet</artifactId>
    <version>4.0.6</version>
    <scope>provided</scope>
    </dependency>
    <dependency>
    <groupId>javax.mail</groupId>
    <artifactId>mail</artifactId>
    <version>1.4</version>
    </dependency>
    <dependency>
    <groupId>javax.servlet</groupId>
    <artifactId>servlet-api</artifactId>
    <version>2.4</version>
    <scope>provided</scope>
    </dependency>
    <dependency>
    <groupId>log4j</groupId>
    <artifactId>log4j</artifactId>
    <version>1.2.9</version>
    </dependency>
    <dependency>
    <groupId>mysql</groupId>
    <artifactId>mysql-connector-java</artifactId>
    <version>5.0.4</version>
    </dependency>
    <dependency>
    <groupId>com.OurCompany</groupId>
    <artifactId>profiler-utils</artifactId>
    <version>4.9.0-SNAPSHOT</version>
    </dependency>
    </dependencies>
    </project>

Viewing 7 posts - 1 through 7 (of 7 total)
Reply To: Maven MyEclipse 7.0 fails to build war with current classes

You must be logged in to post in the forum log in