Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [m2e-dev] Target folder outside project's folder -> exception

Hi Igor

I got four questions

1)
When I run the tests on my OSX box the tests seems to timout contacting the spawned Eclipse/SWT app.
Is there a way to increase the timout?

2)
You said I should add a regression test for the patch.
Do you want me to add the tests to 
"org.eclipse.m2e.tests" project or is there some other project that is the preferred?

3)
I was planning to call the test class something like
Bug361824BuildPathsTest.java
Is that inline with your conventions?

4)
The IP statement in the patch.
I am happy to use whatever you guys are using as default IP.
I suppose it is EPL.
Can you update me on the exact quote I need to use in the patch comment?

Thanks
Lucas


4 sep 2013 kl. 16:25 skrev Igor Fedorenko:

Sorry, wrong command, you need to run

 mvn clean install -Pits,uts -Dm2e-core.url="" href="file:///path-to-locally-built-m2e">file:///path-to-locally-built-m2e


--
Regards,
Igor

On 2013-09-04 9:48 AM, Lucas Persson wrote:
Hi Igor

OK, I will do the patch on master then.

But when I compile the tests I get this error:
[ERROR] Cannot resolve project dependencies:
[ERROR]   Software being installed: org.eclipse.m2e.tests 1.5.0.qualifier
[ERROR]   Missing requirement: com.ning.async-http-client
1.6.5.20130902-0741 requires 'package org.slf4j 1.6.2' but it could not
be found


I do not see that slf4j is downloaded or so.

When I compile the tests I set
the -Declipse-repo.url="" href="file:///path-to-locally-built-m2e">file:///path-to-locally-built-m2e to the unzipped
site.
Eg unzip org.eclipse.m2e.site-1.5.0-SNAPSHOT.zip

Is that the way to do it?

Thanks
Lucas


4 sep 2013 kl. 13:35 skrev Igor Fedorenko:

There were few tags I had forgot to push, m2e-1.4.0.20130601-0317 should
work for m2e 1.4.x now.

Do note that we will only accept patches that apply and work with latest
master HEAD, we do not generally accept patches against older versions.

--
Regards,
Igor

On 2013-09-04 5:46 AM, Lucas Persson wrote:
Hi again

Which tag in the git repo for the tests corresponds with the release tag
of "releases/1.4/1.4.0.20130601-0317"?

I do not see any obvious candidate:
$ git tag
0.10.0.20100205-2200
0.10.1.20100510-1546
0.10.2.20100623-1649
0.11.0.20100811-1422
0.11.1.20100927-1222
0.12.0.20101115-1102
0.13.0.20110321-1300
0.13.snapshot
MoveToEclipse
cq-4572
m2e-1.0.100.20110804-1717
m2e-1.1.0.20120530-0009
m2e-1.3.0.20130129-0926


"trunk" or main or head or what ever it is called in git seems to assume
m2e is at version 1.5.0-SNAPSHOT so that will not work with the m2e
stuff that I build from tag  "releases/1.4/1.4.0.20130601-0317"

Thanks
Lucas



3 sep 2013 kl. 17:49 skrev Igor Fedorenko:

The patch has to be attached to bugzilla and has to have IP-related
statement in the commit comment. This is Eclipse legal process
requirement.

To run m2e automated tests from IDE, right-click on
org.eclipse.m2e.tests project, run as junit plugin test. Alternatively,
you can run the test from command line using

mvn clean install -Pits,uts
-Declipse-repo.url="" href="file:///path-to-locally-built-m2e">file:///path-to-locally-built-m2e


--
Regards,
Igor

On 2013-09-03 11:37 AM, Lucas Persson wrote:
Ok

Is there some instructions on how to run the tests (the ones in your
other git repo )?

I generated the patch using git format-patch so I thought it would be
correct....

Kind regards
Lucas

3 sep 2013 kl. 17:16 skrev Igor Fedorenko <igor@xxxxxxxxxxxxxx
<mailto:igor@xxxxxxxxxxxxxx>
<mailto:igor@xxxxxxxxxxxxxx>>:

