maven build dependency jar file not reflecting changes in code

I am trying to build a maven project using goal mvn package.When i build the project two jar files get genearted one demo-lwm2m-client-1.0-jar-with-dependencies.jar and the other demo-lwm2m-client-1.0.jar.Now if i do some changes in my a file placed in src/main/resources and build the project again , i find that demo-lwm2m-client-1.0-jar-with-dependencies.jar is not reflecting the changes what i did in code while demo-lwm2m-client-1.0.jar reflects changes.How to reflect my code changes in the dependency jar.Below is the code for my pom.xml. http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0

<groupId>com.demo.lwm2m.client</groupId>
<artifactId>demo-lwm2m-client</artifactId>
<packaging>jar</packaging>
<version>1.0</version>

<name>DemoLwm2mClient</name>
<url>http://maven.apache.org</url>

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<dependencies>
    <dependency>
        <groupId>org.eclipse.leshan</groupId>
        <artifactId>leshan-client-cf</artifactId>
        <version>1.0.0-M1</version>
    </dependency>


    <dependency>
        <groupId>com.appiot.examples</groupId>
        <artifactId>simulatedplatform</artifactId>
        <version>1.0</version>
    </dependency>
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>1.7.5</version>
    </dependency>

    <dependency>
        <groupId>commons-io</groupId>
        <artifactId>commons-io</artifactId>
        <version>2.4</version>
    </dependency>       
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-log4j12</artifactId>
        <version>1.7.5</version>
    </dependency>
</dependencies>
<repositories>

    <repository>
        <id>eclipse</id>
        <url>https://repo.eclipse.org/content/repositories/leshan-snapshots</url>
        <releases>
            <enabled>false</enabled>
        </releases>
        <snapshots>
            <enabled>true</enabled>
        </snapshots>
    </repository>       
</repositories>

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-assembly-plugin</artifactId>
            <version>2.4</version>
            <configuration>
                <archive>
                    <manifest>
                        <mainClass>com.demo.lwm2m.MainClass</mainClass>
                    </manifest>
                </archive>
                <descriptorRefs>
                    <descriptorRef>jar-with-dependencies</descriptorRef>
                </descriptorRefs>
            </configuration>
            <executions>
                <execution>
                    <id>make-assembly</id> <!-- this is used for inheritance merges -->
                    <phase>package</phase> <!-- bind to the packaging phase -->
                    <goals>
                        <goal>single</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
    </plugins>

</build>


Use mvn clean install . This will rebuild everything and all changes are included.

链接地址: http://www.djcxy.com/p/29686.html

上一篇: Maven:如何将代码中没有的jar包括到J2EE项目中?

下一篇: maven构建依赖关系jar文件没有反映代码中的变化