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

我正在尝试使用目标mvn包创建一个maven项目。当我构建项目时,两个jar文件将生成一个demo-lwm2m-client-1.0-jar-with-dependencies.jar和另一个demo-lwm2m-client-1.0。 jar.Now如果我在src / main / resources文件中做了一些更改并再次构建项目,我发现demo-lwm2m-client-1.0-jar-with-dependencies.jar没有反映出我所做的更改在demo-lwm2m-client-1.0.jar中反映了更改。如何在依赖关系jar.Below中反映我的代码更改是我的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>


使用mvn clean install 。 这将重建所有内容并包含所有更改。

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

上一篇: maven build dependency jar file not reflecting changes in code

下一篇: Build order of Maven multimodule project?