0

So we got the jmjrst project from our prof. My problem is that whatever I do in my pom.xml there will be no main manifest attribute. This is the last thing I have to do now but I can't get it working.

pom.xml:(whole build part)

<build>
    <plugins>
        <plugin>
            <groupId>a1</groupId>
            <artifactId>1800</artifactId>
            <version>0.0.1-SNAPSHOT</version>
            <dependencies>
                <dependency>
                    <groupId>com.puppycrawl.tools</groupId>
                    <artifactId>checkstyle</artifactId>
                    <version>6.4.1</version>
                </dependency>
            </dependencies>
            <configuration>
                <consoleOutput>true</consoleOutput>
                <configLocation>${basedir}/src/test/resources/checkstyle_swt1.xml</configLocation>
            </configuration>
        </plugin>

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-assembly-plugin</artifactId>
            <version>2.4</version>
            <configuration>
                <descriptor>src/assembly/src.xml</descriptor>
            </configuration>
            <executions>
                <execution>
                    <phase>package</phase>
                    <goals>
                        <goal>single</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>

    </plugins>
    <pluginManagement>
        <plugins>
            <plugin>
                <groupId>a1</groupId>
                <artifactId>1800</artifactId>
                <version>0.0.1-SNAPSHOT</version>
                <configuration>
                    <source>1.7</source>
                    <target>1.7</target>
                    <archive>
                        <manifest>
                            <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                            <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
                            <addClasspath>true</addClasspath>
                            <classpathPrefix>lib/</classpathPrefix>
                            <mainClass>${basedir}src/main/java/jis/Main.java</mainClass>                                
                        </manifest>
                    </archive>
                </configuration>
            </plugin>
        </plugins>
    </pluginManagement>
</build>
NhatNienne
  • 937
  • 3
  • 11
  • 20
  • What is your question exactly? – KernelKoder Apr 28 '15 at 10:23
  • 1
    `` should be a class name, not a source file name. Something like `jis.Main`. – Thilo Apr 28 '15 at 10:24
  • Documentation shows how to do it properly: http://maven.apache.org/shared/maven-archiver/examples/classpath.html – Gimby Apr 28 '15 at 10:24
  • This might help you : http://stackoverflow.com/questions/19126636/maven-eclipse-plugin-and-mvn-not-including-main-class-with-pom-xml-setup – Arpit Aggarwal Apr 28 '15 at 10:25
  • @Thilo thanks. this helped me but I normally only used (com.x.x) for packages. This project doesnt have packages. So would it be still with the ${basedir}? or just src.main.java.jis.Main? – NhatNienne Apr 28 '15 at 10:29
  • okay I tried now both: jis.Main and src.main.java.jis.Main both didn't work. in my manifest file it doesn't even list "Main-Class: ". If I add it by myself (jis.Main or src.main.java.jis.Main) and run it I'll get an error that the main class can't be found or loaded. – NhatNienne Apr 28 '15 at 12:18
  • What is at the top of Main.java ? Is there a package statement there? According to the path you're trying to do, the Main class is in a package 'jis'. Or should be in a package 'jis'. – Gimby Apr 28 '15 at 13:09

0 Answers0