Lucas,

If you'd like to see this patch integrated in m2e, you'd need to
submit
it as git-format-patch formatted patches attached to eclipse bugzilla
and must have IP-raleted statement in the commit comment (see [1] for
details).

You will also need to provide corresponding automated regression test.

[1] http://wiki.eclipse.org/M2E_Development_Environment

--
Regards,
Igor

On 2013-09-03 11:02 AM, Lucas Persson wrote:
Hi Igor

Here is a patch that will support to have the build folder outside
the project's folder.
For sure it will fix the exception at
org.eclipse.m2e.core.project.configurator.AbstractLifecycleMapping.configure(AbstractLifecycleMapping.java:71).

I also updated the AbstractClasspathProvider in the M2E JDT plugin
so that JUnit works in such cases.

The patch (attached) is based on a branch on release tag of
"releases/1.4/1.4.0.20130601-0317"

By this patch the bug
"<https://bugs.eclipse.org/bugs/show_bug.cgi?id=361824>
-Regression[MNGECLIPSE-767]Path
must include project and resource name: /" will be fixed.

Also if this is added the the root pom.xml
             <pluginExecution>
                <pluginExecutionFilter>
                  <groupId>org.apache.maven.plugins</groupId>
                  <artifactId>maven-compiler-plugin</artifactId>
                  <versionRange>[2.0,)</versionRange>
                  <goals>
                    <goal>compile</goal>
                    <goal>testCompile</goal>
                  </goals>
                  <parameters>
                    <compilerId>javac</compilerId>
                  </parameters>
                </pluginExecutionFilter>
                <action>
                  <ignore></ignore>
                </action>
              </pluginExecution>

and given that the .classpatch and .project looks OK
It will be possible to have the build folder outside the project's
folder.
(As mentioned in the above bug)
The support will not be that smooth since the .classpath must be
correct for the beginning instead of generated by m2e.
But it will work.
Typical .classpath and .project
<classpath>
<classpathentry kind="src" path="src/main/java" />
<classpathentry kind="src" path="src/main/resources" />
<classpathentry kind="src" path="src/test/java"
output="target/test-classes"/>
<classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con"
path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>

<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>my-jar-artifactId1</name>
<comment />
<projects />
<buildSpec>
  <buildCommand>
    <name>org.eclipse.jdt.core.javabuilder</name>
    <arguments />
  </buildCommand>
  <buildCommand>
    <name>org.eclipse.m2e.core.maven2Builder</name>
    <arguments />
  </buildCommand>
</buildSpec>
<natures>
  <nature>org.eclipse.jdt.core.javanature</nature>
  <nature>org.eclipse.m2e.core.maven2Nature</nature>
</natures>
<linkedResources>
  <link>
    <name>target</name>
    <type>2</type>

<locationURI>M2_TARGET/org.example.groupId1/my-jar-artifactId1/target</locationURI>
  </link>
</linkedResources>
</projectDescription>

M2_TARGET must be defined in the workspace and point to the top
"target" folder outside the SCM area.



Thanks
Lucas








27 aug 2013 kl. 14:10 skrev Igor Fedorenko:

I think it is reasonable to patch
AbstractLifecycleMapping#configure to
tolerate projectFacade.getProjectRelativePath returning null. I
believe
this was the indent of the code, so the exception you get is a bug.
Please provide a quality patch (including regression tests) and I'll
review it.

To use different AbstractLifecycleMapping implementation, you
need to
1. define org.eclipse.m2e.core.lifecycleMappings extension
2. in (parent) pom.xml specific m2e lifecycle mapping configuration

 <pluginManagement>
   <plugins>
     <plugin>
       <groupId>org.eclipse.m2e</groupId>
       <artifactId>lifecycle-mapping</artifactId>
       <version>1.0.0</version>
       <configuration>
         <lifecycleMappingMetadata>
           <lifecycleMappings>
             <lifecycleMapping>
               <packagingType>...</packagingType>
               <lifecycleMappingId>...</lifecycleMappingId>
             </lifecycleMapping>
           </lifecycleMappings>
         </lifecycleMappingMetadata>
       </configuration>
     </plugin>
   </plugins>
 </pluginManagement>

