开发者

running application in nebeans using a maven project, saying no sources to compile

开发者 https://www.devze.com 2022-12-20 02:44 出处:网络
When I run the application, it says: [resources:resources] [WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!

When I run the application, it says:

[resources:resources]
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
Copying 1 resource
[compiler:compile]
No sources to compile
[resources:testResources]
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
skip non existing resourceDirectory E:\dev\netbeans\springmvc2\src\test\resources
[compiler:testCompile]
No sources to compile
[surefire:test]
No tests to run.

It's string, my only .java file named HomeController is in the following folder:

/Other Sources
/Other Sources/src/main/resources
/Other Sources/src/main/resources/com.example.web/HomeController.java

I first built this app in eclipse, but couldnt' get it to work, so I opened it up in netbeans. It worked the first time I ran it just by doing Run, but I wanted to change the context from http://localhost:8080/springmvc2/ to http://localhost:8080/ and once I did the change, I built it and now having some issues.

my pom.xml:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.example</groupId>
    <artifactId>springmvc2</artifactId>
    <packaging>war</packaging>
    <version>0.0.1-SNAPSHOT</version>
    <name>springmvc2 Maven Webapp</name>
    <url>http://maven.apache.org</url>
    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>3.8.1</version>
            <scope>test</scope>

        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-core</artifactId>
            <version>3.0.0.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-core</artifactId>
            <version>3.3.2.GA</version>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-annotations</artifactId>
            <version>3.4.0.GA</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-webmvc</artifactId>
            <version>3.0.0.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>org.mod4j.org.apache.commons</groupId>
            <artifactId>logging</artifactId>
            <version>1.0.4</version>
        </dependency>
        <dependency>
            <groupId>commons-logging</groupId>
            <artifactId>commons-logging</artifactId>
            <version>1.1.1</version>
        </dependency>
    </dependencies>
    <build>
        <finalName>springmvc2&l开发者_如何转开发t;/finalName>
        <filters>
        </filters>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>          
                <configuration>             
                    <source>1.6</source>
                    <target>1.6</target>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>


Move your controller from src/main/resources to src/main/java :)

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号