首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >maven构建依赖项jar文件不反映代码中的更改

maven构建依赖项jar文件不反映代码中的更改
EN

Stack Overflow用户
提问于 2017-10-06 18:37:20
回答 1查看 3.5K关注 0票数 1

现在,如果我在src/ package.When /package.When中对我的一个文件做了一些修改,然后重新构建这个项目,我发现demo-lwm2m-client-1.0-jar-with-dependencies.jar没有反映我在代码中所做的更改,而demo-lwm2m-client-1.0.jar反映了changes.How,以反映我在依赖项中的代码更改。jar.Below是我的pom.xml的代码。">http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0

代码语言:javascript
复制
<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>

EN

回答 1

Stack Overflow用户

发布于 2017-10-08 01:16:57

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

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/46603851

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档