You will have to define mapping for all packaging types you use in
your
project.

--
Regards,
Igor

On 2013-08-27 4:42 AM, Lucas Persson wrote:
Hi

I have defined that the target folder (and target/classes) shall be
outside the project's folder.
The reason to have it like this is that I am using a
proprietary SCM
which do not allow write access unless a file is checkout out.
And alas it does not have any type of "ignore" filter.

The thing is that every time I do "Maven->Update Project..." it
fails
like this:

An internal error occurred during: "Updating Maven Project".
Path must include project and resource name: /tiget-api

java.lang.IllegalArgumentException: Path must include project and
resource name: /tiget-api
at org.eclipse.core.runtime.Assert.isLegal(Assert.java:63)
at
org.eclipse.core.internal.resources.Workspace.newResource(Workspace.java:2163)
at
org.eclipse.core.internal.resources.Container.getFolder(Container.java:222)
at
org.eclipse.m2e.core.project.configurator.AbstractLifecycleMapping.configure(AbstractLifecycleMapping.java:71)


I am not sure what m2e does here but I guess it is updating the
output
folder (among other things)

The code that sort of breaks is this:
org.eclipse.m2e.core.project.configurator.AbstractLifecycleMapping,
method "configure()"

/**
 * Calls #configure method of all registered project configurators
 */
