MPECLIPSE-56 Only create .classpath and javabuilder if sources are present
git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@116241 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
1 parent
f91db5539d
commit
86b723c835
6 files changed
+122
-1
No files matched your search
@@ -0,0 +1,2 @@
|
||||
.classpath
|
||||
.project
|
||||
@@ -0,0 +1,62 @@
|
||||
<!--
|
||||
/*
|
||||
* Copyright 2001-2004 The Apache Software Foundation.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
-->
|
||||
<project xmlns:j="jelly:core"
|
||||
xmlns:assert="assert"
|
||||
xmlns:ant="jelly:ant"
|
||||
xmlns:u="jelly:util"
|
||||
xmlns:maven="jelly:maven"
|
||||
xmlns:x="jelly:xml">
|
||||
|
||||
<goal name="testPlugin" prereqs="test-classpath, test-project">
|
||||
</goal>
|
||||
|
||||
<goal name="test-init">
|
||||
<j:set var="dotProject" value="${basedir}/.project"/>
|
||||
<j:set var="dotClasspath" value="${basedir}/.classpath"/>
|
||||
<attainGoal name="eclipse:clean"/>
|
||||
</goal>
|
||||
|
||||
<goal name="test-classpath">
|
||||
<attainGoal name="test-init"/>
|
||||
<attainGoal name="eclipse"/>
|
||||
<u:available file="${dotClasspath}">
|
||||
<j:set var="classpathFound" value="true"/>
|
||||
</u:available>
|
||||
<j:if test="${classpathFound}">
|
||||
<ant:fail>The classpath file was created, and shouldn't have been.</ant:fail>
|
||||
</j:if>
|
||||
|
||||
</goal>
|
||||
|
||||
<goal name="test-project">
|
||||
<attainGoal name="test-init"/>
|
||||
<attainGoal name="eclipse:generate-project"/>
|
||||
|
||||
<assert:assertFileExists file="${dotProject}" />
|
||||
|
||||
<u:file var="projectFile" name="${dotProject}"/>
|
||||
<x:parse var="projectDoc" xml="${projectFile.toURL()}" />
|
||||
<x:set var="natures" select="$projectDoc/projectDescription/natures/nature"/>
|
||||
<x:set var="countBuilder" select="count($projectDoc/projectDescription/buildSpec/buildCommand/name)"/>
|
||||
<assert:assertEquals expected="0" value="${countBuilder.intValue().toString()}" msg="Shouldn't find any builders."/>
|
||||
|
||||
</goal>
|
||||
|
||||
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1,48 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
/*
|
||||
* Copyright 2001-2004 The Apache Software Foundation.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
-->
|
||||
|
||||
|
||||
<project>
|
||||
<pomVersion>3</pomVersion>
|
||||
<extend>${basedir}/../project.xml</extend>
|
||||
<id>test-maven-eclipse-nosourcetest-plugin</id>
|
||||
<name>Test project for Maven Eclipse Plugin</name>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<id>maven</id>
|
||||
<version>beta-8</version>
|
||||
<jar>maven.jar</jar>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-jelly</groupId>
|
||||
<artifactId>commons-jelly-tags-xml</artifactId>
|
||||
<version>20030211.142705</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>3.8.1</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<sourceDirectory>src/main</sourceDirectory>
|
||||
<unitTestSourceDirectory>src/test</unitTestSourceDirectory>
|
||||
</build>
|
||||
</project>
|
||||
Reference in new issue
Block a user