public void configure(ProjectConfigurationRequest request,
IProgressMonitor mon) throws CoreException {
  final SubMonitor monitor = SubMonitor.convert(mon, 5);
  try {

MavenPlugin.getProjectConfigurationManager().addMavenBuilder(request.getProject(),
null /*description*/,
        monitor.newChild(1));

    IMavenProjectFacade projectFacade =
request.getMavenProjectFacade();
    MavenProject mavenProject = request.getMavenProject();

    Build build = mavenProject.getBuild();
    if(build != null) {
      String directory = build.getDirectory();
      if(directory != null) {
*IContainer container =
projectFacade.getProject().getFolder(projectFacade.getProjectRelativePath(directory));*
        if(container != null) {
          if(!container.exists() && container instanceof
IFolder) {
            M2EUtils.createFolder((IFolder) container, true,
monitor.newChild(1));
          } else {
            container.setDerived(true, monitor.newChild(1));
          }
        }
      }
    }

It seems that *projectFacade.getProjectRelativePath(directory)
*returns
null when the pom.xml defines that the build folder is outside the
project's folder.
and that leads to exception in
*projectFacade.getProject().getFolder()
*instead of returning a NULL IContainer (which the code seems to
assume).


Is there a way to
"override" org.eclipse.m2e.jdt.internal.JarLifecycleMapping so
I can
make my own patched version?
It seems to be a bug on this: *Bug 361824*
<https://bugs.eclipse.org/bugs/show_bug.cgi?id=361824>
-Regression[MNGECLIPSE-767]Path
must include project and resource name: /
(when this is fixed I will have to implement a project
configurator that
fixes the build folder anyway but the above issue is blocking me
since
project configurations are called further down in the method.)

I am using m2e version 1.4.0_20130601-0317

Thanks
Lucas



--

Lucas Persson | Principal Member of Technical Staff
Phone: +4684773644 | | | Mobile: +46730946656
Oracle Communications Platform
ORACLE Sweden | Söder Mälarstrand 29, 6 tr | 118 25 Stockholm

Oracle Svenska AB, Kronborgsgränd 17, S-164 28 KISTA, reg.no
<http://reg.no>
<http://reg.no>
<http://reg.no>. 556254-6746
Oracle is committed to developing practices and products that help
protect the environment



_______________________________________________
m2e-dev mailing list
m2e-dev@xxxxxxxxxxx <mailto:m2e-dev@xxxxxxxxxxx>
<mailto:m2e-dev@xxxxxxxxxxx>
https://dev.eclipse.org/mailman/listinfo/m2e-dev
_______________________________________________
m2e-dev mailing list
m2e-dev@xxxxxxxxxxx <mailto:m2e-dev@xxxxxxxxxxx>
<mailto:m2e-dev@xxxxxxxxxxx>
https://dev.eclipse.org/mailman/listinfo/m2e-dev




Lucas Persson | Principal Member of Technical Staff
Phone: +4684773644 | | | Mobile: +46730946656
Oracle Communications Platform
ORACLE Sweden | Söder Mälarstrand 29, 6 tr | 118 25 Stockholm

Oracle Svenska AB, Kronborgsgränd 17, S-164 28 KISTA, reg.no
<http://reg.no>
<http://reg.no>. 556254-6746



Oracle is committed to developing practices and products that help
protect the environment



_______________________________________________
m2e-dev mailing list
m2e-dev@xxxxxxxxxxx <mailto:m2e-dev@xxxxxxxxxxx>
<mailto:m2e-dev@xxxxxxxxxxx>
https://dev.eclipse.org/mailman/listinfo/m2e-dev
_______________________________________________
m2e-dev mailing list
m2e-dev@xxxxxxxxxxx <mailto:m2e-dev@xxxxxxxxxxx>
<mailto:m2e-dev@xxxxxxxxxxx>
https://dev.eclipse.org/mailman/listinfo/m2e-dev
_______________________________________________
m2e-dev mailing list
m2e-dev@xxxxxxxxxxx <mailto:m2e-dev@xxxxxxxxxxx>
<mailto:m2e-dev@xxxxxxxxxxx>
https://dev.eclipse.org/mailman/listinfo/m2e-dev

_______________________________________________
m2e-dev mailing list
m2e-dev@xxxxxxxxxxx <mailto:m2e-dev@xxxxxxxxxxx>
<mailto:m2e-dev@xxxxxxxxxxx>
https://dev.eclipse.org/mailman/listinfo/m2e-dev

--

Lucas Persson | Principal Member of Technical Staff
Phone: +4684773644 | | | Mobile: +46730946656
Oracle Communications Platform
ORACLE Sweden | Söder Mälarstrand 29, 6 tr | 118 25 Stockholm

Oracle Svenska AB, Kronborgsgränd 17, S-164 28 KISTA, reg.no
<http://reg.no>
<http://reg.no>. 556254-6746
Oracle is committed to developing practices and products that help
protect the environment



_______________________________________________
m2e-dev mailing list
m2e-dev@xxxxxxxxxxx <mailto:m2e-dev@xxxxxxxxxxx>
https://dev.eclipse.org/mailman/listinfo/m2e-dev

_______________________________________________
m2e-dev mailing list
m2e-dev@xxxxxxxxxxx <mailto:m2e-dev@xxxxxxxxxxx>
https://dev.eclipse.org/mailman/listinfo/m2e-dev

--

Lucas Persson | Principal Member of Technical Staff
Phone: +4684773644 | | | Mobile: +46730946656
Oracle Communications Platform
ORACLE Sweden | Söder Mälarstrand 29, 6 tr | 118 25 Stockholm

Oracle Svenska AB, Kronborgsgränd 17, S-164 28 KISTA, reg.no
<http://reg.no>. 556254-6746
 Oracle is committed to developing practices and products that help
protect the environment



_______________________________________________
m2e-dev mailing list
m2e-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/m2e-dev

_______________________________________________
m2e-dev mailing list
m2e-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/m2e-dev

-- 

Lucas Persson | Principal Member of Technical Staff
Phone: +4684773644 | | | Mobile: +46730946656 
Oracle Communications Platform
ORACLE Sweden | Söder Mälarstrand 29, 6 tr | 118 25 Stockholm

Oracle Svenska AB, Kronborgsgränd 17, S-164 28 KISTA, reg.no. 556254-6746 
 Oracle is committed to developing practices and products that help protect the environment


Back to the top